Guest User

Untitled

a guest
Jun 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. % TikZ chains with labeled edges
  2. % Author: Stefan Kottwitz , http://texblog.net
  3. documentclass[a4paper,10pt]{article}
  4. usepackage{tikz}
  5. usetikzlibrary{arrows,chains,matrix,positioning,scopes,calc,fit,shapes.geometric}
  6. %
  7. makeatletter
  8. tikzset{join/.code=tikzset{after node path={%
  9. ifxtikzchainpreviouspgfutil@emptyelse(tikzchainprevious)%
  10. edge[every join]#1(tikzchaincurrent)fi}}}
  11. makeatother
  12. %
  13. tikzset{>=stealth',every on chain/.append style={join},
  14. every join/.style={->}}
  15. tikzset{labeled/.style={execute at begin node=$scriptstyle,
  16. execute at end node=$}}
  17. %
  18. begin{document}
  19. begin{tikzpicture}
  20. matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]
  21. { 0 & A & B & C & 0 \
  22. 0 & A' & B' & C' & 0 \ };
  23. { [start chain] chainin (m-1-1);
  24. chainin (m-1-2);
  25. { [start branch=A] chainin (m-2-2)
  26. [join={node[right,labeled] {eta_1}}];}
  27. chainin (m-1-3) [join={node[above,labeled] {varphi}}];
  28. { [start branch=B] chainin (m-2-3)
  29. [join={node[right,labeled] {eta_2}}];}
  30. chainin (m-1-4) [join={node[above,labeled] {psi}}];
  31. { [start branch=C] chainin (m-2-4)
  32. [join={node[right,labeled] {eta_3}}];}
  33. chainin (m-1-5); }
  34. { [start chain] chainin (m-2-1);
  35. chainin (m-2-2);
  36. chainin (m-2-3) [join={node[above,labeled] {varphi'}}];
  37. chainin (m-2-4) [join={node[above,labeled] {psi'}}];
  38. chainin (m-2-5); }
  39. path let p1=(m-1-1), p2=(m-2-2), n1={atan2(y2-y1,x2-x1)} in
  40. node[draw,dashed,ellipse,inner sep=0pt,rotate fit=n1,fit=(m-1-1) (m-2-2)]{}; %added
  41. end{tikzpicture}
  42. end{document}
Add Comment
Please, Sign In to add comment