## LaTeX forum ⇒ Document Classes ⇒ .cls not found on macOS Topic is solved

Information and discussion about specific document classes and how to create your own document classes.
Tobi
Posts: 2
Joined: Fri Apr 09, 2021 10:10 am

Hello,

I am using MiKteX (TeXLive-2020) on macOS and I can not show tex my custom template folder.

$echo$TEXMFHOME
/Users/<user>/texmf
$kpsewhich -var-value TEXMFHOME$ kpsewhich -expand-path "$TEXMFHOME" /Users/<user>/texmf$ env | grep TEXMF
TEXMFHOME=/Users/<user>/texmf


I tried to set the variable TEXMFHOME and I tried to add/replace the path in /usr/local/texlive/2020/texmf.cnf, but the command kpsewhich -var-value TEXMFHOME does not show anything. Does anybody have an idea what I am doing wrong? Thank you very much.

LaTeXguide.org • LaTeX-Cookbook.net

Tobi
Posts: 2
Joined: Fri Apr 09, 2021 10:10 am

Problem solved, thanks to everybody thinking about it. The issue was the order of the search PATHs.

Thus this is wrong:
$which kpsewhich /usr/local/bin/kpsewhich  Change to the correct order: $ which kpsewhich
/Library/TeX/texbin/kpsewhich


Stefan Kottwitz
Posts: 9862
Joined: Mon Mar 10, 2008 9:44 pm

Hi Tobi,

welcome to the forum!

And thank you for letting us know the solution you found yourself.

Stefan

brucehughw
Posts: 3
Joined: Wed Jun 22, 2022 4:08 pm

Hello,

I have a similar question to Tobi's. I'm also using macOS and editing using Aquamacs. I also use Aquamacs to issue the Latex compiler command. I downloaded a template, and a .cls file was included in the example. When I place the .cls file in the same directory as the template, it compiles fine. I'd like, however, to place the .cls file in a directory so that I can reference it in the future.

I'm running TeX Live 2022 and I believe i need to place the .cls file in this directory: /usr/local/texlive/2022/texmf-dist/tex/latex/base . I have two questions:

• Is this indeed the directory where I should place the .cls file?
• What is the terminal command that allows me to do that? I tried to copy the file within emacs, but got a Permission Denied error.

As I was composing this revision, i see that an answer came in earlier. I'll try that first. No need to respond to this for now. Thank you.

Thanks,

Bruce
Last edited by brucehughw on Thu Jun 23, 2022 2:20 pm, edited 2 times in total.

brucehughw
Posts: 3
Joined: Wed Jun 22, 2022 4:08 pm

Hi, again.

I'm updating my installation, so no need for anyone to reply for now. I'd delete my post, but may still need to submit it.

Thanks.

MjK
Posts: 16
Joined: Fri Jan 28, 2022 6:09 pm

brucehughw wrote:My trouble is, I don't even know which version of latex I'm running because I've installed several versions of Latex, and I'm not sure which of those Aquamacs is using. Can someone please tell me how to determine which version I'm using

Make a LaTeX run with a standard class, e.g., for
%!TeX log
\documentclass{article}
\begin{document}
Test
\end{document}


and then open the log file. Usually you will find the paths of the used class.You can test this even here to see paths from the TeX Live installation of the online compiler.

However, classes and files that are not part of the TeX distribution should not be installed in the TDS tree of the distribution, but in TEXMFHOME or TEXMFLOCAL. Usually this should be the same for every version of MacTeX/TeX Live. Try:
kpsewhich -var-value TEXMFHOME


in a terminal.

Note: You have to use a valid TDS also when using TEXMFHOME or TEXMFLOCAL. So, e.g., if the command would result in /home/USER/Library/texmf, you would have to generate a path like /home/USER/Library/texmf/tex/latex/my-prefered-template and copy the template files to this folder.

Sorry, but this is my only answer to this question, because I'm not a Mac user and questions like this one are outside my main interests.

brucehughw
Posts: 3
Joined: Wed Jun 22, 2022 4:08 pm

Hello,

Thanks, MjK, for your reply. I have placed the CS.cls file in my /Users/Bruce/Library/texmf directory. I also see this empty directory in the system path:
ls -l /usr/local/texlive/texmf-local/tex/latex/local

Can you please tell me what other directories (if any) I need to add to the
/Users/Bruce/Library/texmf
directory so that the TexLive will see and use the CS.cls file.

Thanks, Bruce