Ask Your Question
1

sagetex's .sage file gives "runfile is not defined"

asked 2014-12-29 17:07:49 +0100

jim.hefferon gravatar image

Hello,

SageTeX creates for me a .sage file. When I run Sage on that it fails, giving me an error from Python that the runfile command is not known (after apparently creating a .py file). I didn't see what I am doing wrong in the docs or by googling (sorry if I missed it). I'd be grateful for any tips about how to work around the issue. Here is the command line from a MWE.

$ sage test.sagetex.sage
Processing Sage code for test.tex...
Code block begin...
**** Error in Sage code on line 12 of test.tex! Traceback follows.
Traceback (most recent call last):
  File "test.sagetex.py", line 9, in <module>
    runfile("plot_action.sage")
NameError: name 'runfile' is not defined

**** Running Sage on test.sage failed! Fix test.tex and try again.

Here is the MWE.

\documentclass{article}
\usepackage{sagetex}

\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{sagesilent}
runfile("plot_action.sage")
p = plot_circle_action(1,0,0,1) 
p.set_axes_range(-1.5, 1.5, -0.5, 1.5) 
p.save("graphics/svd000.png",dpi=1200)
\end{sagesilent}
\lipsum[2]
\end{document}

Here is the version.

$ sage --version
Sage Version 6.1.1, Release Date: 2014-02-04

(I'm on a recent Ubuntu.)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-12-29 21:04:03 +0100

slelievre gravatar image

Try using load instead of runfile.

edit flag offensive delete link more

Comments

Thank you; out of the many things I tried, I must have missed that one. Appreciate it.

jim.hefferon gravatar imagejim.hefferon ( 2014-12-29 23:55:16 +0100 )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

1 follower

Stats

Asked: 2014-12-29 17:07:49 +0100

Seen: 453 times

Last updated: Dec 29 '14