1

I am adapting the diagram in this answer for my needs

I need to add two other elements and a line on top of this diagram - think the argument of the function and its image, linked by a straight line, all properly aligned, but without changing at all the structure (elements and arrows) that's already there. What's the easiest way to do so? The code at the link in question is

\begin{tikzcd}[row sep=2cm,column sep=2cm,inner sep=1ex]
\bar A  \arrow[thick,swap] {d}{\bar F_q}
&
\bar A_E   \arrow[thick,swap]{l}[name=U]{\pi^\star}
\arrow[thick]{d}{\bar F_{q,E}}
\\
\bar A     & \bar A_E     \arrow[thick]{l}[name=D]{\pi^\star}  
\arrow[to path={(U) node[midway,scale=3] {$\circlearrowleft$}  (D)}]{}
\end{tikzcd}

If I simply add a two items and an arrow on top, with a line like

A \arrow {r}  & B \\ 

I break the structure of the diagram, in the sense that the circular arrow will move to the middle and the items will be added at the same vertical distance as the lines below it, which is way too much. I need these new items to be right on top.

Here is a picture of what I actually need. All the arrows are supposed to be the same, any difference in the image is due to inability to draw.

enter image description here

5
  • Please show us, what you try so far. At least a sketch, what you like to add diagrams in link.
    – Zarko
    Mar 19, 2023 at 18:25
  • I edited to add more details @Zarko
    – Karl
    Mar 19, 2023 at 18:37
  • 1
    One sketch tell more than thousand words. BTW, please extend your code fragment to an MWE!
    – Zarko
    Mar 19, 2023 at 18:48
  • I did it @Zarko
    – Karl
    Mar 19, 2023 at 19:15
  • Now you already have an answer :-)
    – Zarko
    Mar 19, 2023 at 19:26

1 Answer 1

1

The problem is that the linked answer works by accident. midway only has a meaning if it is in a path. In the linked answer, no path is given, and the circled arrow just gets placed at the origin of the diagram/tikzpicture, which is accidentally correct. To correct this, one needs to add a path and make the auxiliary arrow invisible (via phantom):

\arrow[phantom,to path={(U) -- node[midway,scale=3] {$\circlearrowleft$}  (D)}]{}

Compared to the linked answer, this has -- after (U) to really get a path in which midway is meaningful, and phantom.

\documentclass{article}
\usepackage{amssymb}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[row sep=2cm,column sep=2cm,inner sep=1ex]
    A \arrow {r}  & B \\ 
    \bar A  \arrow[thick,swap] {d}{\bar F_q}
    &
    \bar A_E   \arrow[thick,swap]{l}[name=U]{\pi^\star}
    \arrow[thick]{d}{\bar F_{q,E}}
    \\
    \bar A     & \bar A_E     \arrow[thick]{l}[name=D]{\pi^\star}  
    \arrow[phantom,to path={(U) -- node[midway,scale=3] {$\circlearrowleft$}  (D)}]{}
    \end{tikzcd}
\end{document}

enter image description here

It might be worth mentioning that one does not need to rely on rescaled AMS symbols, rather one can draw the circular arrow with tikz. That way one does not have to make the other arrows thick to make them similar to the circular arrow.

\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzcd}[row sep=2cm,column sep=2cm,inner sep=1ex,
    execute at end picture={\draw[->] ($($(U)!0.5!(D)$)+(100:0.8)$) arc[start angle=100,end angle=440,radius=0.8];}]
    A \arrow {r}  & B \\[-5em] 
    \bar A  \arrow[swap] {d}{\bar F_q}
    &
    \bar A_E   \arrow[swap]{l}[name=U]{\pi^\star}
    \arrow{d}{\bar F_{q,E}}
    \\
    \bar A     & \bar A_E     \arrow{l}[name=D]{\pi^\star}  
    \end{tikzcd}
\end{document}

enter image description here

2
  • Thanks a lot. How would I go about adding the set inclusions at the bottom? (see my drawing)
    – Karl
    Mar 19, 2023 at 20:30
  • @Karl There are various options. Either get those inclusions via phantom arrows, or use \subnodes from the tikzmark library. However, in order to have focus of this thread to be on the bug you found in the linked answer, I'd like to suggest that you post a separate question.
    – user293154
    Mar 19, 2023 at 22:18

You must log in to answer this question.

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