3

Depending on the combination of packages loaded, the width of \widetilde can be erroneous.

I guess this is a bug in koma, but it as also somehow affected by the package lmodern, albeit only when combined with koma.

I assume I need to find a replacement for lmodern or quit using koma. Is there another remedy?

0. Desired output

\documentclass{article}
% \usepackage{amsmath}  % does not make a difference
% \usepackage{lmodern}  % does not make a difference
\begin{document}
\begin{equation}
\widetilde{c_x'} \widetilde{c_y'}
\end{equation}
\end{document}

desired

1. KOMA without amsmath

\documentclass{scrartcl}
\begin{document}
\begin{equation}
\widetilde{c_x'} \widetilde{c_y'}
\end{equation}
\end{document}

erroneous

2. KOMA with amsmath

\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\widetilde{c_x'} \widetilde{c_y'}
\end{equation}
\end{document}

desired

3. KOMA with lmodern (with or without amsmath)

\documentclass{scrartcl}
% \usepackage{amsmath}  % does not make a difference
\usepackage{lmodern}
\begin{document}
\begin{equation}
\widetilde{c_x'} \widetilde{c_y'}
\end{equation}
\end{document}

erroneous

cabohah
  • 11,455
Bastian
  • 637
  • 2
    The default font size of article is 10pt. The default font size of scrartcl is 11pt. If you use \documentclass[10pt]{scrartcl} you get the same result as with \documentclass{article} (as wanted). And if you use \documentclass[11pt]{article} you get the same result as with \documentclass{scrartcl} (as not wanted). So this does not depend on using a KOMA-Script class or not, but on the font sizes. – cabohah Mar 13 '24 at 08:44
  • Ah I see, font size was the one aspect I did not consider checking. Setting \documentclass[11pt]{article} indeed produces the same weird appearance. \usepackage{amsmath} fixes that, but \usepackage{lmodern} then destroys that fix again. So I guess it is a side effect of lmodern. – Bastian Mar 13 '24 at 09:06

2 Answers2

5

You forgot one option, namely fixcmex.

\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage{lmodern}
\usepackage{fixcmex} % does make a difference

\begin{document}

\begin{equation} \widetilde{c_x'} \widetilde{c_y'} \end{equation}

\end{document}

enter image description here

egreg
  • 1,121,712
4

The difference you see with KOMA-Script only appears because KOMA-Script use 11pt fonts by default, while article uses 10pt. Load the article class with 11pt you'll see the same thing.

\widetilde is a math accent which extends according to its content. In your case, x is slightly larger than y, and the larger form is used with 11pt fonts (it's the same, if you use m as subscript). The simplest you can do is to move the subscripts outside \widehat:

\begin{equation}
  \widetilde{c'}_{\! x} \widetilde{c'}_{\! y}
\end{equation}

widetitle shorter

jlab
  • 1,834
  • 1
  • 13