17

I have noticed that the sizes of delimiters change when I switch from Computer Modern to Latin Modern. In 12pt font size documents, this causes inline math with \bigl( to be too large to fit, and expands the vertical space taken by that line. This was not a problem with Computer Modern. Is this a bug?

\documentclass[12pt]{article}

\usepackage{lmodern}
\usepackage{amsmath}

\begin{document}
An equivalence class~$[a]_{\sim} \in A / {\sim}$ consists of all the elements
in $A$ that are mapped to $b = f(a)$. By the axiom of choice, there exists a
choice function~$c \colon A / {\sim} \to A$ which selects a representative
element of each equivalence class. There exists a
function~$h \colon B \to A / {\sim}$, so that
$h(b) = h\bigl(f(a)\bigr) = [a]_{\sim}$. This allows us to construct the
function~$g = c \circ h$, which is in fact a right-inverse of $f$.
\[
    \Biggl(\biggl(\Bigl(\bigl((X)\bigr)\Bigr)\biggr)\Biggr)
\]
\end{document}

Computer Modern: Computer Modern

Latin Modern: Latin Modern

There is a gap above the fourth line in the Latin Modern case, which is not there in the Computer Modern case.


Edit:

This post by egreg tackles the same problem.

  • I don't know if this is a bug, but a work-around consists in adding\linespread{1.1} to your preamble. – Bernard Nov 15 '16 at 12:42
  • 3
    I can confirm that this inconsistency occurs if the main document font size is either 12pt or 11pt; interestingly, it is absent if the font size is 10pt. – Mico Nov 15 '16 at 13:06
  • @egreg I added a link to a solution you wrote three years ago, which I think solves the problem. – Håkon Marthinsen Nov 15 '16 at 15:30
18

For historical reasons a fixed size is used for the scalable delimiters, even for cm that's not clearly a good idea (see exscale package), but here it's not good at all, if you use the font at its natural scaled size then....

enter image description here

\documentclass[12pt]{article}

\DeclareFontFamily{OMX}{lmex}{}
\DeclareFontShape{OMX}{lmex}{m}{n}{%
   <->lmex10%
   }{}
\usepackage{lmodern}
\usepackage{amsmath}

\begin{document}



\show\big
\showthe\baselineskip
\setbox0\hbox{$\big($}\showthe\dimexpr\ht0+\dp0
\showoutput
\showbox0

An equivalence class~$[a]_{\sim} \in A / {\sim}$ consists of all the elements
in $A$ that are mapped to $b = f(a)$. By the axiom of choice, there exists a
choice function~$c \colon A / {\sim} \to A$ which selects a representative
element of each equivalence class. There exists a
function~$h \colon B \to A / {\sim}$, so that
$h(b) = h\bigl(f(a)\bigr) = [a]_{\sim}$. This allows us to construct the
function~$g = c \circ h$, which is in fact a right-inverse of $f$.
\[
    \Biggl(\biggl(\Bigl(\bigl((X)\bigr)\Bigr)\biggr)\Biggr)
\]
\end{document}

Now the size is shown as

> 14.5pt.
l.17 \showthe\baselineskip

? 

> 14.40013pt.

with \big just less than \baselineskip


You can redefine the \big size keeping it within \baselineskip and so avoid \lineskip glue being used within the paragraph.

\documentclass[12pt]{article}

\usepackage{lmodern}
\usepackage{amsmath}

\begin{document}


\makeatletter
\renewcommand{\big}{\bBigg@{0.92}}
\makeatother
\show\big
\showthe\baselineskip
\setbox0\hbox{$\big($}\showthe\dimexpr\ht0+\dp0
\showoutput

An equivalence class~$[a]_{\sim} \in A / {\sim}$ consists of all the elements
in $A$ that are mapped to $b = f(a)$. By the axiom of choice, there exists a
choice function~$c \colon A / {\sim} \to A$ which selects a representative
element of each equivalence class. There exists a
function~$h \colon B \to A / {\sim}$, so that
$h(b) = h\bigl(f(a)\bigr) = [a]_{\sim}$. This allows us to construct the
function~$g = c \circ h$, which is in fact a right-inverse of $f$.
\[
    \Biggl(\biggl(\Bigl(\bigl((X)\bigr)\Bigr)\biggr)\Biggr)
\]
\end{document}

The \show at the top of the document show

> 14.5pt.
l.13 \showthe\baselineskip

? 

> 13.24792pt.
<to be read again> 

showing that \big( is less than the 14.5pt baselinekip.

The .92 chosen empirically: .93 makes the font jump to the next available size, which is too big here.

  • This is an area where amsmath might do better: different fonts give different results, even missing some steps. – egreg Nov 15 '16 at 13:22
  • 1
    @egreg Michael wrote in the dtx: % The various kinds of struts could use some analysis and perhaps consolidation. .... – David Carlisle Nov 15 '16 at 13:23
  • It's a pity that the NEXTLARGER series cannot be accessed from within TeX. – egreg Nov 15 '16 at 13:25
  • @egreg a little luatex project for you.... – David Carlisle Nov 15 '16 at 13:26
  • 1
    @HåkonMarthinsen there are two kinds of scaling, the font itself has delimiters of various sizes and then "extendable" delimiter made out of bits and by default cm (and lm) use a fixed font size and just rely on the in-font delimiter sizing, alternatively you can scale the font as you would for a text font so use a 12pt font at 12pt and then use delimiter sizing within that as necessary. this gives far more control as you can use designed glyphs for sizes close to the font size, if you always use a fixed size font then for large font sizes, brackets switch sooner to teh "extendable" version – David Carlisle Nov 15 '16 at 14:11
3

You can solve your issue by forcing use of the cmex fonts. I will use the exscale like set-up from amsfonts.

\documentclass[12pt]{article}

\usepackage{lmodern}
\usepackage{amsmath}


\DeclareFontFamily{OMX}{lmex}{}
\DeclareFontShape{OMX}{lmex}{m}{n}{%
       <-7.5>cmex7%
    <7.5-8.5>cmex8%
    <8.5-9.5>cmex9%
    <9.5->cmex10%
}{}%

\begin{document}

% \showoutput

An equivalence class~$[a]_{\sim} \in A / {\sim}$ consists of all the elements
in $A$ that are mapped to $b = f(a)$. By the axiom of choice, there exists a
choice function~$c \colon A / {\sim} \to A$ which selects a representative
element of each equivalence class. There exists a
function~$h \colon B \to A / {\sim}$, so that
$h(b) = h\bigl({f}(a)\bigr) = [a]_{\sim}$. This allows us to construct the
function~$g = c \circ h$, which is in fact a right-inverse of $f$.
\[
    \Biggl(\biggl(\Bigl(\bigl((X)\bigr)\Bigr)\biggr)\Biggr)
\]
\end{document}

enter image description here

  • I posted this without realizing an edit had been done to OP's with a link to egreg's tex.stackexchange.com/a/137143/4686 which contains (as second proposal) basically the same as I proposed here. – user4686 Nov 15 '16 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.