[Tex/LaTex] There’s a bump in the implies glyph

latin-modernmath-modemathtoolssymbols

Edit:
I understand this question has been marked as a duplicate, but the question I linked to doesn't have a solution for me (unless I'm missing something obvious, which is likely). The effect is quite visible when printed on paper. Can anyone suggest how I can avoid the problem and still use Latin Modern for non-maths text? I'm using pdfLaTeX.

I've run into an issue using the implies glyph. I'm using a Latin Modern typeface, 12pt document. The horizontal lines that make up the arrow have a "bump" in the middle. I found this similar question when trying to figure it out, but the issue persists even after printing.

Possible bug with \implies and \Longrightarrow — there's a dot in the middle of it

To illustrate, here's a picture:

Implies glyph

The issue basically disappears when I use \scriptstyle, but I'd rather not. Any ideas?

\documentclass[12pt]{article}

\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{mathtools} 

\begin{document} 
  $\implies$\par
  $\scriptstyle \implies$   
\end{document}

Best Answer

The problem is this: \Longrigtharrow (over which \implies is defined) is built with two characters that come from different fonts.

The equals sign for lengthening the arrow is taken from \textfont0 (the normal text font), while the arrow (\Rightarrow) is taken from \textfont2 (the math symbol font).

When a current font size is 10pt, lmodern defines \textfont0 as rm-lmr10 (the prefix rm means OT1 encoding) and \textfont2 as lmsy10 and all is good. If the current font size is 11pt, the fonts are rm-lmr10 at 10.95pt and lmsy10 at 10.95pt, which again agree with each other.

The problem is at 12pt: in this case \textfont0 is rm-lmr12, while \textfont2 is lmsy10 at 12pt. Here is where the problem arises: the thickness of the strokes is scaled for \Rightarrow but not with = and the difference is noticeable, particularly at low resolution.

The following image is taken at 4x magnification (\mag=4000) by compiling with pdftex the input

\mag=4000
\font\xy=lmsy10 at 12pt
\font\xz=rm-lmr12
\textfont2=\xy \textfont0=\xz
$\Longrightarrow$
\bye

enter image description here

and the difference cannot be attributed to pixel adjustments of the onscreen previewer.

A possible workaround is to redefine the font used for \textfont0 to use scaled rm-lmr10 when the current font size is above 10pt and using T1 as the default encoding for text fonts.

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\makeatletter
% Load the OT1 definitions for lmodern
\input{ot1lmr.fd}
% Change the definition for \OT1/lmr/m/n/<size>
\DeclareFontShape{OT1}{lmr}{m}{n}%
  {<-5.5>    rm-lmr5  <5.5-6.5> rm-lmr6
   <6.5-7.5> rm-lmr7  <7.5-8.5> rm-lmr8
   <8.5-9.5> rm-lmr9  <9.5->    rm-lmr10
  }{}
\makeatother

\begin{document}
\noindent
$\Longrightarrow$\\
The text font\\
is \expandafter\texttt\expandafter{\fontname\font}
\end{document}

enter image description here

Related Question