Skip to content
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

Adding a tikz method to FinitePoset class #38848

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

seblabbe
Copy link
Contributor

We add a tikz method to the class FinitePoset returning a TikzPicture instance from sage.misc.latex_standalone module.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • 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

It uses the tikz method for graphs added in #38798 and the follow-up small fix made in #38847.

Copy link

github-actions bot commented Oct 24, 2024

Documentation preview for this PR (built with commit 4518878; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@fchapoton fchapoton self-assigned this Oct 28, 2024
Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo two small code formatting things. Once changed, you can set a positive review.

src/sage/combinat/posets/posets.py Outdated Show resolved Hide resolved
@fchapoton
Copy link
Contributor

J'ai essayé (dans une ubuntu 24.04 standard) et ca marche pas:

Here is the content of the stdout:This is LuaHBTeX, Version 1.17.0 (TeX Live 2023/Debian) 
 restricted system commands enabled.
(./tikz_p0213az4.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-01-22>
[\directlua]:1: module 'luaotfload-main' not found:
	no field package.preload['luaotfload-main']
	[kpse lua searcher] file not found: 'luaotfload-main'
Error in luaotfload: reverting to OT1

! LaTeX Error: File `luatex85.sty' not found.

@fchapoton
Copy link
Contributor

after installing texlive-luatex, still not working. Here is part of the log

! Undefined control sequence.
<recently read> \text 
      
l.120 ...x{\vertex}{$\text{\texttt{[1,{ }2,{ }0]}}$}
                                                  \Vertex[style={minimum siz...

[1
Missing character: There is no [ (U+005B) in font nullfont!
Missing character: There is no 0 (U+0030) in font nullfont!

@fchapoton
Copy link
Contributor

The previous issues may be due to complicated nature of elements in the example I tried. With simpler elements, this gives the usual ugly picture, despite graphviz and dot2tex being installed in ubuntu itself.

@seblabbe
Copy link
Contributor Author

Thanks for fixing the = to = (or vice versa?). I forgot this was asked by Travis.

J'ai essayé (dans une ubuntu 24.04 standard) et ca marche pas:

Here is the content of the stdout:This is LuaHBTeX, Version 1.17.0 (TeX Live 2023/Debian) 
 restricted system commands enabled.
(./tikz_p0213az4.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-01-22>
[\directlua]:1: module 'luaotfload-main' not found:
	no field package.preload['luaotfload-main']
	[kpse lua searcher] file not found: 'luaotfload-main'
Error in luaotfload: reverting to OT1

! LaTeX Error: File `luatex85.sty' not found.

Long time ago, when docker was still working on gitlab, I needed to add the line \RequirePackage{luatex85} for the doctests of my package to work on Debian 2016. That line was not necessary for versions after 2018 but was not harmful. You can see where it is added here:
https://github.com/sagemath/sage/blob/develop/src/sage/misc/latex_standalone.py#L505
Do you think what you experiment means we should get rid of that line now? If so, we can do this in an independent ticket.

@seblabbe
Copy link
Contributor Author

after installing texlive-luatex, still not working. Here is part of the log

! Undefined control sequence.
<recently read> \text 
      
l.120 ...x{\vertex}{$\text{\texttt{[1,{ }2,{ }0]}}$}
                                                  \Vertex[style={minimum siz...

[1
Missing character: There is no [ (U+005B) in font nullfont!
Missing character: There is no 0 (U+0030) in font nullfont!

The \Vertex error typically happens when dot2tex is not used. Graphs are drawn using the tkz_graph. Therefore, one needs to loads add the option usepackage=['tkz_graph'].

Maybe one solution is to double the doctest once with tag #optional - dot2tex and then again with #optional - !dot2tex using the new usage of ! for NOT as introduced in #38810 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants