[Tex/LaTex] Equation with a loop arrow (see picture)

arrowsequations

How can I typeset this equation:

enter image description here

Best Answer

Since this seems to be a commutative diagram, you should use a dedicated tools for those kind of diagrams such as tikz-cd. Since the package already offers you the required elements, the code now is a one-liner:

\documentclass{standalone}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}[column sep=small]
S\ar[r] & K\ar[r]\ar[loop,"D",swap,looseness=4] & S
\end{tikzcd}
\end{document}

enter image description here

Related Question