I'm using LyX (at Windows) and I'm trying to get pdf file output while I have PSTricks code (I put as \ERT.
I Try to write at the preamble things like: \usepackage[off]{auto-pst-pdf} and \usepackage[pdf]{pstricks}, but it still don't compile to pdf file output. (also ps4pdf doesn't help...).

Can you tell me how can I do it?

Thank you!

Here is the code:

 % Preview source code

%% LyX created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
    \global \@firstcolumnfalse
    \global \setbox\@leftcolumn \box\@outputbox
    \global \@firstcolumntrue
    \setbox\@outputbox \vbox {%
      \hb@xt@\textwidth {%
      \kern\textwidth \kern-\columnwidth %**
      \hb@xt@\columnwidth {%
         \box\@leftcolumn \hss}%
      \kern-\textwidth %**
      {\normalcolor\vrule \@width\columnseprule}%
      \kern-\textwidth  %**
      \hb@xt@\columnwidth {%
         \box\@outputbox \hss}%
      \kern-\columnwidth \kern\textwidth %**
  \@whilesw\if@fcolmade \fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.



the problem is the missing optional argument -shell-escape for pdflatex. You can add it with Tools->Setup->File->Converter->LaTeX (pdflatex)

enter image description here

Then you need only in the preamble


and, of course, but the PSTricks stuff into the pspicture environment:


However, using xelatex instead makes it easier, no need for package auto-pst-pdf

  • It's still doesn't work.... – heblyx Jan 9 '14 at 12:00
  • 1
    maybe that it doesn't save the option. Reconfigure and restart LyX and have a look. If the option is not present, then there is a problem with LyX. Under Linux the option is saved in ~/lyx/lyxrc.default You can edit also this file. – user2478 Jan 9 '14 at 12:04
  • 1
    see also the answer to tex.stackexchange.com/questions/144427/… – user2478 Jan 9 '14 at 12:11
  • Still, id doesn't work...:-( – heblyx Jan 9 '14 at 13:28
  • 1
    ok, then try \usepackage[crop=off]{auto-pst-pdf}. Maybe you have no Perl installed. – user2478 Jan 9 '14 at 14:48

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.