Sagetex doesn't compile tex file with figures

asked 2018-01-29 21:03:58 +0200

Faisal gravatar image

updated 2018-01-30 11:12:23 +0200

Hi.. I am using Sagetex in Windows 10. I have a problem that arises when the number of plots in my tex file increases than four.

Here is the code I used

\documentclass{article}

\title{Examples of embedding Sage in \LaTeX{} with \textsf{Sage\TeX}}

\author{Dan Drake and others}

\usepackage{hyperref}

\usepackage{sagetex}

\setlength{\sagetexindent}{10ex}

\begin{document}

\maketitle

\section{Inline Sage, code blocks}

This is an example $2+2=\sage{2+2}$. If you raise the current year mod
$100$ (which equals $\sage{mod(\the\year, 100)}$) to the power of the
current day ($\the\day$), you get $\sage{Integer(mod(\the\year,
100))^\the\day}$. Also, $\the\year$ modulo $42$ is $\sage{\the\year
\percent 42}$.

Code block which uses a variable \texttt{s} to store the solutions:
\begin{sageblock}
 1+1
 var('a,b,c')
 eqn = [a+b*c==20, b-a*c==-12, a+b==5]
 s = solve(eqn, a,b,c)
\end{sageblock}

Solutions of $\mbox{eqn}=\sage{eqn}$:
\[
\sage{s[0]}
\]
\[
\sage{s[1]}
\]

\begin{sageblock}
 eqn = [a+b*c==0, b-a*c==-2, a+b==5]
 s = solve(eqn, a,b,c)
\end{sageblock}

Solutions of $\mbox{eqn}=\sage{eqn}$:
\[
\sage{s[0]}
\]
\[
\sage{s[1]}
\]


You can use variables to hold plot objects and do stuff with them.
\begin{sageblock}
  p = plot(tan(x), x, -5, 5)
\end{sageblock}

Here's a small plot of $f$ from $-5$ to $5$, which I've centered:

\begin{center} \sageplot[scale=.2]{p} \end{center}

\begin{sageblock}
  p = plot(tan(x), x, -5, 5)
\end{sageblock}

Here's a small plot of $f$ from $-5$ to $5$, which I've centered:

\begin{center} \sageplot[scale=.2]{p} \end{center}

\begin{sageblock}
  p = plot(tan(x), x, -5, 5)
\end{sageblock}

Here's a small plot of $f$ from $-5$ to $5$, which I've centered:

\begin{center} \sageplot[scale=.2]{p} \end{center}

\begin{sageblock}
  p = plot(tan(x), x, -5, 5)
\end{sageblock}

Here's a small plot of $f$ from $-5$ to $5$, which I've centered:

\begin{center} \sageplot[scale=.2]{p} \end{center}

\begin{sageblock}
  p = plot(tan(x), x, -5, 5)
\end{sageblock}

Here's a small plot of $f$ from $-5$ to $5$, which I've centered:

\begin{center} \sageplot[scale=.2]{p} \end{center}


\end{document}

Sagetex can compile without any problem if I omit the last \sageplot. If it is there the shell will stop suddenly without giving any error message.

I appreciate your help

edit retag flag offensive close merge delete

Comments

1

Maybe it's a memory problem. This file works fine for me, for what it's worth.

John Palmieri gravatar imageJohn Palmieri ( 2018-01-30 19:17:50 +0200 )edit

Thanks, but I dont think it is a memory issue. I have enough memory in my PC.

Faisal gravatar imageFaisal ( 2018-01-30 21:06:20 +0200 )edit

This runs for me as well. Sometimes problems can disappear if you delete all but the .tex file and then recompile.

dazedANDconfused gravatar imagedazedANDconfused ( 2018-02-01 16:25:31 +0200 )edit