[pstricks] doubleline

Herbert Voss LaTeX at zedat.fu-berlin.de
Fri May 4 09:25:16 CEST 2007


Peter Trubitz wrote:
>
> Is this the only way to get doublelines with closed edges?

define your line type.

Herbert

\documentclass{minimal}
\usepackage{pstricks}

\makeatletter
\def\psLine{\@ifnextchar[{\psLine at i}{\psLine at i[]}}
\def\psLine at i[#1](#2){\@ifnextchar({\psLine at ii[#1](#2)}{\psLine at ii[#1](0,0)(#2)}}
\def\psLine at ii[#1](#2)(#3){{%
  \pst at killglue
  \psset{arrows=c-c,#1}
  \psline(#2)(#3)
  \pst at dimc=\psdoublesep
  \psaddtolength\pslinewidth{-\pst at dimc}
  \let\pslinecolor\psdoublecolor
  \psline(#2)(#3)
}}
\makeatother
\begin{document}

\begin{pspicture}(5,4)
 \psLine[linewidth=10pt,linecolor=black,doublecolor=red](5,4)
 \psLine[linewidth=10pt,linecolor=black,doublecolor=red,doublesep=3pt](0,2)(5,2)
 \psLine[linewidth=20pt,linecolor=red,doublecolor=blue,doublesep=15pt](0,4)(5,0)
\end{pspicture}

\end{document}




More information about the PSTricks mailing list