-
-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the latex representation of crystals tableaux #38764
Conversation
Documentation preview for this PR (built with commit 53f0371; changes) is ready! 🎉 |
bdadc14
to
04b3417
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems somewhat complicated to reuse s
as a temporary variable compared to how it is used otherwise in the code. I think you should change the variable names around to avoid this.
04b3417
to
88edf1a
Compare
The dependency is only there for me and for reviewers on mac. After review, I may remove it. |
OK. Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I am not sure about “a tex box” being correct (text?). Feel free to push a quick fix if this is indeed a typo. Afterwards (or if correct), please set to a positive review.
It is "TeX box": https://en.wikibooks.org/wiki/LaTeX/Boxes Thanks! |
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#38745 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> sagemath#38339 URL: sagemath#38764 Reported by: Kwankyu Lee Reviewer(s): Travis Scrimshaw
With 10.5.beta7 on both macOS and fedora 39 sage -t --long --warn-long 25.9 --random-seed=223186311287983376594073409832509046315 src/sage/graphs/graph_latex.py
**********************************************************************
File "src/sage/graphs/graph_latex.py", line 1569, in sage.graphs.graph_latex.GraphLatex.tkz_picture
Failed example:
latex(B)
Expected:
\begin{tikzpicture}
...
\newsavebox{\vertex}
\sbox{\vertex}{${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}
\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}
\lr{1}\\\cline{1-1}
\end{array}$}
}$}\Vertex[style={minimum size=1.0cm,draw=cv0,fill=cfv0,text=clv0,shape=circle},LabelOut=false,L=\usebox{\vertex},x=...,y=...]{v0}
...
\end{tikzpicture}
Got:
\begin{tikzpicture}[>=latex,line join=bevel,]
%%
\node (node_0) at (8.4845bp,299.68bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{1}\\\cline{1-1}\end{array}$}}$};
\node (node_1) at (8.4845bp,227.09bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{2}\\\cline{1-1}\end{array}$}}$};
\node (node_2) at (8.4845bp,154.49bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{0}\\\cline{1-1}\end{array}$}}$};
\node (node_3) at (8.4845bp,81.894bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{\overline{2}}\\\cline{1-1}\end{array}$}}$};
\node (node_4) at (8.4845bp,9.2981bp) [draw,draw=none] {${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1}\lr{\overline{1}}\\\cline{1-1}\end{array}$}}$};
\draw [blue,->] (node_0) ..controls (8.4845bp,280.16bp) and (8.4845bp,261.7bp) .. (node_1);
\definecolor{strokecol}{rgb}{0.0,0.0,0.0};
\pgfsetstrokecolor{strokecol}
\draw (16.985bp,263.38bp) node {$1$};
\draw [red,->] (node_1) ..controls (8.4845bp,207.56bp) and (8.4845bp,189.1bp) .. (node_2);
\draw (16.985bp,190.79bp) node {$2$};
\draw [red,->] (node_2) ..controls (8.4845bp,134.97bp) and (8.4845bp,116.51bp) .. (node_3);
\draw (16.985bp,118.19bp) node {$2$};
\draw [blue,->] (node_3) ..controls (8.4845bp,62.37bp) and (8.4845bp,43.911bp) .. (node_4);
\draw (16.985bp,45.596bp) node {$1$};
%
\end{tikzpicture} |
You must have installed the optional package dot2tex to your systems. That changes the behavior of the graph drawing mechanism. There is nothing wrong with the doctests. Perhaps we need doctesting mechanism that negates |
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> motivated by sagemath#38764 (comment) fixes sagemath#38764 (comment) example: ```sage sage: SloaneEncyclopedia[60843] # optional - sloane_database [1, 6, 21, 107, 47176870] sage: SloaneEncyclopedia[60843] # optional - !sloane_database Traceback (most recent call last): ... OSError: The Sloane Encyclopedia database must be installed. Use e.g. 'SloaneEncyclopedia.install()' to download and install it. ``` along the way, we - define `sloane_database` feature (I wonder why it was missing) - fix `SloaneEncyclopedia` with the code by @sheerluck: https://github.c om/sheerluck)sagemath#34655 (comment) 1418189098 - fix the problem of `solve()` for rubiks cube of silently choosing the gap algorithm even when an algorithm is explicitly specified. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#38810 Reported by: Kwankyu Lee Reviewer(s):
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> motivated by sagemath#38764 (comment) fixes sagemath#38764 (comment) example: ```sage sage: SloaneEncyclopedia[60843] # optional - sloane_database [1, 6, 21, 107, 47176870] sage: SloaneEncyclopedia[60843] # optional - !sloane_database Traceback (most recent call last): ... OSError: The Sloane Encyclopedia database must be installed. Use e.g. 'SloaneEncyclopedia.install()' to download and install it. ``` along the way, we - define `sloane_database` feature (I wonder why it was missing) - fix `SloaneEncyclopedia` with the code by @sheerluck: https://github.c om/sheerluck)sagemath#34655 (comment) 1418189098 - fix the problem of `solve()` for rubiks cube of silently choosing the gap algorithm even when an algorithm is explicitly specified. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#38810 Reported by: Kwankyu Lee Reviewer(s):
Fixes #38745
📝 Checklist
⌛ Dependencies
#38339