[Tex/LaTex] How to create wide breve accent

accentsmath-modewidth

I am in need of a 'wide breve' accent in math mode that can stretch a little bit like \widetilde and \widehat do. I have tried both suggestions from Display a breve over several letters, but the first one is rather unsatisfactory for several reasons. The second one looks good on the picture, but it does not work well with single letters:

deformed widebreve

For convenience here is the code itself from the original post in the linked thread:

\makeatletter
\def\widebreve#1{\mathop{\vbox{\m@th\ialign{##\crcr\noalign{\kern\p@}%
  \brevefill\crcr\noalign{\kern0.1\p@\nointerlineskip}%
  $\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}

\def\brevefill{$\m@th \setbox\z@\hbox{}%
 \hfill\scalebox{0.7}{\rotatebox[origin=c]{90}{(}} \kern4pt $}
\makeatletter

I would like to have similarly nice wide breve as in this example

Example

that also works for single letters in math mode and is wider than mere \breve{U}. Think of \widetilde{U} or \widehat{U}. I would be happy if anyone knows how to fix it or has a better suggestion. Thanks!

Best Answer

I think that Sabian's code works only for two characters, so here's my attempt to improve it:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}

\makeatletter
\def\widebreve{\mathpalette\wide@breve}
\def\wide@breve#1#2{\sbox\z@{$#1#2$}%
     \mathop{\vbox{\m@th\ialign{##\crcr
\kern0.08em\brevefill#1{0.8\wd\z@}\crcr\noalign{\nointerlineskip}%
                    $\hss#1#2\hss$\crcr}}}\limits}
\def\brevefill#1#2{$\m@th\sbox\tw@{$#1($}%
  \hss\resizebox{#2}{\wd\tw@}{\rotatebox[origin=c]{90}{\upshape(}}\hss$}
\makeatletter

\begin{document}

\begin{tabular}{ccc}
\(\widebreve{ONO}\) & \(A^{\widebreve{ONO}}\) & \(B^{A^{\widebreve{ONO}}}\) \\
\(\widebreve{ON}\)  & \(A^{\widebreve{ON}}\)  & \(B^{A^{\widebreve{ON}}}\) \\
\(\widebreve{U}\)   & \(A^{\widebreve{U}}\)   & \(B^{A^{\widebreve{U}}}\) \\
\end{tabular}

\end{document}

The command works, in principle, with an arbitrary amount of characters. There are a few points, though, that require manual tuning. The line that says

\kern0.08em\brevefill#1{0.8\wd\z@}\crcr\noalign{\nointerlineskip}%

contains two adjustable parameters: \kern0.08em and 0.8\wd\z@. The first is the horizontal space to be inserted to the left of the breve accent to make it look "more centered". The second (0.8) is the relative with of the accent relative to the accented characters.