Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using LyX 1.6.9 with MikTex on Windows XP.

I want to use the "minted" package (for colored listings). This package uses Pygmentize to color the output. However, to do so, it uses \immediate\write18, which basically runs a command.

By default, Latex is not allowed to execute commands and throws instead the following error:

runsystem(echo testing)...disabled (restricted).

Turns out with Miktex on Windows XP, you must append a flag to the latex command which is to compile your code (cf. Using minted (source code LaTeX package) with emacs/auctex):

-shell-escape

Since I'm using LyX, how do I add a flag / switch / option (whatever you call it) to the Latex command which compiles my LyX code?

I am very reluctant to navigating through Windows' CMD for all my further Latex compiling and I'm pretty sure there is a way to add that in LyX. I haven't found anything on their website nor on Google/Duckduckgo.

Any help will be appreciated. Thanks!

share|improve this question

migrated from stackoverflow.com Apr 21 '11 at 21:07

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 5 down vote accepted

Under the Tools menu, choose Preferences. Then, in preferences dialog, under File Handling, in Converters, find the one for converting from TeX to PDF that you use (pdflatex, lualatex, xelatex, ...) and edit its command line.

share|improve this answer
    
Thanks it worked marvelously! P.S.: I'll vote this post up as soon as I get enough reputation... –  ChrisR Apr 22 '11 at 6:28

http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput#lyx

it is a german menu but easy to understand

share|improve this answer
    
Thanks for your input and the screenshot. It was helpful. P.S.: I'll vote this post up as soon as I get enough reputation... –  ChrisR Apr 22 '11 at 6:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.