代码在 latex 中有效,但在 miktex-xetex 中无效

代码在 latex 中有效,但在 miktex-xetex 中无效

我正在尝试渲染 tex 图表。它在一个程序中有效,但在另一个程序中无效。以下是代码:

\documentclass[pstricks,preview,margin=0pt]{standalone}
\usepackage{pst-plot,graphicx}
\usepackage{tgheros}
\renewcommand*\familydefault{\sfdefault}
\usepackage[T1]{fontenc}
\begin{document}
  \psset{linecolor=gray,unit=0.75bp}
    \begin{pspicture}(-352,-352)(352,352)
    \psrotate(0,0){345}{\rput[B]{0}(0,-280){\color{gray}{\large\itshape{H}}}}
    \psset{linewidth=2pt}
    \psarc[]{-}(0,0){256}{0}{360}
    \psset{linewidth=0.5pt}
%    \psrotate(0,0){  0}{\rput[B]{0}(0,-276){{\color{gray}{0}}}}
    \psrotate(0,0){ 30}{\rput[B]{0}(0,-276){{\color{gray}{30}}}}
    \psrotate(0,0){ 60}{\rput[B]{0}(0,-276){{\color{gray}{60}}}}
    \psrotate(0,0){ 90}{\rput[B]{0}(0,-276){{\color{gray}{90}}}}
    \psrotate(0,0){120}{\rput[B]{0}(0,-276){{\color{gray}{120}}}}
    \psrotate(0,0){150}{\rput[B]{0}(0,-276){{\color{gray}{150}}}}
    \psrotate(0,0){180}{\rput[B]{0}(0,-276){{\color{gray}{180}}}}
    \psrotate(0,0){210}{\rput[B]{0}(0,-276){{\color{gray}{210}}}}
    \psrotate(0,0){240}{\rput[B]{0}(0,-276){{\color{gray}{240}}}}
    \psrotate(0,0){270}{\rput[B]{0}(0,-276){{\color{gray}{270}}}}
    \psrotate(0,0){300}{\rput[B]{0}(0,-276){{\color{gray}{300}}}}
    \psrotate(0,0){330}{\rput[B]{0}(0,-276){{\color{gray}{330}}}}
    \psrotate(0,0){  0}{\psline(0,252)(0,260)}
    \psrotate(0,0){ 30}{\psline(0,252)(0,260)}
    \psrotate(0,0){ 60}{\psline(0,252)(0,260)}
    \psrotate(0,0){ 90}{\psline(0,252)(0,260)}
    \psrotate(0,0){120}{\psline(0,252)(0,260)}
    \psrotate(0,0){150}{\psline(0,252)(0,260)}
    \psrotate(0,0){180}{\psline(0,252)(0,260)}
    \psrotate(0,0){210}{\psline(0,252)(0,260)}
    \psrotate(0,0){240}{\psline(0,252)(0,260)}
    \psrotate(0,0){270}{\psline(0,252)(0,260)}
    \psrotate(0,0){300}{\psline(0,252)(0,260)}
    \psrotate(0,0){330}{\psline(0,252)(0,260)}
  \end{pspicture}
\end{document}

以下是可以运行的 Windows 批处理文件:

latex %1.tex
dvips -E %1.dvi
ps2pdf -dAutoRotatePages#/None %1.ps
convert -density 600 %1.pdf -quality 90 %1.png
%1.png

以下是无法正确输出图表的 Windows 批处理文件:

miktex-xetex.exe -synctex=1 -undump=xelatex %1.tex
convert -density 600 %1.pdf -quality 90 %1.png

代码能修复吗?为什么它不起作用?谢谢。

答案1

这是一个工作示例xelatex

\documentclass[pstricks,preview,margin=0pt]{standalone}
\usepackage{pst-plot}
\usepackage{tgheros}
\renewcommand*\familydefault{\sfdefault}
\usepackage[T1]{fontenc}
\begin{document}
\psset{linecolor=gray,unit=0.75bp}

\begin{pspicture}(-352,-352)(352,352)
\color{gray}%
\pscircle[linewidth=2pt](0,0){256}
\uput{10}[255]{-15}(256;255){\textcolor{gray}{\large\textit{H}}}%
\multido{\iA=30+30,\iB=120+30,\iC=210+30}{11}{\uput{10}[\iB]{\iC}(256;\iB){\iA}}%
\multido{\iA=0+30}{12}{\psline[linewidth=0.5pt](260;\iA)(250;\iA)}
\end{pspicture}

\end{document}

在此处输入图片描述

相关内容