27

For years, I've been using a hobbled together command to get the arc notation as used in the textbooks adopted by high schools in my area. I'm not really all that pleased with the result: it's just barely tolerable. I figured someone in the community here might have a better solution to what I've been getting by with for several years.

\documentclass{article}
\usepackage{amsmath,amssymb}
%% my poor man's solution to arc notation
\newcommand{\tarc}{\mbox{\large$\frown$}}
\newcommand{\arc}[1]{\stackrel{\tarc}{#1}}
%%
\pagestyle{empty}
\begin{document}

\begin{align*}
    \arc{AC} \\
    \arc{BAD}\\
    \arc{ICK}
\end{align*}


\end{document}

enter image description here

A.Ellett
  • 50,533

3 Answers3

23

tipa's \texttoptiebar looks useable:

enter image description here

\documentclass{article}
\usepackage{graphicx,tipa}% http://ctan.org/pkg/{graphicx,tipa}
\newcommand{\arc}[1]{{%
  \setbox9=\hbox{#1}%
  \ooalign{\resizebox{\wd9}{\height}{\texttoptiebar{\phantom{A}}}\cr#1}}}
\begin{document}
\arc{AC}\ \arc{BAD}\ \arc{ICK}\ \arc{GOOD}
\end{document}
Werner
  • 603,163
  • This is my preferred solution, however note that the command \arc is already part of other packages such as "unitsdefs", "eepic", "pict2e". I suggest using \ark instead. – c05772 Jun 25 '15 at 19:23
  • There are so many errors here! Box 9 should be assigned globally (or box 8) should be used; \ooalign *must* be enclosed in a group. The text is not in math mode as required in the question. – egreg Dec 26 '15 at 20:39
22

A solution along the lines of Werner's, but that avoids its shortcomings, first of all the dependency on tipa:

\documentclass{article}
\usepackage{graphicx}

\makeatletter
\DeclareFontFamily{U}{tipa}{}
\DeclareFontShape{U}{tipa}{m}{n}{<->tipa10}{}
\newcommand{\arc@char}{{\usefont{U}{tipa}{m}{n}\symbol{62}}}%

\newcommand{\arc}[1]{\mathpalette\arc@arc{#1}}

\newcommand{\arc@arc}[2]{%
  \sbox0{$\m@th#1#2$}%
  \vbox{
    \hbox{\resizebox{\wd0}{\height}{\arc@char}}
    \nointerlineskip
    \box0
  }%
}
\makeatother

\begin{document}

$\arc{AC}$ $\arc{BAD}$ $\arc{ICK}$ $\arc{GOOD}_{\arc{xyz}}$

\end{document}

enter image description here

A different solution with the yhmath font:

\documentclass{article}

\DeclareFontFamily{OMX}{yhex}{}
\DeclareFontShape{OMX}{yhex}{m}{n}{<->yhcmex10}{}
\DeclareSymbolFont{yhlargesymbols}{OMX}{yhex}{m}{n}
\DeclareMathAccent{\wideparen}{\mathord}{yhlargesymbols}{"F3}

\begin{document}

$\wideparen{AC}$ $\wideparen{BAD}$ $\wideparen{ICK}$ $\wideparen{GOOD}_{\wideparen{xyz}}$

\end{document}

enter image description here

egreg
  • 1,121,712
3

I know this is an old question, but I thought I add my version. The reason I do this is because I am using KaTeX to develop for the web, so importing special packages is not possible. The following is a modification of the code in the original question. It does not use extra packages, it moves the arc closer to the text. An optional argument can be used for horizontal positioning of the arc. I know it is not ideal, but as I said, in KaTeX it is not an option to load extra packages.

\documentclass{article}
\usepackage{amsmath,amssymb}
%% modified solution to arc notation
\newcommand{\tarc}{\mbox{\large$\frown$}}
\newcommand{\arc}[2][-3ex]{{#2}{\kern #1{\raisebox{1.5ex}{\tarc}}}}
%%
\pagestyle{empty}
\begin{document}
\begin{align*}
&\arc{AC} \\
&\arc[-4ex]{BAD}\\
&\arc[-4ex]{ICK}
\end{align*}
\end{document}

enter image description here