PSTricks 在 Plain TeX 中失效了吗?

PSTricks 在 Plain TeX 中失效了吗?
% 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

这会在 XeTeX 和 LuaTeX 中产生错误消息:

Undefined control sequence.
\RequirePackage

当我使用 LuaTeX 运行此示例时,如果没有\input luaotfload.sty,则会出现更多错误,并且没有生成图片。

这里出了什么问题?根据 PSTricks 手册,它应该可以与 Plain TeX 一起使用。

答案1

这是一个pstricks.tex您应该报告的错误。

它测试 LaTeX

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

\csname定义 \@latexerr\relax同一文件中的后续测试

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

走错分支

相关内容