[pstricks] more veearrow ... options.
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Sat Aug 20 09:02:22 CEST 2011
Am 19.08.2011 21:08, schrieb Greg Hersh:
> just a thought: it would be nice to add the following option to veearrow ...:
>
> veearrowlinetype= ...
>
> with the possible values solid (default), dotted or dashed. Just like the regular pstricks line options.
>
> I just had a situation where using v-v arrows with all the controls it provided was super. Except one thing: I need to typeset the arrow lines dotted, and I could not. :-(
will be available in the next update.
Herbert
\documentclass{book}
\usepackage{pstricks-add}
\makeatletter
\define at key[psset]{pstricks-add}{arrowlinestyle}[solid]{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\def\psarrowlinestyle{#1}}}
\psset[pstricks-add]{arrowlinestyle=solid} % default
\pst at def{VeeArrow}<%
1 setlinecap % round caps
1 setlinejoin % round join
setlinewidth % vee arrow line width
/y ED % projected length
2 div /a ED % angle (divide by 2)
/t ED % false = inside, true = outside
a sin a cos div y mul /x ED % perpendicular length : x=tan(a).y
t { 1 -1 scale } if % if outside : symmetry
x neg y moveto % point #1
0 0 L % point #2
x y L % point #3
\@nameuse{psls@\psarrowlinestyle}
{ closepath gsave fill grestore } if % if filled : close and fill
stroke % draw line
0 t { y 2 mul } { 0 } ifelse moveto> % if outside : twice longer
line
\pst at def{TickArrow}<%
1 setlinecap % round caps
1 setlinejoin % round join
setlinewidth % tick line width
/y ED % projected length
/t ED % false = normal, true = reversed
t { 1 -1 scale } if % if reversed : symmetry
y neg y moveto % point #1
y y neg L % point #2
\@nameuse{psls@\psarrowlinestyle}
stroke % draw line
0 0 moveto> % origin
\makeatother
\begin{document}
\psset{unit=5mm}
\begin{pspicture}(10,6)
\psset{dimen=middle,arrows=c-c,arrowscale=2,linewidth=.25mm,
arrowlinestyle=dashed,dash=1.5pt 1pt}
\psline[linecolor=red,linewidth=.05mm](0,0)(0,6)
\psline[linecolor=red,linewidth=.05mm](4,0)(4,6)
\psline{v-v}(0,6)(4,6)
\psline{v-V}(0,4)(4,4)
\psline{V-v}(0,2)(4,2)
\psline{V-V}(0,0)(4,0)
\psline[linecolor=red,linewidth=.05mm](6,0)(6,6)
\psline[linecolor=red,linewidth=.05mm](10,0)(10,6)
\psset{arrowlinestyle=dotted,dotsep=0.8pt}
\psline{v-v}(6,6)(10,6)
\psline{v-V}(6,4)(10,4)
\psline{V-v}(6,2)(10,2)
\psline{V-V}(6,0)(10,0)
\end{pspicture}
\begin{pspicture}(10,7)
\psset{dimen=middle,arrows=c-c,arrowscale=2,linewidth=.25mm,
arrowlinestyle=dashed,dash=1.5pt 1pt}
\psline[linecolor=red,linewidth=.05mm](0,0)(0,6)
\psline[linecolor=red,linewidth=.05mm](4,0)(4,6)
\psline{t-t}(0,6)(4,6)
\psline{t-T}(0,4)(4,4)
\psline{T-t}(0,2)(4,2)
\psline{T-T}(0,0)(4,0)
\psline[linecolor=red,linewidth=.05mm](6,0)(6,6)
\psline[linecolor=red,linewidth=.05mm](10,0)(10,6)
\psset{arrowlinestyle=dotted,dotsep=0.8pt}
\psline{t-t}(6,6)(10,6)
\psline{t-T}(6,4)(10,4)
\psline{T-t}(6,2)(10,2)
\psline{T-T}(6,0)(10,0)
\end{pspicture}
\end{document}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bildschirmfoto.png
Type: image/png
Size: 5233 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20110820/9d306006/attachment.png>
More information about the PSTricks
mailing list