I use Lyx everyday. Yesterday I decided to format my computer and install Xubuntu 18.04 (I had Xubuntu 16.04). After installing Lyx I am getting this errors:

enter image description here

Although the errors, the PDF is properly created so it works. Anyway I would like to get rid of this errors. I have searched in Google with no much luck.


Your problem is that you just have to re-set your preferences in lyx to let it know that you want to run pdflatex with --shell-escape flag.

This flag can not be a default feature in open source systems (and general but once more in open source) because a hacker can harm your system. See here.

So, your upgraded version came without that feature enabled and this is why you get the error.

The best practice is to run such codes (with minted package or similar that requires this flag) only if the code is yours (or trusted) from command line (adding manually this flag) or using a similar way to enable it (not by default but only when you need it).

For example, to compile a file main.tex in your home folder, you have just to open a terminal and write the command:

pdflatex --shell-escape main

To see how you can get rid the error (and in the same time let your system be vulnerable when running untrusted LaTeX code) see here.

  • Thanks for your answer. After adding that option when I hit to export PDF I get a warning advertising that it is dangerous and then I get this errors. Why do I have to add that flag (which is insecure) to compile the exact same documents I always compiled without that flag before upgrading? – user171780 Sep 20 '18 at 11:17
  • You can't compile some latex code which containing minted package without that flag. Somehow, the warnings was not there in the previous edition (or was disabled) and the flag was running (but you just didn't knew). I don't know if these errors comes from minted (ooor other part of the code). – koleygr Sep 20 '18 at 11:24
  • It seems that the problem has to do with the parameters I have defined for the code listings. I have this under "Tools --> Preferences --> Code listings". If I do not introduce any code listing in my document I get those errors. If I introduce any code listing in my document, the errors go away and everything works ok. As you can see in the attached image (in the link) the "Syntax Highlighting Package" is selected to be "Listings" and not "Minted". – user171780 Sep 20 '18 at 11:40
  • 1
    Ok... Then the problem is something new and extra... Please ask a new question with that will contain a MWE we can use and answer. – koleygr Sep 20 '18 at 11:45

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.