First, troubleshoot:
latex
in the terminal should give you something like:
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=latex)
restricted \write18 enabled.
which latex
should tell you where the binary is loaded from, here this is
/usr/local/texlive/2021/bin/x86_64-linux/latex
If this works, try launching TeXstudio from the terminal (by entering texstudio
) and see if it finds the latex binaries then.
If any of the above does not work, you need to revisit the LaTeX installation and make sure to add the installation path to the $PATH
variable.
If TeXstudio can find the binaries when launched from the terminal, but not through the desktop environment, you must add the path to TeXstudio with Menu Bar → Options → Configure TeXstudio. Here check the 'Show advanced Options' in the left bottom corner, select "build" and look at the very bottom for "Additional Search Paths" → "Commands ($PATH)". Add the path for your TeX installation, in my case /usr/local/texlive/2021/bin/x86_64-linux/
Do not prefix the path to all the individual commands in the "Commands" section of the preferences (as seen in some of the screenshots from the other answers). There are 467 files/tools in this directory. You will later get errors when you need to call one of the other tools, which not included in the dozen found in the "Commands" preferences. Example: the tufte class is calling kpsewhich
and if you set up TeXstudio by prefixing the path to the standard commands instead of adding the path to the "Additional Search Paths" you will get latex sh: 1: kpsewhich: not found
.
bin
files. You can do this: go to Options>Configure and insert the whole path for thepdflatex
. If you use windows, look forC:\PROGRA~2\MIKTEX~2.9\miktex\bin\pdflatex.exe
or something similar."C:\....exe" %.tex