-
-
Notifications
You must be signed in to change notification settings - Fork 656
Add method tikz (or latex_standalone) within combinat.crystals module #38759
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
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit c88ab90; changes) is ready! 🎉 |
Hi Sebastien, Thank you for your branch. I had to fold in your branch with #38339 since otherwise the view command does not work on my MacOS. However, when I then run sage: B = crystals.Tableaux(['B',2],shape=[1]) I still get a cropped figure. Do I need to run another command? Anne |
…o 38759_tikz_crystals * 'tikz_crystals_tableaux' of github.com:seblabbe/sage: border=1pt by default adding tikz or latex_standalone methods within crystals module
Yes, you need to run another command. But your example made me realize that I forgot to add a method
Then, in the terminal, you can do:
Also, in the Jupyter notebook, it is transparent. That is, the following just draw the picture below the input cell:
Using I don't know if that is useful, but it is available. |
Thank you, Sebastien, for trying to address the issue described in #38745. However, the issue I have is that the view command (in general, not just for tableaux) with tightpage=True does not crop the picture correctly. It only shows a fraction of the picture. |
In fact, what I propose here does not fix view. It gives an alternative way to open the image in a viewer where you have more control on the output. For instance, when generating the tikzpicture object, you may increase the border to fix the cropping issue seen on a mac:
What you need to do is:
or even, maybe the default border is fine (you can test?):
|
because these are now fixed in sagemath#39594
I removed the 2 'known bug' tags since these are now fixed in #39594 |
sagemathgh-39594: fix latex code in one crystal file and also notices a bug in the unicode art, fixed here. The issue about latex was noticed in sagemath#38759 ### 📝 Checklist - [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. URL: sagemath#39594 Reported by: Frédéric Chapoton Reviewer(s): Travis Scrimshaw
sagemathgh-39594: fix latex code in one crystal file and also notices a bug in the unicode art, fixed here. The issue about latex was noticed in sagemath#38759 ### 📝 Checklist - [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. URL: sagemath#39594 Reported by: Frédéric Chapoton Reviewer(s): Travis Scrimshaw
We add a tikz (or latex_standalone) method within combinat.crystals module in every class where a latex method is defined. When the string is a tikzpicture, we add a tikz method. When the string is a generic picture, we add a latex_standalone method.
Hopefully, it fixes #38745.
📝 Checklist
⌛ Dependencies
None.
The branch was written on top of old SageMath version 10.4.beta9, Release Date: 2024-06-09
Notes
While writing this branch, it made me realize that the latex code generated by the following two methods is broken:
because the last draw command uses variable \t which is defined in the inner scope. I did not try to fix that issue here. This is why I added a "known bug" tag at two places.