4

When I use the arc symbol in LaTeX, I use this piece of code (adding to the preamble):

\usepackage{scalerel}
\usepackage{stackengine}
\stackMath
\newsavebox\tmpbox
\newcommand\reallywidefrown[1]{
    \ThisStyle{
        \sbox\tmpbox{$\SavedStyle#1$}
        \stackon[0pt]{\usebox{\tmpbox}}{
            \stretchto{
                \scaleto{
                    \scalerel*[\wd\tmpbox]{\mkern-.8mu\frown\mkern-.8mu}
                    {\rule[-\textheight/2]{1ex}{\textheight}}
                }{\textheight}
            }{0.8ex}
        }
    }
}

(Source: Steven B. Segletes' answer)

It outputs a very good arc symbol:

\documentclass{article}
\usepackage{scalerel}
\usepackage{stackengine}
\stackMath
\newsavebox\tmpbox
\newcommand\reallywidefrown[1]{
    \ThisStyle{
        \sbox\tmpbox{$\SavedStyle#1$}
        \stackon[0pt]{\usebox{\tmpbox}}{
            \stretchto{
                \scaleto{
                    \scalerel*[\wd\tmpbox]{\mkern-.8mu\frown\mkern-.8mu}
                    {\rule[-\textheight/2]{1ex}{\textheight}}
                }{\textheight}
            }{0.8ex}
        }
    }
}
\begin{document}
$\reallywidefrown{AB}$\qquad$\reallywidefrown{ABC}$
\end{document}

enter image description here


Now I am typing a document which is about trigonometry, and the trigonometric arc symbol should look like this

enter image description here

(I use Windows Paint. Sorry for bad quality, but I can't find a better way to illustrate the symbol)

I went to Detexify to get the command \curvearrowright in the amssymb package. However, it looks too short:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
$\overset{\curvearrowright}{AB}$\qquad$\overset{\curvearrowright}{ABC}$
\end{document}

enter image description here

Is there any way to define a command like \reallywidecurvearrowright{} (or shorter like \trigarc{} 😃) so that the length of the symbol suits the length of the letters below it, like what Segletes' \reallywidefrown{} does?

Actually the task would be much easier to me if I understand what Segletes wrote, but unfortunately I understand nothing ☹️ So I will thank you very much if you show me a brief explaination of the \reallywidefrown{} definition.

Any help will be highly appreciated!

1 Answer 1

3

You could use the tikzmark toy for this:

enter image description here

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{tikzmark}

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

\begin{document}
\( \carrowover{ABC} \)

\( \carrowover[1.5ex]{abc} \)
\end{document}

Note you need to compile twice to get the correct placement. I have provide an optional argument to \carrowover that specifies the vertical position of the arrow (relative to the baseline).

tikzmark works by saving positions and that can be used in a subsequent tikz picture. To specify unique names for these positions I have introduced a counter and used the tikzmark prefix option to adjust the labels each time.

1
  • 1
    Thank you. I think stretching the \curvearrowright symbol would give poor results. Commented Nov 28, 2018 at 12:34

You must log in to answer this question.