[Tex/LaTex] Consistency versus aesthetics with respect to \tilde and \widetilde

math-operatorstypography

I am currently working on a paper which heavily uses \tilde for both lower case letters and capitals in math bold font.

When using \tilde for lower case letters, everything looks perfectly fine, but \tilde{\mathbf{X}} looks a little silly because the symbol is so out of proportion relative to the symbol below it. My solution to this has been to use \widetilde only for capitals instead, but I am concerned about consistency and any personal bias on the aesthetics of tiny tildes over large symbols.

To me, the problem is twofold:

  1. If I use \widetilde, I am essentially using two different symbols, \tilde and \widetilde to mean the same thing.

  2. When \widetilde is used inside a line of text, it disrupts the spacing (in a very minor way) unless I override that behavior. This would also be inconsistent with the way I've written to avoid any disruption of line spacing by things such as using \displaystyle for my in-text limits and summations.

At this time, I think the best solutions are to either just use a tiny tilde for everything; only use \widetilde in the math environment for capitals and \tilde in-text; or suppress the added spacing because most readers will never notice the difference and this is a somewhat pedantic detail anyway (Is messing with “vertical kerning'' a big deal?).

I would appreciate any suggestions.

Best Answer

My recently revised answer at Big tilde in math mode is directly applicable to your problem. I don't change any definitions in moving it from there to here, but in this MWE, I also show how it can be used in text mode, and with \mathbf which was your particular interest. Because it defaults its argument to math mode, one actually surrounds the argument in $ to get it in text mode. It is defined to work across all math styles as well.

\documentclass{article}
\usepackage{scalerel}[2014/03/10]
\usepackage{stackengine}

\newcommand\reallywidetilde[1]{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle#1$}%
  \stackengine{-.1\LMpt}{$\SavedStyle#1$}{%
    \stretchto{\scaleto{\SavedStyle\mkern.2mu\sim}{.5467\wd0}}{.7\ht0}%
%    .2mu is the kern imbalance when clipping white space
%    .5467++++ is \ht/[kerned \wd] aspect ratio for \sim glyph
  }{O}{c}{F}{T}{S}%
}}

\def\test#1{$%
  \reallywidetilde{#1}\,
  \scriptstyle\reallywidetilde{#1}\,
  \scriptscriptstyle\reallywidetilde{#1}
$\par}

\parskip 1ex
\begin{document}

Text mode: \reallywidetilde{$a$} \reallywidetilde{$abcde$} 

Mathbf: \reallywidetilde{\mathbf{X}} \reallywidetilde{\mathbf{XYZ}}

Normal math (different styles):

\test{abcdefghijklm}
\test{abcdefghijk}
\test{abcdefghi}
\test{abcdefg}
\test{abcde}
\test{abc}
\test{ab}
\end{document}

enter image description here