I am using sphinx to build documentation for a python project; and the documentation includes mathematical notation to be executed by Latex. I know that I need to specify the location of Latex on my (linux system) computer when I build the docs from the command line, something along the lines of the following example given by the sphinx documentation:

sphinx-build -b html -D imgmath_latex=C:\tex\latex.exe . _build/html

I have just installed latex using the command sudo apt-get install texlive

How do I find out where Latex was installed and how do I use that in my build command?

When I try the command dpkg -l texlive the output is

| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                            Version                      Architecture                 Description
ii  texlive                                         2016.20160819-2                 all                          TeX Live: A decent selection of the TeX Live packages
  • 1
    Have you tried not setting it at all? I suspect it's only necessary to set it explicitly if latex is not in the current executable search path - *nix systems are usually quite smart about things like this – steeldriver Feb 11 '17 at 1:08
  • Okay yeah thanks it works fine without setting it. – zarmin Feb 14 '17 at 22:42

One way to find out where the latex executable is installed is

which latex
| improve this answer | |
  • For example results of which latex in 18.04 are /usr/bin/latex – karel Nov 24 '18 at 5:59

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.