0

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
    Hi and welcome, does it say the file does not exist, or does it say it is not found? Put the file in /home/<username>/texmf/tex/latex, there should be no need to run texhash. Can't you install mhchem and related packages using the package manager of your distro? – Johannes_B Feb 17 '15 at 21:58
  • That worked, thanks! I don't have any experience with package manager, I do almost everything through terminal, just my engineering way of making everything more difficult. – Brydon Gibson Feb 17 '15 at 22:25
  • I bet there are good terminal package managers, you cannot do all of this including dependencies by hand. On Ubuntu, i have apt-get and aptitude, there some similar for Mint, i bet. – Johannes_B Feb 17 '15 at 22:29
  • I use apt-get for most of what I do, I will certainly use a gui package manager if I need to, but as of yet I haven't needed to. – Brydon Gibson Feb 18 '15 at 17:30
  • 1
    community.linuxmint.com/software/view/texlive-science Seems to be in the package texlive-science, so sudo apt-get install texlive-science seems to be a good start. – Johannes_B Feb 18 '15 at 17:34
3

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.

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.