1

Maybe someone aldready asked this, but I have the following problem.

I tried to compile an example I found here https://tex.stackexchange.com/a/483113/217249. I don't get any errors. I have sage installed and apparently sagetex.sty is known to pdflatex. However, I didn't get any pictures so far.

Here is my code:

\documentclass{amsart}
\usepackage{sagetex}
\begin{document}
    An elegant plot of the stream lines of the vector field \(\sin x \partial_x + \cos y \partial y\).
    \begin{sagesilent}
        x, y = var('x y')
    \end{sagesilent}
    \begin{center}
        \sageplot[width=\textwidth]{streamline_plot((sin(x), cos(y)), (x,-3,3), (y,-3,3))}
    \end{center}
\end{document}

And here is the "plot": enter image description here

I'm not sure, maybe its not latex error at all...

  • 1
    Have you run sage on the sagetex.sage file sagetex has created for you? You need to actually run sage to do see the plot. – gjkf Jun 1 at 15:30
  • @gjkf Should I add sage into my chain (I'm using TeXstudio)? – Gregory G Jun 1 at 15:32
  • Yes, you should. Sage should be run each time you modify any of your sagetex environments, so that the output is updated. How to do that? I'm not sure since I don't use TexStudio but I'm fairly certain that on Sagetex's wiki there's a guide for that. – gjkf Jun 1 at 15:41
  • @gjkf Thank you, it worked like a charm! Here is an answer explaining how to add sagetex to the texstudio default chain tex.stackexchange.com/questions/541256/… – Gregory G Jun 1 at 16:13
  • Happy to have helped! To make everything more organized, I'll answer your question, if you want you can accept it :) – gjkf Jun 1 at 16:16
1

As said in the comments, it's necessary to actually run sage on the file generated by sagetex. To do that either run it manually or integrate with your environment. To do so with TeXStudio use this answer: sagetex in texstudio : define a new build tool

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.