diff options
author | Karl Berry <karl@freefriends.org> | 2011-06-06 17:19:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-06-06 17:19:02 +0000 |
commit | f1d06fce2319ea434c6a7721760307eb22570c93 (patch) | |
tree | ae18d3bdacad29d92c9cdd613f514d08e56ec896 /Master/texmf-dist/tex/latex/tkz-linknodes | |
parent | 7c13a3e7b0c96c0aec4a1ee173681b1da48ec018 (diff) |
tkz-linknodes (5jun11)
git-svn-id: svn://tug.org/texlive/trunk@22833 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-linknodes')
-rw-r--r-- | Master/texmf-dist/tex/latex/tkz-linknodes/tkz-linknodes.sty | 56 |
1 files changed, 46 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-linknodes/tkz-linknodes.sty b/Master/texmf-dist/tex/latex/tkz-linknodes/tkz-linknodes.sty index ab3aadd2628..32a7ff3fd74 100644 --- a/Master/texmf-dist/tex/latex/tkz-linknodes/tkz-linknodes.sty +++ b/Master/texmf-dist/tex/latex/tkz-linknodes/tkz-linknodes.sty @@ -33,11 +33,11 @@ %<---------------------------------------------------------------------------> %<---------------------------------------------------------------------------> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tkz-linknodes}[2008/08/22 v1.0c tkz-linknodes] +\ProvidesPackage{tkz-linknodes}[2011/06/02 v1.1c tkz-linknodes] \RequirePackage{etex} \RequirePackage{ifthen} \RequirePackage{xkeyval}[2005/11/25] -\RequirePackage{tikz}[2007/06/07] +\RequirePackage{tikz} \RequirePackage{amsmath} \usetikzlibrary{arrows} %<---------------------------------------------------------------------------> @@ -45,7 +45,9 @@ %<---------------------------------------------------------------------------> \tikzset{ArrowStyle/.style={>=latex,->,text=black}} \tikzset{LabelStyle/.style={pos=0.25,right}} +\tikzset{ReverseStyle/.style={pos=0.25,left}} \tikzset{NodeStyle/.style={}} +\tikzset{NodeHStyle/.style={}} %<---------------------------------------------------------------------------> \define@cmdkey [TK] {SUM} {margin}{} \define@cmdkey [TK] {SUM} {dy}{} @@ -79,7 +81,7 @@ \newboolean{B@FirstLink}\setboolean{B@FirstLink}{true} \newboolean{B@NewGroup}\setboolean{B@NewGroup}{false} \newboolean{B@DeltaBegin}\setboolean{B@DeltaBegin}{false} -\newboolean{B@DeltaEnd}\setboolean{B@DeltaEnd}{false} +\newboolean{B@DeltaEnd}\setboolean{B@DeltaEnd}{false} %<---------------------------------------------------------------------------> \newcommand*{\@SetTab}{% \ifnum \value{C@NumTab}>25\relax% @@ -136,6 +138,12 @@ \end{tikzpicture}% \ignorespaces }% +\newcommand*{\AddRevNode}{% + \begin{tikzpicture}[remember picture]% + \node[NodeStyle]% + (reverse@node){};% + \end{tikzpicture}% +\ignorespaces } %<---------------------------------------------------------------------------> %<---------------------------------------------------------------------------> %<---------------------------------------------------------------------------> @@ -148,10 +156,16 @@ \setcounter{C@CurrentNode}{1}% \setcounter{C@CurrentStop}{\value{C@Stop\@alph{#1}}}}% %<---------------------------------------------------------------------------> +\define@cmdkey [TK] {node} {Bshift}{}% +\define@cmdkey [TK] {node} {Mshift}{}% +\define@cmdkey [TK] {node} {Eshift}{}% \define@cmdkey [TK] {node} {margin}{}% \define@cmdkey [TK] {node} {dy}{}% -\presetkeys [TK] {node} {dy = 1.5pt,% - margin = 2 cm}{}% +\presetkeys [TK] {node} {dy = 1.5pt,% + margin = 2 cm, + Bshift = -6cm, + Mshift = -7cm, + Eshift = -6cm}{}% %<---------------------------------------------------------------------------> \newcommand{\LinkNodes}[2][]{% \setkeys[TK]{node}{#1}% @@ -163,15 +177,17 @@ \setboolean{B@DeltaBegin}{false}}{\setboolean{B@DeltaBegin}{true}}}% \def\TGCN{\PrefixCurrentTab-\theC@CurrentGroup-\theC@CurrentNode}% \def\TGNN{\PrefixCurrentTab-\theC@CurrentGroup-\theC@NextNode}% +% +% \begin{tikzpicture}[remember picture,overlay]% \pgfextractx{\pgf@x}{\pgfpointanchor{\TGCN}{center}}% \pgfextracty{\pgf@y}{\pgfpointanchor{\TGCN}{center}}% \p@intCx\pgf@x\p@intCy\pgf@y% \pgfextractx{\pgf@x}{\pgfpointanchor{\TGNN}{center}}% \pgfextracty{\pgf@y}{\pgfpointanchor{\TGNN}{center}}% -\p@intNx\pgf@x\p@intNy\pgf@y% -\p@inty\p@intCy\p@intx\linewidth% -\advance\p@intx by-\cmdTK@node@margin% +\p@intNx\pgf@x\p@intNy\pgf@y +\p@inty\p@intCy\p@intx\linewidth +\advance\p@intx by-\cmdTK@node@margin \ifthenelse{\boolean{B@FirstLink}}{% \setboolean{B@FirstLink}{false}% \xdef\lastp@intx{\p@intCx}% @@ -190,6 +206,9 @@ {\path[coordinate](\TGNN.center) coordinate(End);}% % \draw[ArrowStyle] (Begin)--(Inter)|-(End) node[LabelStyle]{#2};% +\ifTK@NL@reverse +\draw[ArrowStyle] ([xshift=\cmdTK@node@Bshift]Begin)--([xshift=\cmdTK@node@Mshift]Inter)|-([xshift=\cmdTK@node@Eshift]End) node[LabelStyle,ReverseStyle]{#2};% +\fi % \xdef\lastp@inty{\p@intCy}\global\let\lastp@inty\lastp@inty% \ifthenelse{\value{C@NextNode}=\value{C@CurrentStop}}{% @@ -213,7 +232,8 @@ %<---------------------------------------------------------------------------> \define@cmdkey [TK] {NL} {margin}{} \define@cmdkey [TK] {NL} {dy}{} -\presetkeys [TK] {NL} {margin = 2 cm, +\define@boolkey[TK] {NL} {reverse}[true]{} +\presetkeys [TK] {NL} {margin = 2 cm,reverse=false, dy = 1.5pt}{} %<---------------------------------------------------------------------------> \newenvironment{NodesList}[1][]{% @@ -225,5 +245,21 @@ \stepcounter{C@CurrentGroup}% }{}% %<---------------------------------------------------------------------------> -%<---------------------------------------------------------------------------> +\newcommand\AddHNode[2]{} +\def\AddHNode{\pgfutil@ifnextchar[{\Add@HNode}{\Add@HNode[]}} +\def\Add@HNode[#1](#2)#3{% #2 = name of the node #3 content of node +\begin{tikzpicture}[remember picture,baseline=(#2.base)] + \node[outer sep = 2pt, + inner sep = 0pt, + NodeHStyle, + #1](#2){#3}; +\end{tikzpicture} +} + +\newcommand\LinkHNode[4]{% +\begin{tikzpicture}[remember picture,overlay] + \draw[<->] (#1) -- ++(0,#4) -| (#2) + node[fill=white,near start] {\small #3}; +\end{tikzpicture}% +} %<---------------------------------------------------------------------------> \endinput |