1

I want to make a notation for a cycle ABC. Currently I'm using regular arrows over and underneath like in this example:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\cycle}[1]{ \underleftarrow{\overrightarrow{#1}} }

\begin{document} Using the cycle $\cycle{ABC}$. \end{document}

Output of my current code

Is it possible to make the arrows slightly curved, like this crudely drawn example: enter image description here

Vahiel
  • 61

1 Answers1

2

I found a solution based on this: Make \curvearrowright longer. I adapted it to both an arrow above and below the word.

\documentclass{article}

\usepackage{tikz} \usetikzlibrary{tikzmark}

\newcounter{cycle} \newcommand{\cycle}[1]{\stepcounter{cycle}\tikzset{tikzmark prefix=\thecycle}\tikzmark{start}#1\tikzmark{stop}\tikz[remember picture, overlay]{ % over arrow \draw[->]([shift={(.5ex,2ex)}]pic cs:start) to[bend left=10] ([shift={(-.5ex,2ex)}]pic cs:stop); % under arrow \draw[->]([shift={(-.5ex,-.5ex)}]pic cs:stop) to[bend left=10] ([shift={(.5ex,-.5ex)}]pic cs:start)}}

\begin{document} Using the cycle \cycle{ABC} \end{document}

This gives output: enter image description here

Within a block of text, this looks as follows: enter image description here

Vahiel
  • 61