I tried to draw a commutative diagram of this form:

enter image description here

The code and link to it on https://tikzcd.yichuanshen.de/ are these one:

\begin{tikzcd} u_i \arrow["?"', loop, distance=2em, in=125, out=55] \arrow[rr, "{(g^{-1}u_i,g^{-1})}", bend left, shift left] & & g^{-1}u_ig \arrow[ll, "{(u_i g,g)}", bend left] \arrow["{(u,v)}"', loop, distance=2em, in=125, out=55] \end{tikzcd}

However, when I plug this code into Overleaf, it produces this picture with arrow labels shifted:

enter image description here

What am I doing wrong?

  • Hi and welcome. Please give a fully compilable code.
    – AndréC
    Aug 15, 2020 at 19:58
  • Please change the title of your question as it is called labels and not "names" and make it clear that it is about placing labels in the middle. This will allow search engines to index your question well and those who will have the same problem to find a solution. Say for example "How to center the labels on the arrows on Tikz-cd" or any other formulation (sorry I'm not English speaking, so I don't express myself very well). Translated with www.DeepL.com/Translator (free version)
    – AndréC
    Aug 15, 2020 at 20:50

1 Answer 1


I've marked the changes with %<-- in the code.


\documentclass[tikz, border=5mm]{standalone}

\begin{tikzcd} u_i 
\arrow["?"', loop, distance=2em, in=125, out=55]
\arrow[rr, "{(g^{-1}u_i,g^{-1})}"{anchor=south},% <-- add anchor
 bend left] &  & 
\arrow[ll, "{(u_i g,g)}"{anchor=north},% <-- add anchor
 bend left] 
\arrow["{(u,v)}"', loop, distance=2em, in=125, out=55] 
  • Wow, thank you very much! (Sorry for my code style, it was produced by that site)
    – aa_bb
    Aug 15, 2020 at 20:18
  • No problem, the TikZ manual has more than 1300 pages, so it is difficult to read it completely. AND tikz-cd includes the options of Tikz, so knowing TikZ helps to understand its variations.
    – AndréC
    Aug 15, 2020 at 20:21
  • My compliments for your 20k of reputation.
    – Sebastiano
    Aug 15, 2020 at 20:35
  • 1
    @Sebastiano Thank you. Only 60 points left and you're up to 30,000!
    – AndréC
    Aug 15, 2020 at 20:43
  • @AndréC Really 29,940 ahahhah. But for me not is important the votes..For me, friendship, respect, cooperation, sincerity and mutual help are important to make this world a little better.
    – Sebastiano
    Aug 15, 2020 at 21:09

You must log in to answer this question.

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