I'm trying to install a new style file that doesn't come by default with LaTeX. I'm on a Linux Mint computer, and installed LaTeX with a simple
sudo apt install texlive
or something like that, if I recall correctly. Now as I search for my texmf directory, I've found two (which I found by following some instructions at various pages on the internet). One is at /var/lib/texmf
and the other is at /usr/local/share/texmf/
. The former has the folders:
dvipdfmx/
dvips/
fonts/
luatex-cache/
tex/
web2c/
xdvi/
...
as well as seven files, one of them for instance is fmtutil.cnf-DEBIAN
.
With some blind exploration, I don't find any .sty
files in any of the sub-folders. In the other directory, /usr/local/share/texmf/
the directory is entirely empty.
So unless I just haven't explored the sub-folders of the first directory enough, I don't think either of these are where LaTeX is looking for its .sty
files. So how do I find the correct directory? When I type which tex
it gives me usr/bin/tex
but in that directory, I don't see any other file that seems related to LaTeX.
When I run texhash
it returns
texhash: /usr/local/share/texmf: directory not writable. Skipping...
texhash: /var/lib/texmf: directory not writable. Skipping...
texhash: /var/lib/texmf: directory not writable. Skipping...
texhash: /var/lib/texmf: directory not writable. Skipping...
texhash: Done.
Since I don't really know what I'm doing I didn't want to run texhash
as root, but this sort of makes me think that the texmf tree has to be in one of these directories ... so I'm just confused at this point.
[Edit: I've seen some people suggest that there might be a texmf tree at the home directory, but there isn't one for me. That is to say there is no texmf
directory located in my ~/
directory.]
[Further edit: Also when I type echo $TEXMFHOME
it returns a blank line.]
[Further edit: Per egreg's comment I entered kpsewhich -var-value TEXMFHOME
which returns /home/myname/texmf
but this directory doesn't exist.]
kpsewhich -var-value TEXMFHOME
is the right command line./home/myname/texmf
. However, no such directory exists.texmf/tex/latex
for latex packages and if you want documentation for a package to be found bytexdoc
it should be intexmf/doc
.~/texmf
first and find any updated files therekpsewhich
. E.g.kpsewhich article.cls
will tell you the exact path TeX uses to find thearticle.cls
that is loaded when you say\documentclass{article}
. But basically most of your stuff is in the/usr/local/share/texmf
.