4
% Plain LuaTeX or Plain XeTeX
\input luaotfload.sty% comment this out for XeTeX
\input pst-circ

\pspicture(-1, 0)(3.5, 4.5)
\circledipole[labeloffset = 0](0, 3)(3, 3){V}
\coil[dipolestyle=curved](0, 1)(3, 1){}
\wire(0, 1)(0, 3)
\wire(3, 1)(3, 3)
\endpspicture

This produces an error message in both (XeTeX and LuaTeX):

Undefined control sequence.
\RequirePackage

When I run this example with LuaTeX and without \input luaotfload.sty then there are even more errors and no picture is produced.

What is wrong here? According to the manual of PSTricks it should work with Plain TeX.

6
  • it is a bug. pstricks.tex tests with \ifdefined\@latexerr for the format, but as it uses \expandafter\ifx\csname @latexerr\endcsname\relax earlier, \@latexerr is defined and so the test is wrong. Report it to the maintainer. Commented Nov 27, 2022 at 12:26
  • Oh I was a bit slower (but longer:-) @UlrikeFischer Commented Nov 27, 2022 at 12:29
  • OK, I understand this bug. But why does it crash, when I use PSTricks in Plain LuaTeX without \input luaotfload.sty? Commented Nov 27, 2022 at 12:41
  • 1
    It is no problem with an up-to-date TeXLive (ctan.org/tex-archive/graphics/pstricks/base/generic)
    – user187802
    Commented Nov 29, 2022 at 8:09
  • 1
    The bug has been fixed. Commented Dec 3, 2022 at 22:44

1 Answer 1

5

This is a bug in pstricks.tex which you should report.

It tests for LaTeX

\expandafter\ifx\csname @latexerr\endcsname\relax % do we have TeX? then @latexerr isn't defined
  \input pstricks-tex.def
\fi

but \csname defines \@latexerr to be \relax so a later test in the same file

  \ifdefined\@latexerr % format is latex
    \RequirePackage{pgffor} % pgffor depends on pgfkeys

takes the wrong branch

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .