30

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?

Sean Allred
  • 27,421
  • 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 03 '15 at 02:31
  • In your shell, try tlmgr info etoolbox or tlmgr info --list etoolbox. – Arash Esbati Jun 03 '15 at 06:22
  • @SeanAllred: In what way is ifthen "exceptionally out-of-date"? – murray Feb 22 '22 at 18:12
  • There are much more modern/robust alternatives if you're doing programming in TeX -- expl3 is the one that comes to my mind. LuaTeX is also an option. ifthen was out-of-date 7(!) years ago -- it's very out-of-date now. That doesn't mean it won't work -- it just means it's probably not actively maintained/improved (unless something's changed in the years since I wrote that comment). – Sean Allred Feb 23 '22 at 16:10

3 Answers3

40

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.

Sean Allred
  • 27,421
3

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.

rodgdor
  • 163
2

Even though, a good answer has been given to the first question here for example, it seems nobody actually dealt with the second one for Debian installation of the LaTeX packages.

A quite easy way is to use apt-file to search in which Debian package the LaTeX package is included :

apt-file search yourPackage.sty

This will display at the beginning of line the Debian package to install then, with classic sudo apt install ... command.

Olivier
  • 208