I'm strying to install the mhchem
package on my linux machine and it's not working. So far I've tried putting it in /usr/share/texlive/texmf-dist/tex/latex/mhchem
and then running texhash
on that directory, texhash
fails on that folder. I also tried it in /home/<user>/texmf
which is the directory I get when I run kpsewhich -var-value=TEXMFHOME
. The directory did not exist so I had to create it. Running texhash
on that directory succeeds and I get an ls-R
file in the directory. However, when I try to run latex on a file that has \usepackage{mhchem}
, it fails and says that the package does not exist.
Am I putting the .sty
file in the right place?
1 Answer
You can always place your custom packages in /home/<username>/texmf/tex/latex
.
For packages coming with TeX Live, tlmgr
(TeX Live manager) takes care of downloading and making the package available. If sudo
was needed to install TeX Live, i.e. in a directory where a normal user has no writing rights, sudo
will also be needed to run tlmgr
.
If TeX Live was installed as part of the Linux-distribution, chances are that you are havin a quite old version and not all solutions on site work. Nevertheless, distros often bundle up TeX Live packages in distro-meta-packages.
For example, mhchem
can be found in texlive-science
according to the Linux Mint community. The meta package will install other chemistry related packages like chemstyle and chemmacros as well.
/home/<username>/texmf/tex/latex
, there should be no need to runtexhash
. Can't you installmhchem
and related packages using the package manager of your distro?apt-get
andaptitude
, there some similar for Mint, i bet.texlive-science
, sosudo apt-get install texlive-science
seems to be a good start.