在 TeXShop 上运行 PSTricks 图像

在 TeXShop 上运行 PSTricks 图像

我正在尝试编译以下 pstricks 图像,这是我在另一篇文章中提出的邮政

 \mathversion{sans}\setlength\fboxsep{0pt}
\begin{postscript}
    $\begin{pmatrix}
        0 & 0 & 0 & 0 & \dots & 0 \\ 0 & \pnode[0,1.5ex]{A} & &     &\pnode[0,1.5ex]{Dh} \\0\\0\\\vdots &\pnode{Dv} \\0 & & & & & \pnode{B}
    \end{pmatrix}$
    \psset{arrowinset=0, linewidth=1.5pt, linearc=0.2pt, nodesep = 6pt,, arrows =c- }
\psline{<->}(A)(B)
\psset{linecolor=RoyalBlue2, fillcolor=RoyalBlue1!15!, arrows =c-}
\ncangle[angleB=90, linestyle = none, fillstyle=solid,]{A}{B}
\ncline[nodesepB=9.5pt]{A}{Dh}
\ncangle[angleA=90, nodesepB=7.5pt]{B}{Dh}
\rput(Dh){\color{RoyalBlue2}\dots}
\psset{angleA=-90, angleB=180, linecolor=Red1!60!, fillcolor=Red1!10!, arrows =-c}
\ncangle[linestyle=none, fillstyle=solid]{A}{B}
\ncangle[nodesepA=3pt,]{Dv}{B}
\ncline[nodesepA=12pt]{Dv}{A}
\rput[B](Dv){\color{Red1!60!}\vdots}
\end{postscript}

但它无法编译。我在 Mac 上使用 TexShop,并使用 LaTeX 编译器。我尝试了发布在此上的各种建议邮政和这个邮政关于如何在 TeXShop 上运行 PSTricks。到目前为止,两者都没有奏效。

在编译控制台中,它显示:软件包 ifplatform 警告:shell escape 已禁用,因此我只能检测到 \ifwindows。软件包 auto-pst-pdf 错误:“shell escape”(或“write18”)未启用:auto-pst-pdf 将不起作用!

请告诉我需要更改、包含哪些配置和包以及如何使图像正常工作。非常感谢。

答案1

Preferences submenu在菜单的中TeXShop,选择pdftex选项卡,然后--shell-escape在编辑窗口中添加。

答案2

您运行的示例xelatex

\documentclass{scrartcl}
\usepackage[dvipsnames,x11names]{pstricks}
\usepackage{amsmath}
\usepackage{pst-node}
\usepackage{unicode-math}
\setmathfont{XITS Math}
\setmathfont[range=\mathit]{Linux Biolinum O Italic}% for sans serif math

\begin{document}
$\begin{pmatrix}
    0 & 0 & 0 & 0 & \dots & 0 \\ 
    0 & \pnode[0,1.5ex]{A} & &     &\pnode[0,1.5ex]{Dh} \\
    0\\
    0\\
    \vdots &\pnode{Dv} \\
    0 & & & & & \pnode{B}
 \end{pmatrix}$
    \psset{arrowinset=0, linewidth=1.5pt, linearc=0.2pt, nodesep = 6pt,, arrows =c- }
    \psline{<->}(A)(B)
    \psset{linecolor=RoyalBlue2, fillcolor=RoyalBlue1!15!, arrows =c-}
    \ncangle[angleB=90, linestyle = none, fillstyle=solid,]{A}{B}
    \ncline[nodesepB=9.5pt]{A}{Dh}
    \ncangle[angleA=90, nodesepB=7.5pt]{B}{Dh}
    \rput(Dh){\color{RoyalBlue2}\dots}
    \psset{angleA=-90, angleB=180, linecolor=Red1!60!, fillcolor=Red1!10!, arrows =-c}
    \ncangle[linestyle=none, fillstyle=solid]{A}{B}
    \ncangle[nodesepA=3pt,]{Dv}{B}
    \ncline[nodesepA=12pt]{Dv}{A}
    \rput[B](Dv){\color{Red1!60!}\vdots}

 \end{document}

在此处输入图片描述

相关内容