Ask Your Question

SageTeX on Linux. pdflatex isn't running Sage

asked 2012-08-16 05:41:49 -0500

Beetle B. gravatar image

I manually installed Sage into ~/sage-5.2 (i.e. not using my distro's package management tool).

I included in my LaTeX document the example of plotting a sine wave into my .tex file (from the tutorial). When I run pdflatex on it, I get:

Package sagetex Warning: Graphics file sage-plots-for-statistics.tex/plot-0.png on page 3 does not exist. Plot command is on input line 129.

Package sagetex Warning: there were undefined Sage formulas and/or plots. Run Sage on statistics.sagetex.sage, and then run LaTeX on statistics.tex again

It's clear it's not running Sage. It generates the .sage file, though.

I included ~/sage-5.2 into my path, as well as ~/sage-5.2/local/bin/ and it still doesn't pick Sage up.


edit retag flag offensive close merge delete


When it says "Run Sage on statistics.sagetex.sage, and then run LaTeX on statistics.tex again", those are directions for you to follow. pdflatex won't run Sage for you, you have to do it yourself.

John Palmieri gravatar imageJohn Palmieri ( 2012-08-16 08:52:07 -0500 )edit

That's a bit of a bummer. I'm actually writing my .tex document in Emacs (org mode, actually) and using its export capability to run pdflatex. It would be a pain to have to do it manually each time.

Beetle B. gravatar imageBeetle B. ( 2012-08-16 09:19:06 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2012-08-16 15:37:55 -0500

Beetle B. gravatar image

updated 2012-08-16 15:38:39 -0500

OK, searching around I see that John is indeed correct - one has to run Sage outside of pdflatex.

Posting this here so that someone can mark it as resolved - I don't have enough karma to do so...

edit flag offensive delete link more


See also my answer and some of the comments at In particular, you can use latexmk (which is a nice program, and which you can run from auctex mode in emacs), and if you configure it properly, it will run LaTeX as many times as required, along with running Sage (and bibtex and any other relevant programs).

John Palmieri gravatar imageJohn Palmieri ( 2012-08-16 16:48:58 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-08-16 05:41:49 -0500

Seen: 256 times

Last updated: Aug 16 '12