LaTeX forum ⇒ Document ClassesHow to use texhash ? Topic is solved

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

How to use texhash ?

Postby thomasb » Fri Mar 22, 2019 6:23 pm

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

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

Postby Stefan Kottwitz » Sat Mar 23, 2019 12:58 am

Hi,

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

Stefan
Site admin

User avatar
thomasb
Posts: 132
Joined: Thu Aug 03, 2017 10:54 am

Postby thomasb » Mon Mar 25, 2019 8:54 am

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: 9503
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Mar 25, 2019 9:37 am

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
Site admin

User avatar
thomasb
Posts: 132
Joined: Thu Aug 03, 2017 10:54 am

Postby thomasb » Mon Mar 25, 2019 2:22 pm

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: 9503
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Mar 25, 2019 2:24 pm

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
Site admin


Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 4 guests