I am interested in trying to code the diagram as shown in the attached picture.

enter image description here

So far, I can only code something like this:


S_0 \overset{2\alpha}{\underset{\beta}{\leftrightarrows}} S_1 \overset{\alpha}{\underset{2\beta}{\leftrightarrows}} S_2,


How do I get the vertical double arrows so that I can construct this diagram?


  • 1
    with tikz-cd package?
    – Zarko
    Commented Mar 1, 2020 at 20:03
  • 1
    Probably you could make use of the tikz-cd package.
    – leandriis
    Commented Mar 1, 2020 at 20:03

3 Answers 3


To first approximation

S_{00}\arrow[r,shift left=2pt,"2\alpha"] \arrow[d,shift left=2pt,"\gamma"] 
& |[blue]| \arrow[l,shift left=2pt,"\beta"] \arrow[d,shift left=2pt,"\gamma"] 
S_{10} \arrow[r,shift left=2pt,"\alpha"]
& |[red]| \arrow[l,shift left=2pt,"2\beta"]  S_{20} \arrow[d,shift left=2pt,"\gamma"] \\
S_{01}\arrow[r,shift left=2pt,"\alpha"] \arrow[u,shift left=2pt,"\delta"] 
& |[blue]| \arrow[l,shift left=2pt,"\beta"]  S_{11} 
    \arrow[r,shift left=2pt,"\alpha"] \arrow[u,shift left=2pt,"\delta"]
& |[red]|  \arrow[l,shift left=2pt,"2\beta"]  S_{21} \arrow[u,shift left=2pt,"\delta"] \\

enter image description here

You can simplify things a bit using styles.

\[\begin{tikzcd}[column sep=large,every arrow/.append style={shift left=2pt}]
S_{00}\arrow[r,"2\alpha"] \arrow[d,"\gamma"] 
& |[blue]| \arrow[l,"\beta"] \arrow[d,"\gamma"] 
S_{10} \arrow[r,"\alpha"]
& |[red]| \arrow[l,"2\beta"]  S_{20} \arrow[d,"\gamma"] \\
S_{01}\arrow[r,"\alpha"] \arrow[u,"\delta"] 
& |[blue]| \arrow[l,"\beta"]  S_{11} 
    \arrow[r,"\alpha"] \arrow[u,"\delta"]
& |[red]|  \arrow[l,"2\beta"]  S_{21} \arrow[u,"\delta"] \\

enter image description here

Of course it is a bit boring to add the column and row indices by hand, so let's let TikZ take care of that.

\[\begin{tikzcd}[column sep=large,every arrow/.append style={shift left=2pt},
    /tikz/cells={nodes={execute at begin node=S_{\the\numexpr\pgfmatrixcurrentcolumn-1\relax\the\numexpr\pgfmatrixcurrentrow-1\relax}}},
    /tikz/column 2/.style={blue},/tikz/column 3/.style={red}]
\arrow[r,"2\alpha"] \arrow[d,"\gamma"] 
& \arrow[l,"\beta"] \arrow[d,"\gamma"] 
& \arrow[l,"2\beta"]   \arrow[d,"\gamma"] \\
\arrow[r,"\alpha"] \arrow[u,"\delta"] 
& \arrow[l,"\beta"]   
    \arrow[r,"\alpha"] \arrow[u,"\delta"]
&  \arrow[l,"2\beta"]   \arrow[u,"\delta"] \\

enter image description here

  • Thank-you very much!
    – Sas
    Commented Mar 1, 2020 at 20:08

You also can build such a diagram with the psmatrix environment:



\[ \psset{arrows=->, arrowinset=0.1, linewidth=0.5pt, nodesep=3pt, labelsep=2pt,shortput=nab}%
 S_{00} & {\color{blue}S_{10}} &{\color{red}S_{20}} \\
 S_{01} & {\color{blue}S_{11}} & {\color{red}S_{21}}
 %%% horizontal arrows
 \psset{offset =0.5ex, nodesep=2pt}
 \ncline{1,1}{1,2}^{2\alpha} \ncline{1,2}{1,3}^{\alpha}
 \ncline{1,2}{1,1}_{\beta} \ncline{1,3}{1,2}_{2\beta}
 \ncline{2,1}{2,2}^{\alpha} \ncline{2,2}{2,3}^{\alpha}
 \ncline{2,2}{2,1}_{\beta} \ncline{2,3}{2,2}_{2\beta}
 %%% vertical arrows
 \foreach \i in{1,2,3}{\ncline{1,\i}{2,\i}<{\gamma} \ncline{2,\i}{1,\i}>{\delta}}


enter image description here


The xypic package is also good at this sort of diagram.

enter image description here

               S_{00} \ar @<-2pt> [d]_{\gamma} \ar @<2pt> [r]^{2\alpha} 
& \color{blue} S_{10} \ar @<-2pt> [d]_{\gamma} \ar @<2pt> [r]^{\alpha} \ar @<2pt> [l]^{\beta} 
& \color{red}  S_{20} \ar @<-2pt> [d]_{\gamma}                         \ar @<2pt> [l]^{2\beta} 
               S_{01} \ar @<-2pt> [u]_{\delta} \ar @<2pt> [r]^{2\alpha} 
& \color{blue} S_{11} \ar @<-2pt> [u]_{\delta} \ar @<2pt> [r]^{\alpha} \ar @<2pt> [l]^{\beta} 
& \color{red}  S_{21} \ar @<-2pt> [u]_{\delta}                         \ar @<2pt> [l]^{2\beta} 


  • on \xymatrix the optional @C=1in sets the column spacing to 1 inch ...
  • ... and @R=0.5in sets the row spacing to 0.5 inch
  • cells are separated by & and \\ just like a tabular or an array
  • each arrow is drawn by an \ar command with three modifers
    • @... affects the exact position of the arrow, in this case <dimen> moves the arrow sideways. You could also try @/_/ or @/^/ to make it bend a bit.
    • [..] determines where the arrow goes to, so [d] means one cell downwards, [r] one cell right, and so on.
    • ^{....} or _{....} adds a label on the left or right of the arrow.
  • Spaces are usually optional, I've used them here to line things up neatly.

There are many more controls explained in the excellent manual: texdoc xy

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .