Is there a good-looking way to produce an overbrace for a single letter? The overbrace produced by
\[
\overbrace{P}^{some annotation}
\]
is too wide for the single letter P
. Note that the focus really lies upon the annotation, the reader has already seen the unannotated term and now gets to see an example which formal annotations are inserted where in the term.
Here is a simplified example from my sources. The overbraced P
does not look good.
\documentclass{minimal}
\usepackage{proof}
\usepackage{mathtools}
\newcommand{\hoare}[3]{\{#1\}\;#2\;\{#3\}}
\newcommand{\ctxt}[3]{C:\langle#1,#2,#3\rangle}
\begin{document}
\begin{equation*}
\infer[Rule]
{\underbrace{\hoare P c Q}_{\ctxt{i}{x \cdot \mathrm{xs}}{o_2}}}
{ \overbrace{\hoare{P'}{c'}{Q'}}^{\ctxt{i+1}{\mathrm{xs}}{o_1}}
& R \implies \overbrace{P}^{\mathclap{\ctxt{o_1}{\text{a bit longer}}{o_2}}}
}
\end{equation*}
\end{document}
\[ P = U I , \] where $P$ denoted the effective power.
denotes
)\overbracket
frommathtools
generally looks better. It has two optional arguments; linewidth and bracket height.overbracket
looks strange if the annotation is much longer then the bracket. I think it is missing a tip, like the middle element of an overbrace.