# Problems with Sagetex under Texshop

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi,

I am new to MAC and all the related stuff. Changed from MS Winxxx to Mac because they said it would be much user friendly. But now I have some problems. I am using Texshop. I tried to run Sagetex, but it does not work. I get the message "Latex error! File sagetex.sty not found". I copied the folder sagetex everywhere in my system. I cannot definitely say, where the latex installation folder is. Or how to get to the installation folder. I spent hours and hours following the advices I found on the web. Without success. I am using Lion with its latest update. Texshop has also its latest update. Same to Sage. When I run the example.tex from Sagetex folder, everything is fine. But when I run Example.tex from a folder located e.g. on my desktop then the error message appears. I know that the system cannot find the sagetex.sty. But why? I followed the instructions given under: http://www.sagemath.org/doc/installat...

Any hint appreciated.

Keep on rocking'

Rick

edit retag close merge delete

Sort by » oldest newest most voted

First, the instructions seem to indicate that if you copy the file sagetex.sty into a directory with your latex file, then the system will be able to find it. Can you first verify that this is the case?

After that, can you try putting sagetex.sty in the default search location? On the mac, that's ~/Library/texmf, so I guess you should put sagetex.sty in ~/Library/texmf/tex/generic/sagetex/. Note that a new "feature" in Mac 10.6 makes the Library directory hidden. You can navigate to in with the Terminal, or select it from the Go menu (you have to hold down the Option key to see it).

Edit by kcrisman: with the upgrade to SageTeX 3.0, the default location in Sage will in fact be $SAGE_ROOT/local/share/texmf/tex/latex/sagetex/ which should be placed in ~/Library/texmf/tex/latex/sagetex/, I believe. more ## Comments Don't forget run 'sudo texhash' in terminal. ( 2014-09-22 09:00:50 -0500 )edit There are a lot of interesting issues with the ~/Librarydirectory; see http://www.macworld.com/article/11611... and http://www.macworld.com/article/20572... ( 2015-07-25 09:26:31 -0500 )edit Thanks hsigrist! ( 2017-07-11 10:32:28 -0500 )edit Open this folder ~/Library/TeXShop/Engines/Inactive/Sage/ and follow the instructions in About Sage.pdf and all should work fine. Make sure you have the Sage.app version installed. For$TeX\$Shop users needing more assistance, I have written a ~50 page guide that should help.

more

We should probably have a link to this guide, which is a nice compilation of material that fits well together but is not usually found together, as well as an example in itself, somewhere on a subpage of http://sagemath.org/library.html - but I'm not sure exactly where...

( 2014-08-08 03:19:54 -0500 )edit

This post is a wiki. Anyone with karma >750 is welcome to improve it.

The instructions are written with Linux in mind, which would normally run a de facto standard TeX implementation called TeXLive (or an older one, albeit quite similar, called teTeX). I didn't use TeXshop (which is IDE to run LaTeX) for many years; google tells me that actually it uses TeXLive, so you are all set in this sense.

Sagetex is meant to be run at the shell prompt. If you do it at the shell prompt, then put sagetex.sty in your working directory (there are better ways, but this one should typically work, too), open the Terminal, and run latex yourfile. Then run Sage, as described here.

(needless to say, sagetex.sty is pretty much useless without Sage installed).

more

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Found that sage.engine was looking for the "app" version of Sage. Changed the path from "/Applications/SageMath-7.6.app/Contents/Resources/sage/sage" to match the actual location of Sage. Now TexShop works with SageMath.

more

Good! (Which version of this are you answering?)

( 2017-11-09 14:14:01 -0500 )edit