\ifx\danslelivre\undefined \documentclass[9pt]{../configuration/smfart} \input{../configuration/commun} \input{../configuration/smf} \input{../configuration/adresse} \input{../configuration/gadgets} \input{../configuration/francais} \input{../configuration/numerotation} \input{../configuration/formules} \input{../configuration/encoredesmacros} \usepackage{stmaryrd} \usepackage{graphics} \usepackage[usenames,dvipsnames]{xcolor} \usepackage{tikz} \usetikzlibrary{matrix} \usetikzlibrary{calc} \title{Tikz : exemples} \begin{document} \maketitle \else \chapter{Tikz : exemples} \fi \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=2.5em]{ X_1&X_2&X_3&\;\cdots\;&X_{2n-1}&X_{2n}&X_{2n+1}\\}; \draw[->] (diag-1-1) -- node{$f_1$} (diag-1-2); \draw[->] (diag-1-3) -- node[swap]{$g_1$} (diag-1-2); \draw[->] (diag-1-3) -- node{$f_2$} (diag-1-4); \draw[->] (diag-1-5) -- node[swap]{$g_{n-1}$} (diag-1-4); \draw[->] (diag-1-5) -- node{$f_n$} (diag-1-6); \draw[->] (diag-1-7) -- node[swap]{$g_n$} (diag-1-6); \end{tikzpicture} \end{center} \begin{verbatim} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=2.5em]{ X_1&X_2&X_3&\;\cdots\;&X_{2n-1}&X_{2n}&X_{2n+1}\\}; \draw[->] (diag-1-1) -- node{$f_1$} (diag-1-2); \draw[->] (diag-1-3) -- node[swap]{$g_1$} (diag-1-2); \draw[->] (diag-1-3) -- node{$f_2$} (diag-1-4); \draw[->] (diag-1-5) -- node[swap]{$g_{n-1}$} (diag-1-4); \draw[->] (diag-1-5) -- node{$f_n$} (diag-1-6); \draw[->] (diag-1-7) -- node[swap]{$g_n$} (diag-1-6); \end{tikzpicture} \end{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ T(X)&T(X')\\S(Y)&S(Y')\\}; \draw[->] (diag-1-1) -- node[swap]{$h$} (diag-2-1); \draw[->] (diag-1-2) -- node{$h'$} (diag-2-2); \draw[->] (diag-1-1) -- node{$T(u)$} (diag-1-2); \draw[->] (diag-2-1) -- node{$S(v)$} (diag-2-2); \end{tikzpicture} \end{center} \begin{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ T(X)&T(X')\\S(Y)&S(Y')\\}; \draw[->] (diag-1-1) -- node[swap]{$h$} (diag-2-1); \draw[->] (diag-1-2) -- node{$h'$} (diag-2-2); \draw[->] (diag-1-1) -- node{$T(u)$} (diag-1-2); \draw[->] (diag-2-1) -- node{$S(v)$} (diag-2-2); \end{tikzpicture} \end{center} \end{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ \categ{C}&\categ{D}\\}; \draw[->] (diag-1-1) to [out=80,in=100] node [auto=false] (F) {} node [pos=0.45] {$\scriptstyle F$} (diag-1-2); \draw[->] (diag-1-1) to node [auto=false] (G) {} node [pos=0.25] {$\scriptstyle G$} (diag-1-2); \draw[->] (diag-1-1) to [out=-80,in=-100] node [auto=false] (H) {} node [pos=0.45,swap] {$\scriptstyle H$} (diag-1-2); \draw[->] (F) -- node{$\scriptstyle u$} (G); \draw[->] (G) -- node{$\scriptstyle v$} (H); \end{tikzpicture} \end{center} \begin{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ \categ{C}&\categ{D}\\}; \draw[->] (diag-1-1) to [out=80,in=100] node [auto=false] (F) {} node [pos=0.45] {$\scriptstyle F$} (diag-1-2); \draw[->] (diag-1-1) to node [auto=false] (G) {} node [pos=0.25] {$\scriptstyle G$} (diag-1-2); \draw[->] (diag-1-1) to [out=-80,in=-100] node [auto=false] (H) {} node [pos=0.45,swap] {$\scriptstyle H$} (diag-1-2); \draw[->] (F) -- node{$\scriptstyle u$} (G); \draw[->] (G) -- node{$\scriptstyle v$} (H); \end{tikzpicture} \end{center} \end{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=5em,row sep=5ex]{ \categ{C}&\categ{D}&\categ{E}\\}; \draw[->] (diag-1-1) to [out=40,in=140] node [auto=false] (F) {} node {$\scriptstyle F$} (diag-1-2); \draw[->] (diag-1-1) to [out=-40,in=-140] node [auto=false] (F') {} node [swap] {$\scriptstyle F'$} (diag-1-2); \draw[->] (diag-1-2) to [out=40,in=140] node [auto=false] (G) {} node {$\scriptstyle G$} (diag-1-3); \draw[->] (diag-1-2) to [out=-40,in=-140] node [auto=false] (G') {} node [swap] {$\scriptstyle G'$} (diag-1-3); \draw[->] (F) -- node{$\scriptstyle u$} (F'); \draw[->] (G) -- node{$\scriptstyle v$} (G'); \end{tikzpicture} \end{center} \begin{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=5em,row sep=5ex]{ \categ{C}&\categ{D}&\categ{E}\\}; \draw[->] (diag-1-1) to [out=40,in=140] node [auto=false] (F) {} node {$\scriptstyle F$} (diag-1-2); \draw[->] (diag-1-1) to [out=-40,in=-140] node [auto=false] (F') {} node [swap] {$\scriptstyle F'$} (diag-1-2); \draw[->] (diag-1-2) to [out=40,in=140] node [auto=false] (G) {} node {$\scriptstyle G$} (diag-1-3); \draw[->] (diag-1-2) to [out=-40,in=-140] node [auto=false] (G') {} node [swap] {$\scriptstyle G'$} (diag-1-3); \draw[->] (F) -- node{$\scriptstyle u$} (F'); \draw[->] (G) -- node{$\scriptstyle v$} (G'); \end{tikzpicture} \end{center} \end{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=5em,row sep=5ex]{ G(F(X))&G(F(Y))\\G(F'(X))&G(F'(Y))\\G'(F'(X))&G'(F'(Y))\\}; \draw[->] (diag-1-1) -- node[swap]{$G(u(X))$} (diag-2-1); \draw[->] (diag-1-2) -- node{$G(u(Y))$} (diag-2-2); \draw[->] (diag-2-1) -- node[swap]{$v(F'(X))$} (diag-3-1); \draw[->] (diag-2-2) -- node{$v(F'(Y))$} (diag-3-2); \draw[->] (diag-1-1) -- node{$G(F(z))$} (diag-1-2); \draw[->] (diag-2-1) -- node{$G(F'(z))$} (diag-2-2); \draw[->] (diag-3-1) -- node{$G'(F'(z))$} (diag-3-2); \end{tikzpicture} \end{center} \begin{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=5em,row sep=5ex]{ G(F(X))&G(F(Y))\\G(F'(X))&G(F'(Y))\\G'(F'(X))&G'(F'(Y))\\}; \draw[->] (diag-1-1) -- node[swap]{$G(u(X))$} (diag-2-1); \draw[->] (diag-1-2) -- node{$G(u(Y))$} (diag-2-2); \draw[->] (diag-2-1) -- node[swap]{$v(F'(X))$} (diag-3-1); \draw[->] (diag-2-2) -- node{$v(F'(Y))$} (diag-3-2); \draw[->] (diag-1-1) -- node{$G(F(z))$} (diag-1-2); \draw[->] (diag-2-1) -- node{$G(F'(z))$} (diag-2-2); \draw[->] (diag-3-1) -- node{$G'(F'(z))$} (diag-3-2); \end{tikzpicture} \end{center} \end{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ G(F(X))&G(F'(X))&G(F''(X))\\G'(F(X))&G'(F'(X))&G'(F''(X))\\ G''(F(X))&G''(F'(X))&G''(F''(X))\\}; \draw[->] (diag-1-1) -- (diag-2-1); \draw[->] (diag-1-2) -- (diag-2-2); \draw[->] (diag-1-3) -- (diag-2-3); \draw[->] (diag-2-1) -- (diag-3-1); \draw[->] (diag-2-2) -- (diag-3-2); \draw[->] (diag-2-3) -- (diag-3-3); \draw[->] (diag-1-1) -- (diag-1-2); \draw[->] (diag-2-1) -- (diag-2-2); \draw[->] (diag-3-1) -- (diag-3-2); \draw[->] (diag-1-2) -- (diag-1-3); \draw[->] (diag-2-2) -- (diag-2-3); \draw[->] (diag-3-2) -- (diag-3-3); \draw[->] (diag-1-1) -- node[pos=0.3,sloped]{$\scriptstyle(v\boxempty u)(X)$} (diag-2-2); \draw[->] (diag-2-2) -- node[pos=0.3,sloped]{$\scriptstyle(v'\boxempty u')(X)$} (diag-3-3); \end{tikzpicture} \end{center} \begin{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ G(F(X))&G(F'(X))&G(F''(X))\\G'(F(X))&G'(F'(X))&G'(F''(X))\\ G''(F(X))&G''(F'(X))&G''(F''(X))\\}; \draw[->] (diag-1-1) -- (diag-2-1); \draw[->] (diag-1-2) -- (diag-2-2); \draw[->] (diag-1-3) -- (diag-2-3); \draw[->] (diag-2-1) -- (diag-3-1); \draw[->] (diag-2-2) -- (diag-3-2); \draw[->] (diag-2-3) -- (diag-3-3); \draw[->] (diag-1-1) -- (diag-1-2); \draw[->] (diag-2-1) -- (diag-2-2); \draw[->] (diag-3-1) -- (diag-3-2); \draw[->] (diag-1-2) -- (diag-1-3); \draw[->] (diag-2-2) -- (diag-2-3); \draw[->] (diag-3-2) -- (diag-3-3); \draw[->] (diag-1-1) -- node[pos=0.3,sloped] {$\scriptstyle(v\boxempty u)(X)$} (diag-2-2); \draw[->] (diag-2-2) -- node[pos=0.3,sloped] {$\scriptstyle(v'\boxempty u')(X)$} (diag-3-3); \end{tikzpicture} \end{center} \end{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ &&P(i)\\T&X&\\&&P(j)\\}; \draw[->] (diag-2-1) to [out=60,in=180] node{$\scriptstyle t(i)$} (diag-1-3); \draw[->] (diag-2-2) -- node[auto=false,above left=-.5ex]{$\scriptstyle s(i)$} (diag-1-3); \draw[->] (diag-2-1) to [out=300,in=180] node[swap]{$\scriptstyle t(j)$} (diag-3-3); \draw[->] (diag-2-2) -- node[swap,auto=false,below left=-.5ex]{$\scriptstyle s(j)$} (diag-3-3); \draw[->] (diag-1-3) -- node{$\scriptstyle P(i\to j)$} (diag-3-3); \draw[->,dotted] (diag-2-1) -- node{$\scriptstyle z$} (diag-2-2); \end{tikzpicture} \end{center} \begin{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ &&P(i)\\T&X&\\&&P(j)\\}; \draw[->] (diag-2-1) to [out=60,in=180] node{$\scriptstyle t(i)$} (diag-1-3); \draw[->] (diag-2-2) -- node[auto=false,above left=-.5ex]{$\scriptstyle s(i)$} (diag-1-3); \draw[->] (diag-2-1) to [out=300,in=180] node[swap]{$\scriptstyle t(j)$} (diag-3-3); \draw[->] (diag-2-2) -- node[swap,auto=false,below left=-.5ex]{$\scriptstyle s(j)$} (diag-3-3); \draw[->] (diag-1-3) -- node{$\scriptstyle P(i\to j)$} (diag-3-3); \draw[->,dotted] (diag-2-1) -- node{$\scriptstyle z$} (diag-2-2); \end{tikzpicture} \end{center} \end{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=5em,row sep=5ex]{ T&T\\P(V(i'))&P(V(i''))\\P(i)&P(i)\\}; \draw[->] (diag-1-1) -- node[swap]{$\scriptstyle t(i')$} (diag-2-1); \draw[->] (diag-2-1) -- node[swap]{$\scriptstyle P(\gamma')$} (diag-3-1); \draw[->] (diag-1-2) -- node{$\scriptstyle t(i'')$} (diag-2-2); \draw[->] (diag-2-2) -- node{$\scriptstyle P(\gamma'')$} (diag-3-2); \draw[double] (diag-1-1) -- (diag-1-2); \draw[draw=none] (diag-2-1) to node [pos=0.5,auto=false] (mid) {$\cdots$} (diag-2-2); \draw[->] (diag-2-1) -- (mid); \draw[->] (diag-2-2) -- (mid); \draw[double] (diag-3-1) -- (diag-3-2); \end{tikzpicture} \end{center} \begin{verbatim} \begin{center} \begin{tikzpicture}[auto] \matrix(diag)[matrix of math nodes,column sep=5em,row sep=5ex]{ T&T\\P(V(i'))&P(V(i''))\\P(i)&P(i)\\}; \draw[->] (diag-1-1) -- node[swap]{$\scriptstyle t(i')$} (diag-2-1); \draw[->] (diag-2-1) -- node[swap]{$\scriptstyle P(\gamma')$} (diag-3-1); \draw[->] (diag-1-2) -- node{$\scriptstyle t(i'')$} (diag-2-2); \draw[->] (diag-2-2) -- node{$\scriptstyle P(\gamma'')$} (diag-3-2); \draw[double] (diag-1-1) -- (diag-1-2); \draw[draw=none] (diag-2-1) to node [pos=0.5,auto=false] (mid) {$\cdots$} (diag-2-2); \draw[->] (diag-2-1) -- (mid); \draw[->] (diag-2-2) -- (mid); \draw[double] (diag-3-1) -- (diag-3-2); \end{tikzpicture} \end{center} \end{verbatim} \begin{center} \begin{tikzpicture}[auto, elem/.style={rectangle,draw=black!50,text height=1.5ex,text depth=.5ex}, isin/.style={pos=0.5,auto=false,sloped,allow upside down}] % Le "allow upside down" est essentiel pour ne pas que les signes ∈ se % retrouvent dans le mauvais sens ! \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ \Hom(F(X),F(X))&\Hom(F(X),F(X'))&\Hom(F(X'),F(X'))\\ \Hom(X,G(F(X)))&\Hom(X,G(F(X')))&\Hom(X',G(F(X')))\\}; \draw[->] (diag-1-1) -- node[swap]{$\scriptstyle \theta(X,F(X))$} (diag-2-1); \draw[->] (diag-1-2) -- node{$\scriptstyle \theta(X,F(X'))$} (diag-2-2); \draw[->] (diag-1-3) -- node{$\scriptstyle \theta(X',F(X''))$} (diag-2-3); \draw[->] (diag-1-1) -- node{$\scriptstyle F(z)\circ\tiret$} (diag-1-2); \draw[->] (diag-1-3) -- node[swap]{$\scriptstyle \tiret\circ F(z)$} (diag-1-2); \draw[->] (diag-2-1) -- node{$\scriptstyle G(F(z))\circ\tiret$} (diag-2-2); \draw[->] (diag-2-3) -- node[swap]{$\scriptstyle \tiret\circ z$} (diag-2-2); \node[elem](elem-1-1) at ($(diag-1-1)+(2em,4ex)$) {$\scriptstyle\Id_{F(X)}$}; \node[elem](elem-1-2) at ($(diag-1-2)+(0,4ex)$) {$\scriptstyle F(z)$}; \node[elem](elem-1-3) at ($(diag-1-3)+(-2em,4ex)$) {$\scriptstyle\Id_{F(X')}$}; \draw[draw=none] (elem-1-1) to node [isin] {$\scriptscriptstyle\in$} (diag-1-1); \draw[draw=none] (elem-1-2) to node [isin] {$\scriptscriptstyle\in$} (diag-1-2); \draw[draw=none] (elem-1-3) to node [isin] {$\scriptscriptstyle\in$} (diag-1-3); \node[elem](elem-2-1) at ($(diag-2-1)+(2em,-4ex)$) {$\scriptstyle\eta(X)$}; \node[elem](elem-2-2) at ($(diag-2-2)+(0,-4ex)$) {$\scriptstyle G(F(z))\circ \eta(X) = \eta(X') \circ z$}; \node[elem](elem-2-3) at ($(diag-2-3)+(-2em,-4ex)$) {$\scriptstyle\eta(X')$}; \draw[draw=none] (elem-2-1) to node [isin] {$\scriptscriptstyle\in$} (diag-2-1); \draw[draw=none] (elem-2-2) to node [isin] {$\scriptscriptstyle\in$} (diag-2-2); \draw[draw=none] (elem-2-3) to node [isin] {$\scriptscriptstyle\in$} (diag-2-3); \end{tikzpicture} \end{center} \begin{verbatim} \begin{center} \begin{tikzpicture}[auto, elem/.style={rectangle,draw=black!50,text height=1.5ex,text depth=.5ex}, isin/.style={pos=0.5,auto=false,sloped,allow upside down}] % Le "allow upside down" est essentiel pour ne pas que les signes ∈ se % retrouvent dans le mauvais sens ! \matrix(diag)[matrix of math nodes,column sep=4em,row sep=5ex]{ \Hom(F(X),F(X))&\Hom(F(X),F(X'))&\Hom(F(X'),F(X'))\\ \Hom(X,G(F(X)))&\Hom(X,G(F(X')))&\Hom(X',G(F(X')))\\}; \draw[->] (diag-1-1) -- node[swap]{$\scriptstyle \theta(X,F(X))$} (diag-2-1); \draw[->] (diag-1-2) -- node{$\scriptstyle \theta(X,F(X'))$} (diag-2-2); \draw[->] (diag-1-3) -- node{$\scriptstyle \theta(X',F(X''))$} (diag-2-3); \draw[->] (diag-1-1) -- node{$\scriptstyle F(z)\circ\tiret$} (diag-1-2); \draw[->] (diag-1-3) -- node[swap]{$\scriptstyle \tiret\circ F(z)$} (diag-1-2); \draw[->] (diag-2-1) -- node{$\scriptstyle G(F(z))\circ\tiret$} (diag-2-2); \draw[->] (diag-2-3) -- node[swap]{$\scriptstyle \tiret\circ z$} (diag-2-2); \node[elem](elem-1-1) at ($(diag-1-1)+(2em,4ex)$) {$\scriptstyle\Id_{F(X)}$}; \node[elem](elem-1-2) at ($(diag-1-2)+(0,4ex)$) {$\scriptstyle F(z)$}; \node[elem](elem-1-3) at ($(diag-1-3)+(-2em,4ex)$) {$\scriptstyle\Id_{F(X')}$}; \draw[draw=none] (elem-1-1) to node [isin] {$\scriptscriptstyle\in$} (diag-1-1); \draw[draw=none] (elem-1-2) to node [isin] {$\scriptscriptstyle\in$} (diag-1-2); \draw[draw=none] (elem-1-3) to node [isin] {$\scriptscriptstyle\in$} (diag-1-3); \node[elem](elem-2-1) at ($(diag-2-1)+(2em,-4ex)$) {$\scriptstyle\eta(X)$}; \node[elem](elem-2-2) at ($(diag-2-2)+(0,-4ex)$) {$\scriptstyle G(F(z))\circ \eta(X) = \eta(X') \circ z$}; \node[elem](elem-2-3) at ($(diag-2-3)+(-2em,-4ex)$) {$\scriptstyle\eta(X')$}; \draw[draw=none] (elem-2-1) to node [isin] {$\scriptscriptstyle\in$} (diag-2-1); \draw[draw=none] (elem-2-2) to node [isin] {$\scriptscriptstyle\in$} (diag-2-2); \draw[draw=none] (elem-2-3) to node [isin] {$\scriptscriptstyle\in$} (diag-2-3); \end{tikzpicture} \end{center} \end{verbatim} \ifx\danslelivre\undefined \end{document} \fi