![pstricks 和 pdf 选项](https://linux22.com/image/314694/pstricks%20%E5%92%8C%20pdf%20%E9%80%89%E9%A1%B9.png)
我注意到 的最新版本存在一个问题pstricks
:我以前使用 编译包含 pstricks 代码的文件pdflatex
,使用pdf
文档类的选项。现在它不起作用,并产生错误:
%
! Undefined control sequence.
\XC@usec@lor ...\expandafter \c@lor@to@ps #1#2\@@
\else \expandafter \expand...
l.15 ...lor =IndianRed ]{0}{TwoPi}{0.5 + 2*cos(x)}
%
[1 Non-PDF special ignored! Non-PDF special ignored! Non-PDF special
ignored! Non-PDF special ignored! Non-PDF special ignored! Non-PDF
special ignored! Non-PDF special ignored! Non-PDF special ignored!
就像auto-pst-pdf
没有加载一样。在序言中的正确位置明确加载 auto-pst-pdf 解决了这个问题,但这意味着必须修改所有带有 pstricks 代码的文件。
有人知道这个问题出在哪里,以及有解决方案吗?
最小工作示例:
\documentclass[11pt, a4paper, pdf, svgnames]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{ pst-plot}
% \usepackage{auto-pst-pdf}
\begin{document}
\psset{unit=2.5cm, arrowinset=0.15, ticksize=2.5pt -2.5pt, labelFontSize=\footnotesize, tickwidth =0.6pt}
\begin{pspicture}(-1.5,-1.9)(3.9,1.9)
\psaxes[arrows=->, linecolor=LightSteelBlue, tickcolor=LightSteelBlue] (0,0)(-1.6,-1.9)(3.6,1.9)[$x$,-110][$y$,-140]
\psset{linewidth=1.2pt, plotpoints=200, plotstyle=curve, polarplot, algebraic, labelsep=0.5em}
\psplot[linecolor =IndianRed ]{0}{TwoPi}{0.5 + 2*cos(x)}%
\end{pspicture}
\end{document}
答案1
和pstricks.sty和pstricks.tex这将适用于
pdflatex --shell-escape exa.tex
编辑:它将在接下来的几天内发生变化:pdf
您不应使用选项,而应加载包pstricks-pdf
。我会在周末之前上传它。
示例代码:
\documentclass[11pt, a4paper, pdf, svgnames]{article}
\usepackage{fourier}
\usepackage{pst-plot}
\begin{document}
\psset{unit=2.5cm}
\begin{pspicture}[showgrid](-1,-2)(3,2)
\psset{linewidth=2pt, plotpoints=200, plotstyle=curve, polarplot, algebraic, labelsep=0.5em}
\psaxes[arrows=->,linewidth=0.5pt,labels=none,gridstyle=](0,0)(-1,-2)(3,2)[$x$,-110][$y$,-140]
\psplot[linecolor=blue]{0}{TwoPi}{0.5 + 2*cos(x)}%
\end{pspicture}
\end{document}