I installed texlive following the instructions given in the official quick install.

I added the path and run latex small2e and everything works fine.

Then I installed texstudio via the aptitude.

When I opened my moderncv.tex file in texstudio and tried to compile it, I received the following error:

Error: Could not start the command: pdflatex -synctex=1 -interaction=nonstopmode

How can I solve this issue?

EDIT 1: just in case you require information about my OS

DISTRIB_DESCRIPTION="Linux Mint 17.3 Rosa"
VERSION="14.04.3 LTS, Trusty Tahr"

EDIT 2: Answering the questions from the comment below

Are you sure texmaker can find texlive?

No. How can I make sure this? Plus, I don't use texmaker, I use texstudio.

How was tex live installed?

The internet method: donwloaded the tarball and ran ./install-tl

Did you add tex live to the path via .bashrc?

I added it to .bash_profile, but not .bashrc. Why should I add it to .bashrc

  • Are you sure texmaker can find texlive? How was tex live installed? Did you add tex live to the path via .bashrc? Because that will not work if you then start texmaker from a menu, it should be added to .profile – daleif Feb 24 '16 at 18:40
  • i added answers for your questions – Kristof Tak Feb 24 '16 at 20:08
  • Sorry, misread, doesn't matter though. .bash_profile is still wrong. The addition to path will never get picked up by texstudio, unless perhaps if it was started from the command line. Add the path addition to ~/.profile, log out and in again and see if that doesn't work. The shell used by programmes like texmaker or texstudio is not bash so bashrc or bash_profile is never executed and thus the path addition is ignored. Thus is a very common mistake on Linux – daleif Feb 24 '16 at 20:23
  • @daleif it worked! Please submit your suggestion as a question so I can accept it :) – Kristof Tak Feb 24 '16 at 20:48
  • Added my answer – daleif Feb 24 '16 at 20:56

This a common error on Linux systems. Various places on the Internet lists that one should add to the path in ~/.bashrc or ~/.bash_profile. That is not true, add it into ~/.profile log out and in again. (Note, there are also system equivalents of these if you have a multi user system.)

Then reasoning is the following: when you start your editor from say a menu or by double clicking a file, the editor runs with whatever path settings was available at login. If you add the path change through bash, that addition is only available within bash contexts.

Whenever the editor calls latex as a system call it is very unlikely that it is using a bash shell, or even a call to a shell. Thus the editor is never affected by the path addition setup through bash.

By adding it to ~/.profile we make sure that the path addition is added to the global stuff executed at login, and this the addition is available for the editor.

|improve this answer|||||

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.