0

I recently updated my tex distribution on mac to try and get use of a font in texlive-extra (I used macports). However, this didn't work and led to errors. As a result I decided to do a clean install following the instructions here: http://www.tug.org/mactex/uninstalling.html moving usr/local/texlive and usr/local/texmf to trash, along with the GUI applications.

When I did a clean install from mactex here: http://www.tug.org/mactex/index.html all seemed to go fine, but when I try and compile using a makefile that was fine before I get the result:

LaTeX Error: File `book.cls' not found.

(same for articles, reports, etc.)

If I run macports with

sudo port install texlive texlive-latex-extra

I get the result:

--->  Computing dependencies for texlive
--->  Cleaning texlive
--->  Computing dependencies for texlive-latex-extra
--->  Cleaning texlive-latex-extra
--->  Scanning binaries for linking errors
--->  No broken files found.

And nothing happens.

If someone could help me out with fixing this, or the correct way to do a clean install I would be grateful.

I came across a similar issue here: article.cls not found after last update but it was closed without a clear answer.

Thanks

  • 1
    Mactex and the stuff from macports are not the same and probably should not be used together. My guess is that you have two latex installations and your Mac gets confused – daleif Sep 13 '17 at 08:14
  • Thanks, I didn't realise that. I've run 'sudo port uninstall texlive texlive-latex-extra' but the problem is still persisting. – FluidFox Sep 13 '17 at 08:25
  • Uninstailling is probably not enough, and LaTeX on the mac is a heap of shortcuts that also needs cleaning. In a terminal what does which pdflatex return? What does kpsewhich article.cls say? – daleif Sep 13 '17 at 08:35
  • which pdflatex returns /opt/local/bin/pdflatex kpsewhich article.cls returns nothing – FluidFox Sep 13 '17 at 08:39
  • Have you tried sudo texhash? To rebuild the filename database – daleif Sep 13 '17 at 08:45
  • Yes, the result I got was as follows:
    `texhash: Updating /opt/local/etc/texmf/ls-R...`  
    `texhash: Updating /opt/local/var/db/texmf/ls-R...`  
    `texhash: Done.`
    
    

    But when I try to compile as I normally would I still get File `article.cls' not found.

    – FluidFox Sep 13 '17 at 08:49
  • Then I don't know what is wrong with your installation. I'd probably try to uninstall all LaTeX related and then install MacTeX again. Just reinstalling MacTeX "could" work, but I'm not sure. Things can get really messed up when you mix installations. – daleif Sep 13 '17 at 08:52
  • OK, thanks for trying to help. When you say uninstall all LaTeX related, what is the best way to do that? Should I just look around for anything with TeX in the filename and move to trash? – FluidFox Sep 13 '17 at 08:57
  • I do not use Mac, so I cannot help you there. – daleif Sep 13 '17 at 09:09
  • I tried the above and a new install of MacTeX, and I now have the error warning: kpathsea: configuration file texmf.cnf not found in these directories: /opt/local/etc/texmf. If that indicates anything further. Compilation now works and generates a pdf file, but all of my citations (using natbib) throw errors and appear as ? in the pdf so its still not fixed yet. – FluidFox Sep 13 '17 at 10:04
  • Update: I have taken the texmf.cnf file located at usr/local/texlive/2017/ and copied it to opt/local/etc/texmf/ and no longer get the kpathsea error. The error with natbib is still there however. – FluidFox Sep 13 '17 at 10:15
  • Ohh, then I probably know what is going on, your PATH settings are wrong. All MacTeX lives in /usr/local/texlive/2017/, so things refering to /opt/local/etc/texmf/might be completely wrong. What does echo $PATH say in a terminal – daleif Sep 13 '17 at 10:18
  • /opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin – FluidFox Sep 13 '17 at 10:18
  • and which pdflatex? – daleif Sep 13 '17 at 10:19
  • /Library/TeX/texbin/pdflatex – FluidFox Sep 13 '17 at 10:19
  • which kpsewhich? – daleif Sep 13 '17 at 10:20
  • /opt/local/bin/kpsewhich – FluidFox Sep 13 '17 at 10:20
  • ls -l /Library/Te‌​X/texbin – daleif Sep 13 '17 at 10:20
  • ls: /Library/Te‌​X/texbin: No such file or directory – FluidFox Sep 13 '17 at 10:21
  • kpsewhich should have been from texlive/2017/... – daleif Sep 13 '17 at 10:21
  • 1
    @FluidFox Don't install the MacPorts version of TeX Live under any circumstance. Uninstall it to begin with, then install MacTeX. – egreg Sep 13 '17 at 10:21
  • OK, how do I get it to look there instead? – FluidFox Sep 13 '17 at 10:22
  • So you still have stuff around from the old installations. I do not remember how MacTeX sets things up (it is done via short cuts) – daleif Sep 13 '17 at 10:22
  • @egreg I ran sudo port uninstall texlive texlive-latex-extra before reinstalling MacTeX – FluidFox Sep 13 '17 at 10:23
  • You probably have a lot more texlive stuff, can port list what it has installed? – daleif Sep 13 '17 at 10:25
  • @FluidFox If which kpsewhich still returns /opt/local/bin/kpsewhich then you're in trouble. What's the output of ls -l /opt/local/bin/kpsewhich? – egreg Sep 13 '17 at 10:25
  • yes, I get this for port installed: – FluidFox Sep 13 '17 at 10:25
  • texlive-basic @44435_0+doc (active) texlive-bin @2017_1+x11 (active) texlive-bin-extra @44432_0+doc (active) texlive-common @2017.1_0 (active) texlive-context @44436_0+doc (active) texlive-fonts-extra @44409_0+doc (active) texlive-fonts-recommended @42428_0+doc (active) texlive-fontutils @44166_0+doc (active) texlive-lang-czechslovak @44347_0+doc (active)

    Plus more

    – FluidFox Sep 13 '17 at 10:26
  • for ls -l /Library/Te‌​X/texbin I now get lrwxr-xr-x 1 root wheel 29 13 Sep 11:02 /Library/TeX/texbin -> Distributions/Programs/texbin – FluidFox Sep 13 '17 at 10:27
  • @egreg I get lrwxr-xr-x 1 root admin 45 20 Jun 08:46 /opt/local/bin/kpsewhich -> /opt/local/libexec/texlive/binaries/kpsewhich for ls -l /opt/local/bin/kpsewhich – FluidFox Sep 13 '17 at 10:28
  • You'll probably need to uninstall all that mac posts know about TeXLive. Then hopefully it should clean up after it self and you can work with MacTeX. – daleif Sep 13 '17 at 10:38
  • I think that sudo port uninstall 'texlive*' is called for here. Also, remove anything tex-related that you installed under /opt/local by hand. – Harald Hanche-Olsen Sep 13 '17 at 10:41
  • For sudo port uninstall 'texlive*' I get the following warning: The following ports will break: pdfjam @2.08_0 – FluidFox Sep 13 '17 at 10:43
  • is pdfjam, something you use? – daleif Sep 13 '17 at 10:47
  • It probably won't actually break. Try sudo port uninstall --force 'texlive*'. As soon as you have a working MacTeX installed, pdfjam will likely work again. – Harald Hanche-Olsen Sep 13 '17 at 10:48
  • Not that I'm aware of. I also have latexmk, latexdiff, detex, and ghostscript listed under macports installed. Should these go too? Having proceeded with removing all the texlive items in macports and anything I placed manually in /opt/local/etc/ I can compile and produce pdfs, but still have issues with natbib. Should I try reinstalling MacTeX at this point? – FluidFox Sep 13 '17 at 10:49
  • Could be that some other port needs pdfjam. You can ask nicely, using port dependents pdfjam. – Harald Hanche-Olsen Sep 13 '17 at 10:52
  • no other dependants so I proceeded. Should I also get rid of latexmk, latexdiff, detex, and ghostscript? and try to install MacTeX again? – FluidFox Sep 13 '17 at 10:53
  • pdfjam is just a frontend to the pdfpages package, so it only needs latex to be installed – daleif Sep 13 '17 at 10:55
  • We have a similar issue on Linux (for example Ubuntu). When we install TUG TeXLive (instead of the Ubuntu equivalent of mac ports), we'll need to tell the package manager that we have installed something similar to some of its own packages. Perhaps there exists something similar for mac ports. But again if pdfjam is not something you use, then uninstall that as well – daleif Sep 13 '17 at 10:57
  • OK, I proceeded and removed it. Should I also remove latexmk, latexdiff, detex, and ghostscript? I will then run the install package from MacTeX again and see what happens. – FluidFox Sep 13 '17 at 10:59
  • Not sure if ghostscript is a part of mactex, but the others are (as you can see splitting up into these smaller pieces makes everything a lot more confusing). Ghostscript should not depend on texlive. – daleif Sep 13 '17 at 11:02
  • OK, I haven't removed those packages listed above yet, but re-ran the MacTeX install package, and now compilation seems to run fine and natbib no longer throws problems. Is there a check I can run to see if things seem back in the correct places (e.g. which pdflatex or ls -l /Library/Te‌​X/texbin)? – FluidFox Sep 13 '17 at 11:05
  • Comments are not for extended discussion; this conversation has been moved to chat. – Stefan Kottwitz Sep 17 '17 at 04:07

0 Answers0