3

When I compile a document from within TexStudio on my Linux Mint 17 the software reports:

Process started: pdflatex -synctex=1 -interaction=nonstopmode "community-detection".tex

and the log file starts with:

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)

But when I run exactly the same command from the Terminal I get:

This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)

When I run Help > Check LaTeX Installation I get:

which pdflatex: /usr/bin/pdflatex

but running which pdflatex from my Terminal results in:

pdflatex is /usr/local/texlive/2014/bin/x86_64-linux/pdflatex
pdflatex is /usr/bin/pdflatex
pdflatex is /usr/local/texlive/2014/bin/x86_64-linux/pdflatex
pdflatex is /usr/local/texlive/2014/bin/x86_64-linux/pdflatex

So what is the /usr/bin/pdflatex file doing there and which package should I uninstall to get rid of it?

  • Just change the path in the options. Also you can uninstall TL 2013 then, unless you like to keep it around. – henry Nov 14 '14 at 15:28
  • How exactly did you (1) Add TL2014 to the PATH, (2) Start TeXStudio? If you added PATH to .bashrc and started TeXStudio via a menu, then you are in trouble. – daleif Nov 14 '14 at 15:28
  • Use your package manager to remove the TeX Live packages you installed from your distro. (apt or whatever.) There are instructions here for how to configure things e.g. how to install a 'dummy' package to satisfy dependencies. – cfr Nov 14 '14 at 15:29
  • @daleif I think you're on the right track. My .bashrc contains the line export PATH=/usr/local/texlive/2014/bin/x86_64-linux:$PATH. But I can't see how to set the path for TexStudio. – LondonRob Nov 14 '14 at 15:35
  • 2
    You should NEVER set the PATH in .bashrc. Move it to .profile, log out, and log in again. Then it should work. Wehn TeXStudio make a call to latex it does so though a shell, but that shell may never even run .bashrc, thus we need something else. Add it to .profile and it is set as a global variable (and not just a bash variable) and TeXStudio should to good to go. The .bashrc thing is a common mistake that we are trying to correct. BTW: where from do you have that you should add the PATH variable to .bashrc? – daleif Nov 14 '14 at 16:30
11

Many places on the web linux users will find the advise: add blah blah to PATH in ~/.bashrc. In general this is not a good idea, because only when ~/.bashrc has been executed, is the PATH change visible to programmes.

If you are a command line jockey (like me) and open every program through a terminal, you will not see the difference. However, if you start, say, an editor through a menu or a keyboard short cut, then chances are that whenever that editor is going to make a system call to pdflatex, it will not do this in a manner where ~/.bashrc has been executed, thus the PATH change is not found.

In the case of LaTeX, this often shows up as the editor now using an old LaTeX installation instead of the TeX Live 2014 one had just installed manually.

For Ubuntu based systems the proper solution is

  • If this is a single user system: add the PATH change to ~/.profile instead. This is executed globally at login.

  • If you manage a multi user system, prepend the PATH variable found in /etc/environment (remember to make a backup of this file, and remember that paths are separated by :)

Afterwards log out and log in again.


Note: If you plan to login to your Linux box using SSH and then running latex, then it is a good idea to have the PATH change in .bashrc as well, as the .profile settings are not executed when you login via SSH.

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.