Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % TikZ chains with labeled edges
- % Author: Stefan Kottwitz , http://texblog.net
- documentclass[a4paper,10pt]{article}
- usepackage{tikz}
- usetikzlibrary{arrows,chains,matrix,positioning,scopes,calc,fit,shapes.geometric}
- %
- makeatletter
- tikzset{join/.code=tikzset{after node path={%
- ifxtikzchainpreviouspgfutil@emptyelse(tikzchainprevious)%
- edge[every join]#1(tikzchaincurrent)fi}}}
- makeatother
- %
- tikzset{>=stealth',every on chain/.append style={join},
- every join/.style={->}}
- tikzset{labeled/.style={execute at begin node=$scriptstyle,
- execute at end node=$}}
- %
- begin{document}
- begin{tikzpicture}
- matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]
- { 0 & A & B & C & 0 \
- 0 & A' & B' & C' & 0 \ };
- { [start chain] chainin (m-1-1);
- chainin (m-1-2);
- { [start branch=A] chainin (m-2-2)
- [join={node[right,labeled] {eta_1}}];}
- chainin (m-1-3) [join={node[above,labeled] {varphi}}];
- { [start branch=B] chainin (m-2-3)
- [join={node[right,labeled] {eta_2}}];}
- chainin (m-1-4) [join={node[above,labeled] {psi}}];
- { [start branch=C] chainin (m-2-4)
- [join={node[right,labeled] {eta_3}}];}
- chainin (m-1-5); }
- { [start chain] chainin (m-2-1);
- chainin (m-2-2);
- chainin (m-2-3) [join={node[above,labeled] {varphi'}}];
- chainin (m-2-4) [join={node[above,labeled] {psi'}}];
- chainin (m-2-5); }
- path let p1=(m-1-1), p2=(m-2-2), n1={atan2(y2-y1,x2-x1)} in
- node[draw,dashed,ellipse,inner sep=0pt,rotate fit=n1,fit=(m-1-1) (m-2-2)]{}; %added
- end{tikzpicture}
- end{document}
Add Comment
Please, Sign In to add comment