[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

\DeclareMathSizes and \biggg delimiters




While experimenting with MathTime, I noticed that switching documents
from CM fonts to MathTime may have a surprising effect on the choice 
of big delimiters.  In some cases where CM fonts with 10 / 7 / 5 pt 
size scaling got by with \big or \bigg delimiters, MathTime fonts 
with 10 / 7.6 / 6pt size scaling produced \Big or \Bigg delimiters.  

Moreover, there seems to be a sensitive dependence on whether or not 
a letter in a superscript position has an ascender or descender or 
whehter it is typeset in cramped or non-cramped style.  The problem
is analysed in detail in the discussion paper attached below and leads 
to the question whether all *.mfd files containing \DeclareMathSizes
declarations should also adjust the \delimiterfactor parameter.
I've also filed a LaTeX bug report on the same subject for the 
existing mathtime.dtx from PSNFSS.

Cheers, Ulrik.

P.S. For those of you who have access to MathTime fonts, try the
following test file with and without MathTime and tell me if you
understand the choice of delimiter sizes.  Then read the discussion
paper attached below for an explanation how this odd behaviour 
comes about.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

\documentclass[10pt]{article}
\usepackage{mathtime}

\begin{document}

Test with default \texttt{\string\delimiterfactor=901}.

\begin{displaymath}
  \left( x \right) \qquad
  \left( f \right) \qquad
  \left( \partial_{\mu} x^{\nu} \right) \qquad
  \left( \partial_{\mu} x^{\beta} \right) \qquad
  \left( x_{0} \right) \qquad
  \left( x_{\mu} \right) \qquad
  \left( {\textstyle x^{2}} \right) \qquad
  \left( x^{2} \right) \qquad
\end{displaymath}

\begin{displaymath}
  \left( \frac{\partial x}{\partial t} \right) \qquad
  \left( \frac{\partial x_{\mu}}{\partial \tau} \right) \qquad
  \left( \frac{\partial^{2} x_{\mu}}{\partial \tau^{2}} \right)
\end{displaymath}

Test with modified \texttt{\string\delimiterfactor=867}.

\delimiterfactor=867
\begin{displaymath}
  \left( x \right) \qquad
  \left( f \right) \qquad
  \left( \partial_{\mu} x^{\nu} \right) \qquad
  \left( \partial_{\mu} x^{\beta} \right) \qquad
  \left( x_{0} \right) \qquad
  \left( x_{\mu} \right) \qquad
  \left( {\textstyle x^{2}} \right) \qquad
  \left( x^{2} \right) \qquad
\end{displaymath}

\begin{displaymath}
  \left( \frac{\partial x}{\partial t} \right) \qquad
  \left( \frac{\partial x_{\mu}}{\partial \tau} \right) \qquad
  \left( \frac{\partial^{2} x_{\mu}}{\partial \tau^{2}} \right)
\end{displaymath}

\end{document}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

%%% ====================================================================
%%%  @TeX-file{
%%%     author          = "Ulrik Vieth",
%%%     version         = "1.02",
%%%     date            = "14 January 1998",
%%%     time            = "05:07:23 CET",
%%%     filename        = "mfg-size.tex",
%%%     checksum        = "49475 214 1226 8950",
%%%     email           = "vieth@thphy.uni-duesseldorf.de",
%%%     URL             = "http://www.thphy.uni-duesseldorf.de/~vieth/",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "math fonts, size scaling, big delimiters,
%%%                        technical studies",
%%%     supported       = "yes",
%%%     abstract        = "",
%%%     docstring       = "The checksum field above contains a CRC-16
%%%                        checksum as the first value, followed by the
%%%                        equivalent of the standard UNIX wc (word
%%%                        count) utility output of lines, words, and
%%%                        characters.  This is produced by Robert
%%%                        Solovay's checksum utility.",
%%%  }
%%% ====================================================================

\documentclass[preprint]{ltugboat}
\overfullrule0pt

\hyphenation{italic roman}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{Size scaling of math fonts and big delimiters}

\author{Ulrik Vieth}
\address{%
  Heinrich-Heine-Universit{\"a}t\\
  Institut f{\"u}r Theoretische Physik~II\\
  Universit{\"a}tsstra\ss{}e 1\\
  D-40225 D{\"u}sseldorf, Germany}
\netaddress{vieth@thphy.uni-duesseldorf.de}

\def\rtitlex{MFG discussion document}
\def\midrtitle{{\sl Task 3: Technical Studies\/}}
\setcounter{page}{1}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\providecommand{\meta}[1]{\ensuremath{\langle\textit{#1}\rangle}}

\begin{document}
\maketitle

%\begin{abstract}
%\end{abstract}

\section{Size scaling of subscripts and superscripts}

In the original \AllTeX{} setup using the Computer Modern
typefaces, a 10\,pt / 7\,pt / 5\,pt size scaling is used for the
first and second order subscripts and superscripts.  It is
assumed that the 5\,pt and~7\,pt fonts are taken from a family
of meta-fonts which are specially designed for use at the given
design sizes, rather than just representing a scaled-down
version of a 10\,pt font design.

While this assumption is indeed justified for most \MF{} font
families, including Computer Modern, Concrete, and AMS~Euler,
the situation is different when it comes to scalable \PS{} fonts
in Type~1 format, such as Times Roman or MathTime.  In the
latter case, there is usually only a single version of each font
at a design size of 10\,pt, which is then scaled linearly to
cover the whole range of sizes from very small to very large.

If a 10\,pt / 7\,pt / 5\,pt size scaling for subscripts and
superscripts is applied to such a scalable font, the resulting
5\,pt font size might turn out to be too hard to read, and a
different size scaling is used instead, such as 10\,pt / 7.6\,pt
/ 6\,pt for MathTime or 10\,pt / 7.4\,pt / 6\,pt for the
\texttt{mathptm} package.  While this solves the problem of
readability, it also leads to another problem that will be
discussed below.  In short, the problem is that since the
subscripts and superscript now happen to be slightly bigger in
proportion to the text font size, they happen to have a
surprising effect on the automatic choice of
``appropriately-sized'' big delimiters around expressions
enclosed by \cs{left(} and \cs{right)}.

\section{Size scaling of big delimiters}

In the original \AllTeX{} setup, the math extension font
\texttt{cmex10} contains big delimiters in four sizes at 12\,pt,
18\,pt, 24\,pt, and~30\,pt.  These sizes are carefully chosen as
multiples of the 12\,pt \cs{baselinskip}.  They can be selected
explicitly by the commands \cs{big}, \cs{Big}, \cs{bigg},
and~\cs{Bigg}, where \cs{big} and \cs{bigg} correspond to
formulas of one or two lines tall and \cs{Big} and \cs{Bigg}
correspond to formulas of 1.5~or 2.5~lines tall (see \TB{},
Ex.~17.11).

If the MathTime fonts are used, the math extension font
\texttt{MTEX} provides big delimiters in the same four sizes as
in \texttt{cmex10}, yet the outcome may turn out to be
completely different, depending on the expression enclosed
between delimiters.  In some cases, the resulting size
critically depends on which letter appears in a subscript or
superscript position and whether or not it is has an ascender or
descender.

To be specific, we shall consider the example of the MathTime
fonts, in which case the \texttt{mathtime} package for \LaTeXe{}
establishes a size scaling of 10\,pt / 7.6\,pt / 6\,pt.
With this setup, a very simple expression such as
\begin{verbatim}
    \left( x_{0} \right)
\end{verbatim}
still produces normalsize parentheses taken from a 10\,pt text
font, while an expression such as
\begin{verbatim}
    \left( x_{\mu} \right)
\end{verbatim}
already produces \cs{big} delimiters at~12\,pt, simply because
the letter~$\mu$ extends a little further below the baseline
than the digit~$0$.  Even worse, the expression
\begin{verbatim}
    \left( x^{2} \right)
\end{verbatim}
already becomes so big that it doesn't fit into 12\,pt
delimiters anymore, and triggers the use of \cs{Big} delimiters
at~18\,pt, which might be just a little irritating in a
displayed formula, but truly inappropriate in the case of an
inline formula.  Furthermore, the result might even depend on
whether the expression is typeset in cramped or non-cramped
style, since the expression
\begin{verbatim}
    \left( {\textstyle x^{2}} \right)
\end{verbatim}
does happen to fit within \cs{big} delimiters at~12\,pt.
Unsurprisingly, the situation is similar for fractions just over
two lines tall, in which case a second derivative (with a
superscript in the numerator) will trigger \cs{Bigg} delimiters
at~30\,pt while a first derivative will get by with \cs{bigg}
delimiters at~24\,pt.

It should be obvious that such a behavior might be perceived as
erratic and unpredictable, and hence undesirable for use in a
production environment.

To get a better understanding of how this size scaling comes
about, it is interesting to consider a specific example of the
formula $x^{2}$ typeset either in cramped or non-cramped style
and study the details of how \TeX{} goes about to choose an
``appropriate'' size of delimiters (see \TB{}, p.~152).

\begin{table}[b]
  \begin{center}
    \begin{tabular}{@{}lll@{}}
      \hline\strut
      $x^{2}$ typeset in & CM fonts      & MathTime       \\
      \hline\strut
      \cs{textstyle}     & 8.14+0.0\,pt  & 8.81+0.15\,pt  \\
      \cs{displaystyle}  & 8.64+0.0\,pt  & 9.31+0.15\,pt  \\
      \hline
    \end{tabular}
  \end{center}
  \caption{Height and depth of a simple formula, typeset using
    Computer Modern or MathTime.}
  \label{tab:ht-dp}
\end{table}

As can be seen from Table~\ref{tab:ht-dp}, the results of
measuring the height and depth of the box enclosing the formula
$x^{2}$ with the superscript typeset either in 7\,pt (Computer
Modern) or in 7.6\,pt (MathTime) differ by a little more than
the nominal difference of 0.6\,pt, which can be accounted for by
the differences of the font designs.  What remains to be seen,
is why \TeX{} chooses 12\,pt delimiters in both cases for the
Computer Modern version, while it resorts to 18\,pt delimiters
for MathTime in \cs{displaystyle}.

Accoridng to the explanations on p.~152, \TeX{} first considers
the difference between the height or depth of the formula and
the axis height, which happens to be 2.5\,pt in both cases.  In
the case of the MathTime example, this yields 6.81\,pt which is
then multiplied by a factor of two, which gives a total size of
13.62\,pt that clearly exceeds the 12\,pt size of \cs{big}
delimiters.  As further step, \TeX{} now multiplies the result
by the \cs{delimiterfactor}/1000.  Since the default value of
this paramter is~901, the result is 12.45\,pt, which
unfortunately still exceeds 12\,pt.

To coerce \TeX{} into using \cs{big} delimiters in this case,
there are at least two possibilities.  One option would be to
reduce the size of size of the subscripts until a
\cs{delimiterfactor} of~901 produces the desired result.  The
other one would be to reduce the \cs{delimiterfactor} to a more
appropriate value, which can be easily determined from this
example to be $12\,\mathrm{pt} / 13.82\,\mathrm{pt} \cdot 1000 =
868$ or somewhat lower than that.

Yet another option worth investigating might be to adjust the
\cs{fontdimen} parameters of the math symbol font to raise the
axis height or modifiy the parameters related to the positioning
of subscripts and superscripts.  Since the side-effects of such
modifications may be far reaching, it is not advisable to
proceed without further stuides of the consequences.

\makesignature
\end{document}