Ask Your Question
0

sagetex on Mac OS 10.10.2

asked 2015-04-18 11:21:54 -0500

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/Sage-6.5.app. (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/Sage-6.5.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/load.pyc in load(filename, globals, attach) 265 with open(preparse_file_named(fpath)) as f: 266 code = compile(f.read(), 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/SageTexTest.sageyxLpLD.py 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

Comments

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 11:41:42 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-04-18 20:16:40 -0500

kcrisman gravatar image

(2) if so where do I get it?

http://www.sagemath.org/doc/tutorial/...

http://www.sagemath.org/doc/installat...

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 Sage-6.5.app 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

Stats

Asked: 2015-04-18 11:21:54 -0500

Seen: 218 times

Last updated: Apr 18 '15