2

When I use the lmodern package (which is always), math accents tilde and bar do not change the character height (w.r.t. \left and \right). However, the hat accent makes the character taller. The file

\documentclass{article}
\usepackage{lmodern}
\begin{document}
\thispagestyle{empty}
$$
\left( \tilde A \right)
\left( \hat A \right)
\left( \bar A \right)
$$
\end{document}

renders as

enter image description here

How can I make the hat accent behave like tilde and bar?

PS. If I don't use lmodern it falls back to Computer Modern and looks like this:

enter image description here

Mankka
  • 645
  • Use manual sizing of brackets with \bigl and the like. – Skillmon Aug 31 '17 at 08:21
  • 2
    Delimiters come in discrete sizes, so, when the material between them exceeds a certain threshold, the next size is employed. It's not that \tilde and \bar do not change the height, it's rather that the threshold is not exceeded. In most cases, \left and \right are not needed and in general fences are not required to cover the entire vertical extension of the material between them. – egreg Aug 31 '17 at 08:41

1 Answers1

2

Delimiters come in discrete sizes, so, when the material between them exceeds a certain threshold, the next size is employed. It's not that \tilde and \bar do not change the height, it's rather that the threshold is not exceeded.

In your examples, \big size is chosen with \tilde and \bar, but \Big size turns up with \hat.

In most cases, \left and \right are not needed and in general fences are not required to cover the entire vertical extension of the material between them. Look at the output of the following example, where also a \rhat (reduced hat) is defined (but not recommended).

\documentclass{article}
\usepackage{amsmath}
\usepackage{lmodern}

\newcommand{\shat}[1]{%
  \smash{\hat{#1}}%
  \vphantom{\bar{#1}}%
}

\begin{document}

No change:
\[
\left( \tilde{A} \right)
\left( \hat{A} \right)
\left( \bar{A} \right)
\]

Change:
\[
\left( \tilde{A} \right)
\left( \shat{A} \right)
\left( \bar{A} \right)
\]

Better:
\[
(\tilde{A})
(\hat{A})
(\bar{A})
\]

\end{document}

In my opinion, the last example is the one to be followed.

Note: $$ should never be used in LaTeX, see Why is \[ ... \] preferable to $$ ... $$?

enter image description here

egreg
  • 1,121,712
  • Thank you! The paired delimiters come from a third macro, so I can not change that. I ended up redefining \hat has \shat. Maybe later... I will smash all accents. :) – Mankka Aug 31 '17 at 10:17