Document Classes.cls not found on macOS

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

.cls not found on macOS

Post by Tobi »

Hello,

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

Code: Select all

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Tobi
Posts: 2
Joined: Fri Apr 09, 2021 10:10 am

.cls not found on macOS

Post by Tobi »

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

Thus this is wrong:

Code: Select all

$ which kpsewhich
/usr/local/bin/kpsewhich
Change to the correct order:

Code: Select all

$ which kpsewhich
/Library/TeX/texbin/kpsewhich
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

.cls not found on macOS

Post by Stefan Kottwitz »

Hi Tobi,

welcome to the forum!

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

Stefan
LaTeX.org admin
brucehughw
Posts: 3
Joined: Wed Jun 22, 2022 4:08 pm

.cls not found on macOS

Post by brucehughw »

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

.cls not found on macOS

Post by brucehughw »

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.
User avatar
MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

.cls not found on macOS

Post by MjK »

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

Code: Select all

%!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:

Code: Select all

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.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
brucehughw
Posts: 3
Joined: Wed Jun 22, 2022 4:08 pm

.cls not found on macOS

Post by brucehughw »

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:

Code: Select all

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

Code: Select all

/Users/Bruce/Library/texmf
directory so that the TexLive will see and use the CS.cls file.

Thanks, Bruce
Post Reply