是否可以对多个路径使用 \pscustom 样式?

是否可以对多个路径使用 \pscustom 样式?

下面我们可以看到我重复使用了相同的\pscustom指令,这里我的所有路径都具有相同的样式。是否可以为所有路径全局声明它?

\psset{xunit=.5pt,yunit=.5pt,runit=.5pt}
\begin{pspicture}(151.18,113.38)
\newrgbcolor{red}{0.85 0.16 0.10}
\pscustom[linestyle=none,fillstyle=solid,fillcolor=red]
{
    \newpath
    \moveto(111.42,27.49)
    \lineto(85.09,27.49)
    \lineto(85.09,19.43)
    \lineto(103.36,19.43)
    \lineto(103.39,19.01)
    ...
    \lineto(104.88,1.90)
    \lineto(111.43,1.90)
    \lineto(111.43,27.49)
    \closepath
}
\pscustom[linestyle=none,fillstyle=solid,fillcolor=red]
{
    \newpath
    \moveto(69.77,71.11)
    \lineto(69.77,84.41)
    ...
    \lineto(61.28,63.20)
    \lineto(111.42,63.20)
    \lineto(111.42,71.11)
    \closepath
}
\end{pspicture}

答案1

\documentclass{article}
\usepackage{pstricks}
\begin{document}
\psset{xunit=.5pt,yunit=.5pt,runit=.5pt}% global setting

{%  local setting, but global to pspicture environment
    \psset{linestyle=none,fillstyle=solid,fillcolor=red}
    \begin{pspicture}(151.18,113.38)
        \pscustom{
            \moveto(111.42,27.49)
            \lineto(85.09,27.49)
            \lineto(85.09,19.43)
            \lineto(103.36,19.43)
            \lineto(103.39,19.01)
            \lineto(104.88,1.90)
            \lineto(111.43,1.90)
            \lineto(111.43,27.49)
            \closepath
        }
        \pscustom{
            \moveto(69.77,71.11)
            \lineto(69.77,84.41)
            \lineto(61.28,63.20)
            \lineto(111.42,63.20)
            \lineto(111.42,71.11)
            \closepath
        }
    \end{pspicture}%
}
\end{document}

相关内容