2

Following the accepted answer to this question: Can I use an image located on the web in a LaTeX document?

I am trying to insert the following code to a trivial LyX document:

\write18{wget "http://cdn.sstatic.net/tex/img/logo.png" -O "/home/erelsgl/logo.png"}

I export the document to PS, but the file is not downloaded, and I get no error message (the trivial LyX document is indeed shown in PS).

How can I make LyX run the command?

I saw that there is a "shell-escape" argument that should be passed to the tex file processor, but how do I access it from LyX?

  • 3
    Is is really worth downloading the image using LaTeX instead of just downloading it by hand? Does all operating systems even have wget? – daleif Nov 11 '13 at 15:53
6

You did add the \write18 in an ERT, or the preamble?

I think you add the --shell-escape flag in Tools --> Preferences --> File Handling --> Converters. If you use pdfLaTeX to compile your document, find the entry in the list called LaTeX (pdfLaTeX) -> PDF (pdflatex). Add --shell-escape in the Converter field, between pdflatex and $$i:

preferences window

  • Sorry for the side question, but can a new converter be created so that it could specifically use -shell-escape? With this method two LaTeX->PDF converters can be used with ease dealing with graphics or external programs such as gnuplot. – alandella Nov 11 '13 at 16:51
  • @AndreaL. Take a look at Help --> Customization, section 3.3 Converters. – Torbjørn T. Nov 11 '13 at 17:09
  • Thanks for the tip, but specifically, it says "...quindi i format devono avere nomi differenti. Date un’occhiata e poi createne dei vostri!", or "...therefore format files must have different names. Take a look and then create some of yours". The section is unexpanded, and so it gives only the fact that the button Add exists, not its action (as you can see is disabled in your picture). – alandella Nov 11 '13 at 19:00
  • 1
    @AndreaL. Why is LyX a "supposed-to-be-favourite IDE"? It's liked by some and not by others. It all comes down to preferences. If you want to constantly be writing the LaTeX code, then of course you will not like it because it tries to write the LaTeX code for you. I think there are many good reasons to use LyX. I also think there are many good reasons not to use LyX. – scottkosty Nov 12 '13 at 22:20
  • 1
    @scottkosty I guess the point (in this specific case) is to have two different versions of one converter, e.g. LaTeX -> PDF with pdflatex, where one has --shell-escape enabled, and one does not. – Torbjørn T. Nov 12 '13 at 22:51

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.