# Circular arrow in tikz-cd

How do I draw a circular arrow (to indicate commutativity) in tikz-cd, similar to the one in the middle of the following diagram?

(Image from this question.)

Use of PDFlatex or XeLaTeX with $\circlearrowleft$ from amssymbol/amsmath with scalable size.

Code

\documentclass[border=2pt]{standalone}
\usepackage{amssymb,amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{arrows}

\usepackage{tikz}

\begin{document}
%\tikzset{commutative diagrams/.cd, arrow style=tikz,diagrams={>= latex}}

\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}

\end{document}

• > Minimal working example <. I had to spend a few minutes figuring out the exact syntax for naming arrows and also separating the actual solution from the OP-provided code. Feel free to integrate my MWE into your answer, so that the actual solution is more prominent. – ComFreek Apr 12 at 12:34

You can draw an arc using the option -> following the syntax described in the documentation in the Arc Path Reconstruction.

\draw (starting point x, starting point y) arc (starting angle:ending angle:radius);

For instance this code will produce an arrow like the one requested

\documentclass{article}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw[step=1cm,gray!50,very thin] (-1.9,-1.9) grid (5.9,5.9);
\draw[very thick,->] (0,0) -- (4.5,0) node[anchor=north west] {\bf{x axis}};
\draw[very thick,->] (0,0) -- (0,4.5) node[anchor=south east] {\bf{y axis}};
\foreach \x in {0,1,2,3,4}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north] {$\mathbf{\x}$};
\foreach \y in {0,1,2,3,4}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east] {$\mathbf{\y}$};
\draw[thick, ->] (3,2) arc (0:270:1cm);% syntax (starting point coordinates) arc (starting angle:ending angle:radius)
\end{tikzpicture}
\end{document}


• At least an explanation of how to include this into tikz-cd would be great. – Manuel Jul 9 '14 at 8:42

If you are willing to use Lua- or XeLaTeX:

% arara: lualatex

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

\begin{document}
\begin{tikzcd}[row sep=5pt, column sep=5pt]
\overbar{A} \arrow[swap, "\overbar{F}_q"]{dd} &  &  \overbar{A}_E
\arrow["\overbar{F}_{q,E}"]{dd} \arrow[swap, "\pi^\ast"]{ll}  \\
& \cwopencirclearrow & \\
\overbar{A} & &  \overbar{A}_E \arrow["\pi^\ast"]{ll}
\end{tikzcd}
\end{document}


\documentclass{standalone}
\usepackage{amssymb,amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{arrows}

\usepackage{tikz}

\begin{document}

\begin{tikzcd}
% The syntax for naming arrows is as follows
%     \arrow[...options...]{...direction(s)...}[name=...name...]{...label...}
% If you want no label:
%     \arrow[...options...]{...direction(s)...}[name=...name...]{}
A \arrow[]{d}{a-c} \arrow[]{r}[name=a-b]{a-b} & B \arrow[]{d}{b-d}\\
C \arrow[]{r}[name=c-d]{c-d} & D
\arrow[to path={(c-d) node[midway,scale=1] {$\circlearrowleft$} (a-b)}]{}
\end{tikzcd}

\end{document}


a variation of accepted answer (+1):

\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta, bending}
\tikzset{C/.style={circle, minimum size=8mm,
node contents={},
append after command={\pgfextra{%
\draw[-{Straight Barb[flex']}](\tikzlastnode.150) arc (150:450:4mm);}
}}
}

\begin{document}
\begin{tikzcd}[sep=12mm,
arrow style=tikz,
arrows=semithick,
diagrams={>={Straight Barb}}
]
\bar{A}_E \dar["\bar{F}_q" ']
& \bar{A}_E \dar["\bar{F}_{q,E}"]
\lar["\pi^\star" ',""name=U]      \\
\bar{A} & \bar{A}_E \lar["\pi^\star"  ,""name=D]
\ar[to path={(U) node[pos=.5,C] (D)}]{}
\end{tikzcd}
\end{document}


differences: common style for arrows, used shorter (alternative) syntax for \arrows`, different way for defining arrows names, defined TikZ picture for inner circled arrow.