6

Starting from

\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A \arrow[r, "\alpha"]   & B
\end{tikzcd}
\end{document}

enter image description here

reading the guide of tikz-cd I found no reference on how to insert two labels above and below on the same arrow. How can this be resolved?

1
  • 2
    Add a ' after the second label: A \arrow[r, "\alpha", "\beta"'] & B (I think). Commented Mar 4, 2019 at 16:35

1 Answer 1

10

Add a single quote (') after the label to move it to the other side of the arrow:

\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}%              V
A \arrow[r, "\alpha", "\beta"'] & B
\end{tikzcd}
\end{document}

At the bottom of page 2 of the manual there is a remark about that:

Arrows can have an arbitrary number of labels, by repeated use of arguments in quotes. The example below shows how to control the positioning of labels. Notice in particular that an apostrophe as <code>〈label option〉</code> causes the label to be placed on the opposite side of the arrow.

5
  • I have not see absolutely :-(. I am without eyes :-(. How you have done the up/down arrow and V in the your code (see comment)?
    – Sebastiano
    Commented Mar 4, 2019 at 16:41
  • 1
    @Sebastiano It happens. It's a rather stealthy sentence :) About the down arrow () you asked, in my computer (Ubuntu) I use AltGr+U. (AltGr+Y=; AltGr+U=; AltGr+I=; AltGr+Shift+U=) Commented Mar 4, 2019 at 16:44
  • And for Windows :-)? I will find it :-)?
    – Sebastiano
    Commented Mar 4, 2019 at 16:47
  • 1
    @Sebastiano No idea. According to this page you can use Alt codes: ALT+8592=; ALT+8595=; ALT+8594=; ALT+8593=. As far as I can remember you hold Alt and type the corresponding number, then release Alt. I'm not sure, though. Commented Mar 4, 2019 at 16:50
  • Your comment has been original. Many compliments.
    – Sebastiano
    Commented Mar 4, 2019 at 16:51

You must log in to answer this question.

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