2

My question is related to Where do I place my own .sty or .cls files, to make them available to all my .tex files? but the solutions don't work and the comments are very cluttered with not all comment information added to the answers (I did read the comments).

I have Ubuntu 12.04 and the most recent TeX Live. My directory is located at /usr/share/texmf/tex/latex. I added a folder called style to place Jubob's Matlab style file he created. On the linked thread, they say only older versions need to run texhash. I can tell you not running and running texhash doesn't work. When I didn't run texhash, TeX Live couldn't find the style file. When I run texhash, it says

directory not writeable skipping... done.

I ran sudo texhash as well but the output is the same.

How can we add a style file and make it available on the whole system in LaTeX with the current version of TeX Live.

From @DavidCarisle's comment, I have

dustin@dustin:~$ kpsexpand '$TEXINPUTS'.:{/home/dustin/.texlive2013/texmf-config,
/home/dustin/.texlive2013/texmf-var,
/home/dustin/texmf,
!!/usr/local/texlive/2013/texmf-config,
!!/usr/local/texlive/2013/texmf-var,
!!/usr/local/texlive/2013/../texmf-local,
!!/usr/local/texlive/2013/texmf-dist}/tex/{kpsewhich,generic,}//
  • 3
    It's generally a bad idea to use the tree rooted in /usr/share/texmf; it should rather be the one rooted in /usr/local/share/texmf (creating the necessary directories, in not existent). – egreg May 4 '14 at 15:44
  • 3
    kpsexpand '$TEXINPUTS' will show you the effective search path on your system. Directories prefixed with !! require texhash, directories followed by // subdirectories are searched recursively – David Carlisle May 4 '14 at 15:44
  • @dustin I don't have a TeX Live/Debian at the moment, but the value shown should be /home/<username>/texmf. – egreg May 4 '14 at 15:47
  • 3
    @dustin Just create the texmf directory in your home and in it tex/latex/matlab, where you'll put the .sty file. No texhash will be needed. – egreg May 4 '14 at 15:51
  • 1
    so /home/dustin/texmf/tex/latex/mypackage/mypackage.sty should work and not need texhash – David Carlisle May 4 '14 at 15:54
4

The best place for adding personal style files is in TEXMFHOME that, on GNU/Linux systems, should be found in

/home/<username>/texmf

The directory is not automatically created upon installation, because the installer never acts on users' space. So

mkdir -p ~/dustin/texmf/tex/latex/jubobsmatlab
cp jubobsmatlab.sty ~/dustin/texmf/tex/latex/jubobsmatlab

will suffice in order that the TeX system will be able to find the file. Change jubobsmatlab into the real name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.