Re: parallel arrows: what about

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: parallel arrows: what about

by Mark Wibrow-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/9/29  <koslowj@...>:
> Hi Mark,
>
> Thanks, that looks very promising!   Once I figure out, how to move the labels accordingly, I'll be ready to replace most of my xypic diagrams ;-)
>
> -- Jürgen
>

Hi,

postactions and the markings decoration are your freinds here. See the
docs for details:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations}
\usetikzlibrary{decorations.markings}

%\usepackage{textcomp}

\begin{document}

\pgfdeclaredecoration{single line}{initial}{
        \state{initial}[width=\pgfdecoratedpathlength-1sp]{\pgfpathmoveto{\pgfpointorigin}}
        \state{final}{\pgfpathlineto{\pgfpointorigin}}
}



\tikzset{
        raise line/.style={
                decoration={single line, raise=#1}, decorate
        },
        label line/.style={
                postaction={
                        decoration={raise=0pt,markings, mark=#1}, decorate
                }
        }
}
               
\begin{tikzpicture}
        \draw [red, very thick] (0,0) -- (3,2);
        \foreach \r in {-20,-15,...,20}
                \draw
                [
                        raise line=\r,
                        label line=at position 0.5 with {\node[sloped,above]{\tiny\r};},
                        ->
                ]
                (0,0) -- (3,2);
\end{tikzpicture}

\end{document}

Regards

Mark

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users