Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-35394: Adding a save method to class Standalone/TikzPicture for co…
…mpatibility with sagetex We add a save method to class Standalone/TikzPicture for compatibility with sagetex. In particular, so that `\sageplot{t}` works when `t` is an instance of Standalone/TikzPicture classes. For example the following `file.tex`: ``` \documentclass{article} \usepackage[margin=2cm]{geometry} \usepackage{sagetex} \begin{document} \begin{sagecommandline} sage: from sage.misc.latex_standalone import TikzPicture sage: V = [[1,0,1],[1,0,0],[1,1,0],[0,0,-1],[0,1,0], ....: [-1,0,0],[0,1,1],[0,0,1],[0,-1,0]] sage: P = Polyhedron(vertices=V).polar() sage: s = P.projection().tikz([674,108,-731],112, output_type='LatexExpr') sage: t = TikzPicture(s) \end{sagecommandline} \begin{center} \sageplot{t} \end{center} \end{document} ``` will compile fine with the commands: ``` pdflatex file.tex sage file.sagetex.sage pdflatex file.tex ``` provided the `sagetex.sty` file is in the same repository. Since sagetex creates by defaults `eps` and `pdf` images, we added methods `dvi` and `eps` to the class Standalone following what was done in the other methods. Also, we added a feature `dvips` to tag the doctests with this new external feature. Finally, we made a small improvement to the latex feature by providing more information in the reason why a latex feature does not work. - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. URL: #35394 Reported by: Sébastien Labbé Reviewer(s): Frédéric Chapoton, Sébastien Labbé
- Loading branch information