PSTricks 包中出现错误——再次出现尾随空格?

PSTricks 包中出现错误——再次出现尾随空格?

这个问题类似于PSTricks 包 pst-poly 中有错误吗?

请考虑以下示例:

\documentclass{article}

\usepackage{pst-grad,pstricks-add}

\newcommand*\PolyLine{%
  \psarc(C){\RelRadiusB}{!90 \vinkelA add}{180}
  \psline(B)(A)(D)
  \psarc(C){\RelRadiusB}{0}{!90 \vinkelA sub}}


\begin{document}

\begin{figure}
\def\radius{21.65}
\def\vinkelA{12 }
\def\vinkelB{71 }
\pstFPdiv\faktor{1}{3}
\pstFPmul\RelFaktor{2}{\faktor}
\pstFPmul\rammeA{\radius}{\faktor}
\pstFPadd\rammeB{\rammeA}{2.95}
\makeatletter
  \pst@getsinandcos{\vinkelA}
  \pstFPmul\RelRadiusB\faktor{\radius}
  \pstFPmul\MaxLW\RelRadiusB\pst@sin
  \pstFPmul\MaxLW{2}{\MaxLW}
 \psset{unit = 0.5}
  \begin{pspicture}(-\rammeA,-\rammeA)(\rammeA,\rammeB)
    \pst@getsinandcos{\vinkelB}
      \ifnum \vinkelB = 90
       \let \RelLW\MaxLW
      \else
      \ifnum \vinkelB > 90
        \pstFPmul\RelLW{\MaxLW}{\pst@cos}
      \else
        \pstFPmul\RelLW{\MaxLW}{\pst@sin}
      \fi
    \fi
    \pnodes%
      (-\RelRadiusB,-\RelRadiusB){A}%
      (-\RelRadiusB,0){B}%
      (0,0){C}%
      (\RelRadiusB,-\RelRadiusB){D}%
      (!0 \RelRadiusB\space \vinkelA cos mul){T1}
    \pscustom[
      linewidth = 2pt,
      linecolor = red,
      fillstyle = gradient,
      gradbegin = blue!5,
      gradmidpoint = 1,
      gradend = blue!35
    ]{\PolyLine}
    \begin{psclip}{%
      \pscustom[linestyle = none]{
        \PolyLine
        \psline(\RelRadiusB,\RelRadiusB)(!\RelRadiusB\space dup 3 add)%
               (!\RelRadiusB\space dup neg exch 3 add)(-\RelRadiusB,\RelRadiusB)}}
      \rput(!0 \RelRadiusB\space \vinkelA cos mul){%
        \pcline[linecolor = yellow, linewidth = \RelLW, nodesep = -\radius]%
          (0,0)(!\vinkelB dup 90 ne {-1 exch neg Tan neg} {0 -1} ifelse)}
    \end{psclip}
    \pscustom[linewidth = 2pt, linecolor = black!70]{\PolyLine}
    \psline[linestyle = dotted]({-\RelRadiusB,0}|T1)({\RelRadiusB,0}|T1)
    \rput(!\RelRadiusB\space 90 \vinkelA sub PtoC){%
      \pswedge(0,0){1}{!180 \vinkelB sub}{180}
      \uput{1}[!180 \vinkelB 2 div sub](0,0){\footnotesize $\vinkelB^{\ensuremath{\circ}}$}
      \psline[linestyle = dotted](0,0)(!3 180 \vinkelB sub PtoC)}
  \end{pspicture}
\end{figure}

\end{document}

输出

可以看出,阳光没有像过去那样完美地穿过屋顶上的洞,而是稍微向右移动了一点。这也是尾随空间造成的吗?

答案1

使用:

\pscustom[
  linewidth = 2pt,
  linecolor = red,
  fillstyle = gradient,
  gradbegin = blue!5,
  gradmidpoint = 1,
  gradend = blue!35
]{\PolyLine}%  <<=======

\pscustom\ignorespaces末尾没有,并且与下面的(开头也\psclip没有)一起,上面的空间不会被 PSTricks “吃掉”。\pst@killglue

相关内容