I'm having some problems using the package minitoc.

Every time I try to compile my LaTeX file, I'm getting the error: minitoc.sty not found.

I did a search in my computer and I found that I have that package.

How do I tell LaTeX to use the right path to that package?

I have the MacTeX 2010 distribution and I'm running Snow Leopard.

  • When you say that you searched your computer and found the package, where did you find it? It should be /usr/local/texlive/2010/texmf-dist/tex/latex/minitoc/minitoc.sty. How are you compiling your file (e.g. are you using TeXShop?). – Alan Munn May 2 '11 at 13:40
  • Yes, I found the file in that place. I'm compiling with latexmk, but I have already tried with pdflatex. – Joaquinze May 2 '11 at 13:42
  • Do you mean compiling from the command line? Then probably your path is set incorrectly. What does echo $PATH return? – Alan Munn May 2 '11 at 13:46
  • Yes. That's what i thought. /Library/Frameworks/Python.framework/Versions/3.2/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/sicstus4.0.7/bin/:/Applications/consoleApplications/cppncss-1.0.3/bin:/Applications/consoleApplications/javancss-32.53/bin:/Applications/consoleApplications/:/usr/local/Frama-C_B/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin:/opt/local/bin – Joaquinze May 2 '11 at 13:51
  • Ok. You have macports stuff there as well which is probably the cause of the problem. Move /usr/texbin: before any of the /opt/local/ parts, and see if that works. – Alan Munn May 2 '11 at 13:55

If you have another TeX distribution installed via Fink or MacPorts, it can interfere with the operation of a MacTeX distribution when you are compiling from the command line. This is due to the fact that MacPorts and Fink ususally set the $PATH environment varible in a way so that their installation is seen first. (Such problems don't usually arise when compiling within an editing environment such as TeXShop, since the editor sets the path internally.)

Since the MacPorts/Fink TeX distributions are not as up-to-date as MacTeX, this can result in packages not being found, as in your case.

MacPorts creates a .profile file in your home directory to set the path. It may look something like:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH;

This tells the system to prepend the MacPorts path (/opt/) to the existing path. (Fink does something similar, but the relevant directory is /sw/.) Since it is prepended, anything in MacPorts/Fink will be found before anything else. For many things, this is what you want, since you may have installed MacPorts/Fink to gain access to more up-to-date versions of Unix software compared to that installed by OS X itself. However, in the case of MacTeX, you want the MacTeX distribution (/usr/texbin) to be found before anything in MacPorts.

To do this, you need to change the command above to the following:

export PATH=/usr/texbin:/opt/local/bin:/opt/local/sbin:$PATH;

This will have the desired effect. You will need to logout of your current terminal session to have the change take effect (or type source .profile).

  • I have kind of the same problem as OP. A couple of days ago I installed the latest version of MaxTex (from tug.org/mactex). I chose to move everything which comes with the pkg-file to /Applications/MacTex/ (all packages are in the same folder). When I try to compile one of my tex-files I get the message: "/usr/texbin/pdflatex not found." This is where I found pdflatex: /Applications/MacTex/texlive/2012/bin/universal-darwin/pdftex. All this is a bit odd, since this should not happen according to the Max-Tex-FAQs (see AT.01) – John Nov 26 '12 at 16:41
  • What do you mean by "I chose to move everything [...] to /Applications/MacTeX/"? It's really best to let MacTeX install everything in its default place unless you really know what you're doing (and even if you do, I can't see any compelling reason not to accept the default installation location). – Alan Munn Nov 26 '12 at 16:53
  • During installation I can change the folders where I would like to have them (e.g. /Applications/NewFolder). I thought that within TeXShop all paths/directories for packages will be set to this folder automatically. I installed everything again with default settings and now it works. – John Nov 26 '12 at 17:33
  • 1
    @John I'm glad you got it working. I suppose in principle what you did before should have worked, but it's probably not worth the trouble to find out why it didn't. – Alan Munn Nov 26 '12 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.