# Tikz diagram - Tag on vertical arrow

Consider the following code for a commutative diagram

\begin{tikzcd}[column sep=50pt]
A \arrow[swap]{d}{\text{example}}\arrow{r} & B \arrow[leftarrow]{dl}\\
C
\end{tikzcd}


The tag "example" appears on the left hand side of the down arrow. I would like the tag "example" to be written "on the arrow" (as if it were an horizontal arrow, if it makes sense). How can I achieve this?

Edit: in other words, I would like to rotate left the text "example" so that it is parallel to the down arrow.

• As usual I have not understood your question. :-) Don't worry :) My best regards. – Sebastiano Apr 1 '19 at 19:01

You could place the label of the arrow in a \rotatebox:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}[column sep=50pt]
A \arrow[swap]{d}{\hspace*{-0.7cm}\rotatebox{90}{test}}\arrow{r} & B \arrow[leftarrow]{dl}\\
C
\end{tikzcd}
\end{document}


For longer texts:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}[column sep=50pt,row sep=6em]
A \arrow[swap]{d}{\hspace*{-0.4cm}\rotatebox{90}{longer text}}\arrow{r} & B \arrow[leftarrow]{dl}\\
C
\end{tikzcd}
\end{document}


As @marmot helpfully pointed out, there is an even simpler approach:

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsmath}

\begin{document}
\begin{tikzcd}[column sep=50pt]
A \arrow[swap,"\text{test}" {rotate=90,above}]{d}\arrow{r} & B \arrow[leftarrow]{dl}\\
C
\end{tikzcd}

\begin{tikzcd}[column sep=50pt,row sep=5em]
A \arrow[swap,"\text{longer text}" {rotate=90,above}]{d}\arrow{r} & B \arrow[leftarrow]{dl}\\
C
\end{tikzcd}
\end{document}


• The user wants a tag. Maybe replace longer text by Samstag? ;-) – user121799 Apr 1 '19 at 20:32
• @marmot I think "Murmeltiertag" would be better :) – samcarter_is_at_topanswers.xyz Apr 1 '19 at 20:36