cloud icon indicating copy to clipboard operation
cloud copied to clipboard

bug in sagews2pdf.py in markdown and latex

Open williamstein opened this issue 11 years ago • 0 comments

Put this in a worksheet

%md
<ol><li>$\left(\begin{matrix} 1 & 2 \\ 2 & 1 \end{matrix}\right)$</li>
<li>$\left(\begin{matrix} 1 & 2 \\ 2 & 1 \end{matrix}\right)$</li>
<li>$a^{p-1} \equiv 1 \pmod{p}$</li>
<li>$a^{p-1} \equiv 1 \pmod{p}$</li></ol>

It works fine. Then click the "print to pdf" button, and it gets mangled.

In the command line terminal (+New--> Terminal) type

 sagews2pdf.py --remove_tmpdir=false markdown.sagews  

where I'm assuming the Sage worksheet is "markdown.sagews". Then look at the corresponding tex file:

 more /tmp/tmpqHqonP/tmp.tex   # will be different for you

and see

\begin{lstlisting}
\end{lstlisting}\begin{enumerate}\item{${\textbackslash}left({\textbackslash}begin{matrix} 1 & 2 {\textbackslash}{\textbackslash} 2
 1 {\textbackslash}end{matrix}{\textbackslash}right)$}
...

To fix this will require modifying sagews2pdf.py. This file is in ~/.sagemathcloud. Copy it out first, modify it, then copy it back.

This bug was reported by Bobby Wills in the sage-cloud mailing list.

williamstein avatar Mar 03 '14 16:03 williamstein