13

I am running latexlive, I think everything is installed. How can I check to see if the etoolbox and ifthen packages are installed? I think these packages will solve my problems.

If they are not installed, what is the best way to install them on a Debian environment?

  • We meet again :) If you use the terminal heavily, you can use kpsewhich etoolbox.sty and check the exit code. But don't use ifthen – it's exceptionally out-of-date. Depending on your needs, there are a variety of better tools out there. What exactly are you trying to do? – Sean Allred Jun 3 '15 at 2:31
  • In your shell, try tlmgr info etoolbox or tlmgr info --list etoolbox. – Arash Esbati Jun 3 '15 at 6:22
16

The quickest way to check if a package is installed is to search for it with kpsewhich {package-name}.sty. So, to check for etoolbox, use

$ kpsewhich etoolbox.sty
/usr/local/texlive/2014/texmf-dist/tex/latex/etoolbox/etoolbox.sty

If it finds the package, it will output the path (just like normal which). If it doesn't find the package, it will output nothing and have a non-zero exit code.


Perhaps the most direct way to answer the question though would be to try and use the package:

\documentclass{article}
\usepackage{etoolbox}
\begin{document}
\end{document}

The above will fail if etoolbox cannot be found.

  • Sorry you are right, texlive. Let me check for etoolbox.sty and see. – Gregory West Jun 3 '15 at 2:43
  • As you said, this question is in the wring area. Etoolbox is installed, but the .tex file crashes if I include \usepackage{etoolbox}..... where should I post this ? – Gregory West Jun 3 '15 at 2:59
  • @GregoryWest I can vouch that this answer is correct, so perhaps you should ask your actual question in a new post with a MWE. See also What is the X–Y problem?. – Sean Allred Jun 3 '15 at 3:02
2

Using the bash command locate in Unix find the texlive directory in your system:

$ locate texlive

Mine is in /usr/local/texlive. Once located you can see all the packages installed in your latex library using ls. In my case:

$ ls /usr/local/texlive/2016/texmf-dist/tex/latex/*/*.sty

Gives me the complete set of packages (sty files) available in my computer with texlive.

Edit: Another purer latex way would be to compile one tex file, call it myfile.tex (with a line \usepackage{my-package}) and open myfile.log to see where is pdflatex loading the package from. In your case finding the texlive path.

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.