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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there the possibility to produce PSTricks graphics in LuaLaTeX?

I tried it, but i get

    ! Undefined control sequence.
    <recently read> \c@lor@to@ps 

    l.9 \psline(

With auto-pst-pdf I get a warning to use pdflatex.

So how can i use pstricks in LuaLaTeX?

Edit:@Marco Daniel

I asked where to pack packages for specified for lualatex, "normal packages", and pstricks packages: Maybe something like this:


    Here text...


share|improve this question
Thanks! That works now. All Packages for lualatex must be put into after ifluatex right? – Niklas Feb 24 '13 at 15:19
What do you mean with "after ifluatex"? To specify your question you should provide a minimal working example (MWE). – Marco Daniel Feb 24 '13 at 15:57
Packages like pstricks or auto-pst-pdf are independent from the test ifluatex. Normally the test is used for fontspec or polyglossia. – Marco Daniel Feb 24 '13 at 17:36
Did you get it to work? If so, how? You can answer your own question, then... – nutty about natty Jul 3 '13 at 16:14

You can't use PSTricks directly with LuaTeX as even in DVI mode you can't get the 'correct' output. As detailed on the PSTricks website, the way around this is to do a conditional compilation using auto-pst-pdt to generate the required graphical elements using pdfTeX in DVI mode:


  \setmainfont{TeX Gyre Pagella}


\paragraph{Hier ein pstricks-Bild}


To see how this works, note that when auto-pst-pdf runs the auxiliary compiles, it always uses pdfTeX (in DVI mode). Thus the \ifluatex conditional will be false and any LuaTeX-specific stuff will be skipped. To get as close as possible appearance-wise, there is therefore a need to use a 'similar' font in the standard run route. Also note that anything to do with PSTricks goes in the 'else' branch: that includes additional PSTricks packages and anything else that needs DVI mode.

share|improve this answer

Your Answer


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.