TeXShopWhere are the class files stored?

Information and discussion about TeXShop, an integrated LaTeX environment for Mac OS X
Post Reply
BraveRobot
Posts: 6
Joined: Fri Dec 30, 2011 1:46 am

Where are the class files stored?

Post by BraveRobot »

I want to create a custom class for a document I'm making. I plan to copy my current class (amsbook) and copy it to a new file with some small modifications. However, I haven't been able to find the class files. Does anyone know where they are on my computer?

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Where are the class files stored?

Post by Stefan Kottwitz »

You could use kpsewhich on the command prompt:

Code: Select all

kpsewhich amsbook.cls
On my system, this prints

Code: Select all

/usr/local/texlive/2011/texmf-dist/tex/latex/amscls/amsbook.cls
Stefan
LaTeX.org admin
BraveRobot
Posts: 6
Joined: Fri Dec 30, 2011 1:46 am

Where are the class files stored?

Post by BraveRobot »

Thanks. I never would have found that. Now where do I put my custom style so that it's picked up by texshop? I tried googling it, but because I'm new to latex, it's hard to figure out which information applies just to latex or which applies to texshop or if it will work on my system at all.

Can I just make a new folder called Example123 in

Code: Select all

    /usr/local/texlive/2011/texmf-dist/tex/latex/
and then declare Example123 as a class in my document?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Where are the class files stored?

Post by Stefan Kottwitz »

I would not put a self-made class into the TeX distribution folder. It's hard to find, and could get lost when you reinstall your system.

Have a look what's your personal TeX home directory, you could use that:

Code: Select all

kpsewhich -var-value=TEXMFHOME
Stefan
LaTeX.org admin
BraveRobot
Posts: 6
Joined: Fri Dec 30, 2011 1:46 am

Re: Where are the class files stored?

Post by BraveRobot »

Ok, I put my custom class file (Example123.cls) into my personal texhome directory but texshop can't find it when I compile. Do I need to do something else?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Where are the class files stored?

Post by Stefan Kottwitz »

Some TeX installations always look for file in the TeX home directory. Others may need to be refreshed using mktexlsr or texhash.

Try

Code: Select all

sudo mktexlsr
in the terminal.

Stefan
LaTeX.org admin
BraveRobot
Posts: 6
Joined: Fri Dec 30, 2011 1:46 am

Re: Where are the class files stored?

Post by BraveRobot »

I ran both of those and it still doesn't recognize my class. I just added it to the main distribution and it worked. Thanks for helping me with that. I never would have figured that out.
holene
Posts: 1
Joined: Wed Oct 17, 2012 7:48 pm

Where are the class files stored?

Post by holene »

Hi!

So, I have the same problem, only my TeX-distribution doesn't find my .cls-files wherever I put them. I'm writing at some standardized document and are bound to use a custom cls. My document won't compile even if I put the .cls-file in the same folder as my tex-document. I've copied a folder with the .cls-files in to

Code: Select all

/users/username/Library/texmf/

Code: Select all

/usr/local/texlive/2012/texmf-dist/tex/latex/
and update both

Code: Select all

sudo -s texhash

Code: Select all

sudo -s mktexlsr
The

Code: Select all

kpsewhich -var-value=TEXMFHOME
command returned

Code: Select all

/Users/username/Library/texmf/
So now I'm about to turn completely mad here... Any help out there? =)
Post Reply