Document ClassesHow to use texhash ?

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
thomasb
Posts: 134
Joined: Thu Aug 03, 2017 10:54 am

How to use texhash ?

Post by thomasb »

Hello,
The Uni's .cls and .sty are in ~/texmf/tex/latex. Now, texhash does not see the texmf in my home directory.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

How to use texhash ?

Post by Stefan Kottwitz »

Hi,

run kpsewhich -var-value=TEXMFHOME to verify if the TeX user directory is set and is that one,

Stefan
LaTeX.org admin
thomasb
Posts: 134
Joined: Thu Aug 03, 2017 10:54 am

How to use texhash ?

Post by thomasb »

Stefan Kottwitz wrote:run kpsewhich -var-value=TEXMFHOME to verify if the TeX user directory is set and is that one,
Hi,

The command answers : /home/myuser/texmf.

But texhash may need to be run as sudo, in which case, I'm not home...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

How to use texhash ?

Post by Stefan Kottwitz »

TeX automatically searches in the home directory, so the point is to have TEXMFHOME correctly set, running texhash would not be needed.

But you can run it on that tree:

texhash /home/myuser/texmf

and then there is no need for sudo.

Stefan
LaTeX.org admin
thomasb
Posts: 134
Joined: Thu Aug 03, 2017 10:54 am

How to use texhash ?

Post by thomasb »

Stefan Kottwitz wrote:But you can run it on that tree : texhash /home/myuser/texmf and then there is no need for sudo.
It worked, thanks ! So the steps are :
  1. make the tree : ~/texmf/tex/latex ;
  2. copy the .cls and .sty files in ~/texmf/tex/latex ;
  3. check if TEXMFHOME is ~/texmf by running kpsewhich -var-value=TEXMFHOME ;
  4. if not, add export TEXMFHOME=~/texmf in the .bashrc file and relog ;
  5. run texhash ~/texmf ;
  6. compile the document.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

How to use texhash ?

Post by Stefan Kottwitz »

Thanks for writing up the complete steps!

By the way, it may also be good to use subdirectories below ~/texmf/tex/latex for classes or packages. It should work the same.

Stefan
LaTeX.org admin
Post Reply