sagetex icon indicating copy to clipboard operation
sagetex copied to clipboard

```\sagestr``` seems (subtly) broken

Open EmmanuelCharpentier opened this issue 7 years ago • 0 comments

The Pascal's triangle example on example.tex wokks. But this much simpler minimal example :

\documentclass{article}
\usepackage{sagetex}
\begin{document}

Sage won't admit that 2+2=\sagestr{2+2}. Ouch\,!

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

won't compile. The initial latex compilation fails with the following error :

ERROR: Missing $ inserted.

--- TeX said ---
<inserted text> 
                $
l.5 Sage won't admit that 2+2=\sagestr{2+2}

            .                                                            Ouch\,!
--- HELP ---
TeX probably found a command that can be used only in math mode when
it wasn't in math mode.  Remember that unless stated otherwise, all
all the commands of Section 3.3 in LaTeX Book (Lamport) can be used
only in math mode. TeX is not in math mode when it begins processing
the argument of a box-making command, even if that command is inside a
math environment. This error also occurs if TeX encounters a blank
line when it is in math mode.

Modifying the same minimal example to use \sage works, of course :

                              
\documentclass{article}
\usepackage{sagetex}
\begin{document}

Sage will admit that $2+2=\sage{2+2}$. Aaaahhh\,!

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

EmmanuelCharpentier avatar Jul 05 '17 07:07 EmmanuelCharpentier