# How can I fix the label locations on my tikzcd diagram?

by Abe Schulte   Last Updated May 15, 2019 17:23 PM

I am having trouble with the label locations on my commutative diagram.

Here is my code:

\documentclass{article}

\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}[ampersand replacement = \&]
0 \arrow[r, "N\lambda", bend left] \& 1 \arrow[r, "(N - 1)\lambda", bend left] \arrow[l, "\lambda", bend left] \& 2 \arrow[r, "(N - 2)\lambda", bend left] \arrow[l, "2\lambda", bend left] \& \cdots \arrow[r, "2\lambda", bend left] \arrow[l, "3\lambda", bend left] \& N-1 \arrow[r, "\lambda", bend left] \arrow[l, "(N-1)\lambda", bend left] \& N \arrow[l, "N\lambda", bend left]
\end{tikzcd}

\begin{tikzcd}[ampersand replacement = \&]
0 \arrow[r, "N\lambda", bend left] \& 1 \arrow[r, "(N - 1)\lambda", bend left] \arrow[l, "\lambda", bend left] \& 2 \arrow[r, "(N - 2)\lambda", bend left] \arrow[l, "2\lambda", bend left] \& 3 \arrow[r, "2\lambda", bend left] \arrow[l, "3\lambda", bend left] \& 4 \arrow[r, "\lambda", bend left] \arrow[l, "(N-1)\lambda", bend left] \& 5 \arrow[l, "N\lambda", bend left]
\end{tikzcd}

\end{document}


which produces

I would like the arrow labels to appear "centered" on the arrows, as they are in the second diagram, but with the node labels from the first diagram. How can I fix this?

Note: I have already looked at the question here and know that I could probably manually correct the spacing on every single label, but that seems way more tedious than should be necessary given that I'm pretty sure the labels should be centered on the arrows by default.

Tags :