I have the following code:

\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath, amstext,  amssymb, amsfonts, amsthm, euscript}

  TM \ar[r, "{\rm d}f"] \ar[d, "\pi"] & TN \ar[d, "\pi"] \\ M \ar[ur, shift right = .25ex, "{\rm d}f \circ X"]  \ar[ur, shift left = .25ex, "Y \circ f"]  \ar[r, "f"]  \ar[u, bend left = 50, "X"]  & N \ar[u, bend right = 50, "Y"]

which produces:

enter image description here

I know very little of tikz-cd and I can do only simple triangle and square diagrams. I'd like to have:

  • a bigger diagram, with everything more spaced, a bit longer arrows, etc;
  • the two diagonal arrows labeled, being df o X the upper one and Y o f the lower one;
  • the label Y in the rightmost arrow be on the right, and not on the left of it.

I browsed the site a bit looking for a similar diagram but I couldn't find anything. I could only get what's in the image and I don't know how to do it. Can someone help me please? Thanks.

1 Answer 1


You can increase the column sep and row sep; label positions can be swapped from the default placement on the left of the arrow.

You don't need to load amstext (amsmath does it) and amsfonts (amssymb does it).

Also, the {\rm d} syntax has been deprecated for more than twenty years. Using \diff as defined also puts a thin space where appropriate.

\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath, amssymb, amsthm, euscript}



\begin{tikzcd}[column sep=4em,row sep=4em]
  TM \ar[r, "\diff f"] \ar[d, swap, "\pi"] & TN \ar[d, "\pi"] \\
  \ar[ur, shift right = .75ex, swap, "\diff f \circ X"]
  \ar[ur, shift left = .75ex,  "Y \circ f"]  \ar[r, "f"]
  \ar[u, bend left = 50, "X"] &
  N \ar[u, bend right = 50, swap, "Y"]


enter image description here

  • This is perfect, thanks a lot, and for the extra tips too! Just for curiosity, what does that "swap" do?
    – Ivo Terek
    Commented Jul 17, 2016 at 19:33
  • 1
    @IvoTerek With swap you declare that the following label is placed on the right of the arrow (determined like you do with rivers). You can even place two labels, with \arrow[r,"a",swap,"b"].
    – egreg
    Commented Jul 17, 2016 at 19:36

You must log in to answer this question.

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