Ask Your Question

sagetex on Mac OS 10.10.2

asked 2015-04-18 18:21:54 +0200

beeson gravatar image

I am encountering errors. So, I attempted to ensure that I have the right sagetex.sty file as that seems to be crucial. There was an old one somewhere in LiveTex so I updated to LiveTex 2014. Turns out that does not include any sagetex.sty. The one I have shows a creation date of March 19,2009. The error I get is "module does not have an openout method." When I look at the errors in detail it looks like a python module is automatically generated that tries to insert something into the path, and what it tries to insert is incorrect, mentioning Applications/sage instead of Applications/ (See copy of the errors at the end of this message). Now to come to the questions: (1) is this indeed fixable by getting the right version of sagetex.sty? (2) if so where do I get it?

/Applications/ in load(filename, globals, attach) 265 with open(preparse_file_named(fpath)) as f: 266 code = compile(, preparse_file_named(fpath), 'exec') --> 267 exec(code, globals) 268 else: 269 # Preparse in memory only for speed.

/Users/beeson/.sage/temp/Michaels-MacBook.local/68123/ in <module>() 7 sys.path.insert(_sage_const_0 , '/Applications/sage') 8 import sagetex ----> 9 sagetex.openout('SageTexTest')

edit retag flag offensive close merge delete


OK, now I have a sagetex.sty with copyright date 2012. (In case it helps anyone else, the Mac finder does not display this file buried in the Sage installation, even after specifying "show system files", which does cause the ones in (the old) Texlive to show up. Use the Unix command "locate sagetex.sty".) And I discovered that the new sagetex.sty does not generate Myfile.sage but rather Myfile.sagetex.sage. So you need to load or attach THAT file. But I'm still not home free. It seems the generated python code needs to prepend "./" to the filename. It does not do that so it can't run the generated Sage code:

-> 282 sagef = open(self.filename + '.sagetex.sage', 'r') 283 m = hashlib.md5() 284 for line in sagef:

IOError: No such file or directory

beeson gravatar imagebeeson ( 2015-04-19 18:41:42 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-04-19 03:16:40 +0200

kcrisman gravatar image

(2) if so where do I get it?

The key to this is that TeX needs to be able to find sagetex.sty, which can be found in SAGE_ROOT/local/share/texmf/tex/generic/sagetex/, where SAGE_ROOT is the directory where you built or installed Sage. If TeX can find sagetex.sty, then SageTeX will work. There are several ways to accomplish this.

In short, the sagetex.sty is so specifically dependent upon the version of Sage that it has been removed from TeXLive. So you have to use the one included inside your Sage installation, which luckily will definitely be there inside your bundle. Let us know if you need some more details, though it sound like this will be plenty of information for you based on your question.

edit flag offensive delete link more

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


Asked: 2015-04-18 18:21:54 +0200

Seen: 611 times

Last updated: Apr 19 '15