-
-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
Description
Consider following minimal LaTeX file:
\documentclass{article}
\usepackage{sagetex}
\usepackage{tikz}
\begin{document}
\sagestr{(polytopes.great_rhombicuboctahedron()).tikz([4,5,6],45,scale=0.75)}
\end{document}
It is derived from
- https://doc.sagemath.org/html/en/thematic_tutorials/geometry/polytope_tikz.html
- https://jplab.github.io/polytope.html
Compiling with
$ pdflatex minimal-sagetex-issue-tikz.tex
...
(/usr/local/texlive/texmf-local/tex/latex/local/sagetex.sty
...
$ /usr/local/bin/sage minimal-sagetex-issue-tikz.sagetex.sage
Processing Sage code for minimal-sagetex-issue-tikz.tex...
Inline formula 0 (line 10)
Sage processing complete. Run LaTeX on minimal-sagetex-issue-tikz.tex again.
$ pdflatex minimal-sagetex-issue-tikz.tex
gives me follwoing error:
...
(./minimal-sagetex-issue-tikz.sagetex.sout
Runaway argument?
{{\begin {tikzpicture}[x={(0.767968cm, 0.559570cm)}, y={(-0.407418cm,\ETC.
! Paragraph ended before \@newl@bel was complete.
<to be read again>
\par
l.25
Manually expanding content within \newlabel{@sageinline0}{{
from .sout
into the LaTeX file allows me to have the result:
Also the example given on https://doc.sagemath.org/html/en/tutorial/sagetex.html works. It seems only a tikz related issue.
Possibly related issues:
- https://tex.stackexchange.com/questions/329456/using-sagetex-to-define-a-variable-for-a-tikz-picture
TikZ does a lot of weird low-level TeX stuff and it doesn't always play nicely with LaTeX's \ref and \label system.
Environment
- macOS 12.6.1
- MacTeX 2022
- Sage 9.7 v1.5.3 from https://github.com/3-manifolds/Sage_macOS
❯ /usr/local/bin/sage --version SageMath version 9.7, Release Date: 2022-09-19
- SageTex 3.6 installed via helper script in dmg from https://github.com/3-manifolds/Sage_macOS into
/usr/local/texlive/texmf-local
:❯ grep -A 1 \ProvidesPackage /usr/local/texlive/texmf-local/tex/latex/local/sagetex.sty \ProvidesPackage{sagetex} [2021/10/16 v3.6 embedding Sage into LaTeX documents]