Impossible for me to compile a tex file because it's said ***.cls file not found even if the whole package directory is in usr/local/texlive/texmf-local on my mac

How to solve please?

Mactek installed. pdflatex not installed, ignoring how to install it.

Thanks to all.

  • 2
    Welcome to TeX.SX! Did you run sudo mktexlsr after installing the file in /usr/local/texlive/texmf-local? Also, it should be saved as /usr/local/texlive/texmf-local/tex/latex/<class>/<class>.cls (where <class> stands for the file name).
    – egreg
    Nov 4 '17 at 11:34
  • @Schweinebacke : with TeX Live installed with MacTeX the personal tree has its root at ~/Library/texmf (this is the Library folder in your HOMR folder, NOT the one in the root of you HD/SSD). Note: that folder is not created by the MacTeX installer. Note: you must create the structure yourself. Nov 4 '17 at 17:29
  • @HerbSchulz Joseph's answer or Dror's answer to the question I've linked in my comment already explicitly tells this. Nov 4 '17 at 19:20

Assuming your class is called magox.cls, you should issue, from the terminal and the work directory where you have either developed or downloaded the class, the following commands:

sudo mkdir -p /usr/local/texlive/texmf-local/tex/latex/magox
sudo cp magox.cls /usr/local/texlive/texmf-local/tex/latex/magox
sudo mktexlsr

Change magox to the actual file name, of course.

Saving the class file directly in /usr/local/texlive/texmf-local would not work, because LaTeX only looks (recursively) in /usr/local/texlive/texmf-local/tex/latex. Also mktexlsr is necessary, because otherwise the file would not be found in the cache that TeX Live maintains for reducing disk I/O.

After these operations, any document with \documentclass{magox} should work as expected.

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.