Ask Your Question

Problems with Sagetex under Texshop

asked 2011-11-14 17:12:22 +0200

this post is marked as community wiki

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


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:

Any hint appreciated.

Keep on rocking'


edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted

answered 2014-07-23 15:48:18 +0200

updated 2014-08-07 16:27:33 +0200

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 version installed.

For $TeX$Shop users needing more assistance, I have written a ~50 page guide that should help.

edit flag offensive delete link 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 - but I'm not sure exactly where...

kcrisman gravatar imagekcrisman ( 2014-08-08 10:19:54 +0200 )edit

My guide has recently been updated with embedded videos. You may download a copy at: gravatar ( 2021-12-27 14:06:36 +0200 )edit

answered 2011-11-14 21:28:50 +0200

niles gravatar image

updated 2016-04-26 14:53:26 +0200

kcrisman gravatar image

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.

edit flag offensive delete link more


Don't forget run 'sudo texhash' in terminal.

hsigrist gravatar imagehsigrist ( 2014-09-22 16:00:50 +0200 )edit

There are a lot of interesting issues with the ~/Librarydirectory; see and

kcrisman gravatar imagekcrisman ( 2015-07-25 16:26:31 +0200 )edit

Thanks hsigrist!

qgfreire gravatar imageqgfreire ( 2017-07-11 17:32:28 +0200 )edit

answered 2017-11-03 11:48:36 +0200

this post is marked as community wiki

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/" to match the actual location of Sage. Now TexShop works with SageMath.

edit flag offensive delete link more


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

kcrisman gravatar imagekcrisman ( 2017-11-09 21:14:01 +0200 )edit

answered 2011-11-15 11:29:12 +0200

this post is marked as community wiki

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).

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: 2011-11-14 17:12:22 +0200

Seen: 2,042 times

Last updated: Nov 03 '17