# \widehat in text mode in Plain (Xe)TeX?

Is there a way to emulate the behaviour of \widehat in text mode in Plain (Xe)TeX? That is, take a single accent1 and “stretch” it over two or more letters. I need it in text mode, because it's not for a mathematical formula.

I tried doing the same thing that \t does, but that didn't work, because (as I realized in the process) the tie-after is a character of its own, and it doesn't really stretch.

1 a circumflex for my current task, but I would be thankful to know if there is a more general mechanism.

• The simplest would be \def\twidehat#1{$\widehat{\hbox{#1}}$} (you lose kerning information, but this always happens also with \accent). Jun 13, 2022 at 6:39

## 1 Answer

You can use \widehat. This would work without problems with upright fonts, but some tweaking based on the font slant should be needed for slanted ones.

\catcode@=11
\def\twidehat#1{$\m@th\widehat{\hbox{#1}}$}
\catcode@=12

A\twidehat{c}cent

A\twidehat{cc}ent

A\twidehat{cce}nt

A\twidehat{ccen}t

{\it A\twidehat{cc}ent}

\bye


• Depending on the purpose of the macro, it could make sense to \smash it or at least do something in order not to create uneven line spacing. Jun 13, 2022 at 9:16