moresize: More font sizes with L^{A}TEX

    Christian Cornelssen (Cornelssen@wirt.fh-hannover.de)

v1.8 as of July 14, 1997

1 Introduction

When writing yet another L^{A}TEX introduction with a demonstration of font sizes, I discovered that \Huge and \huge were set to the same size. No good for a demonstration! I localized the definition in the size12.clo class option file and found that the font size for \Huge had to be increased from 24.88pt to 29.86pt.

\HUGE Therefore, I produced a package moresize redefining \Huge and defining an even “bigger” font size command \HUGE, because I wanted to be able to use font sizes up to 35.83pt, as provided by the EC fonts’ standard edition.

\ssmall Additionally, I defined a size command \ssmall filling the gap between the

sizes selectable by \tiny and \scriptsize.

The documentation in the L^{A}TEX 2ε distribution’s source file fontdef.dtx reminded me to also declare math sizes for the new text sizes. When studying the docs, I found that the math script sizes defined in fontdef.dtx grew faster than the text sizes, and that at least the script sizes for 24.88pt seemed to be absolutely inappropriate. Therefore, I designed two sets of text/math size combinations including the new 29.86pt and 35.83pt text sizes, one set just fixing the 25pt math script and scriptscript sizes, and another one with somewhat smaller scriptscript sizes in order to maintain the classical 10 : 7 : 5 ratio for text sizes from 10pt upwards. The math size changings can be activated by means of options passed to the moresize package.

For testing the new sizes and for visualizing the effects of the math size settings, a L^{A}TEX file msizetst.tex containing sample text and math expressions at various sizes is provided.

2 User Interface

The moresize package can be loaded in the usual way:

     \usepackage[⟨options⟩]{moresize}

By default, moresize neither redefines existing macros nor changes the standard math size declarations. However, the package provides the additional font size selection commands \HUGE and \ssmall, and declares math sizes for the new 29.86pt and 35.83pt text sizes.

Available Options are:

10pt This option provides the same settings as the default. \HUGE is defined to select a 29.86pt font size, and \ssmall is made to give 6pt. These definitions continuously extend the set of size commands given in the size10.clo standard class option file.

11pt This option makes \HUGE and \ssmall select 29.86pt and 7pt, respectively, which is suitable for use with the settings given in the size11.clo standard class option file.

12pt With this option, \HUGE and \ssmall are defined to select 35.83pt and 7pt, respectively.

Additionally, the size selection command \Huge is redefined to give 29.86pt. This is done because the setting given in the size12.clo standard class option file saturates the \Huge font size at the same level as given by \huge (24.88pt)—presumably with the CM font restrictions of old L^{A}TEX 2.09 in mind. Nowadays, with L^{A}TEX 2ε’s flexible NFSS, font size selection commands are not associated with a predetermined font family any longer, hence such restrictions are out of place. NFSS automatically resorts to lower sizes if a demanded font size is not available, so standard CM font users will not be affected by the new size settings, but EC font users can benefit from them.

ecpatch This is a bug fix for the EC font declarations given in the L^{A}TEX 2ε releases from December 1996 and June 1997. Therein, the declarations of the generic^{1} EC fonts do not include font sizes above 24.88pt, although the EC font standard edition provides tfm files for 29.86pt and 35.83pt. As a consequence, NFSS would deny use of those font sizes and substitute 24.88pt instead.

The ecpatch option installs macros which override any declaration of a generic EC font with an own declaration including the 29.86pt and 35.83pt sizes.

Regard this patch as a temporary bug fix; the proper way requires updating the L^{A}TEX 2ε distribution source file cmfonts.fdd from which the t1cm*.fd files are generated. This will be fixed in the L^{A}TEX release of December 1997.

normalscripts In the L^{A}TEX 2ε source file fontdef.dtx, the script and scriptscript sizes associated with 24.88pt text size are set too high, as suggested by a look at nearby math size settings. This option decreases the script and scriptscript sizes associated with the 24.88pt text size to (presumably) more appropriate values. With this setting, a formula like \frac{X}{Y} within a \Huge paragraph (e. g. a document title) does no longer affect line spacing, as should be.

smallscripts Starting from the normalscripts math size settings, this option further reduces the scriptscript sizes associated with text sizes of 17.28pt and above. The idea behind this is to maintain the approximate 10 : 7 : 5 ratio between text, script, and scriptscript sizes in bigger-than-normal writings.

1in this document, the term generic font is used for fonts which can be generated from a common (Metafont) source in very different sizes without resorting to trivial magnification.

The math script size option names roughly describe the changes to the standard L^{A}TEX setup. Therefore, normalscripts may not look “normal” in the sense of “just right”, but differs from the standard setup in 24.88pt writings only. I prefer smallscripts which results in scriptscript sizes that are not really small—they are simply not as big as the standard ones. Note that this option only affects math expressions with nested fractions and/or sub-/superscripts in large writings (17.28pt text size and above), e. g. in titles or section headers. Therefore, it is quite likely that you have not encountered an example of that kind so far. But once you have, you should keep this package in mind…

A test file msizetst.tex is provided for evaluating the math size settings. You may rename it and then manipulate it as you wish, particularly for selecting the options passed to the moresize package. The test document shows sample text and math expressions at various sizes, each framed above and below by horizontal lines delimiting the amount of vertical space that is typically available for math expressions within paragraphs of text. If the expressions overprint the delimiters, they are likely to cause stretching of the baseline skip when used within a paragraph.

3 Important Notes

In contrast to other options of the moresize package, ecpatch is not intended for long-term usage. There are some things to be held in mind when using ecpatch:

• The method for declaring the last revision of the DC font families is the same as for the first EC release. Therefore, the ecpatch option traps the declaration of a new DC family as well as the declaration of a newer EC family. This might be regarded as a feature. But note the following: For both the DC and the EC fonts, using ecpatch causes L^{A}TEX’s NFSS to believe that tfm files for the 29.86pt and 35.83pt font sizes are available. However, there are DC releases which do not include the 29.86pt size. In this case, using ecpatch might cause fatal TEX errors (“Metric (TFM) file not found”). Therefore, authors of L^{A}TEX documents should not specify the ecpatch option if they are concerned about portability. Instead, the moresize package itself should be configured according to the installed version of L^{A}TEX and of the T1 fonts. This can be done easily: For systems using the EC fonts (not the DC fonts) with versions of L^{A}TEX 2ε older than December 1997, a configuration file moresize.cfg containing

     \ExecuteOptions{ecpatch}

should be created somewhere in the L^{A}TEX input files area. This frees authors of L^{A}TEX 2ε input files from the need of specifying ecpatch themselves when using the moresize package, and thus preserves the portability of L^{A}TEX 2ε documents.

• The last DC and the new EC font sets include a generic font family for “caps and small caps” in several series and shapes, made accessible by Daniel Taupin with his smallcap package. The size declarations given there are already extended: They even include 43.00pt and 51.60pt sizes which are non-standard. Using the ecpatch option will restrict the declarations to a maximum of 35.83pt, according to the EC fonts standard edition.

Further points to be mentioned deal with the demonstration of font sizes in

msizetst.tex.

• Even when using EC text fonts, math expressions still use CM fonts which are limited to 24.88pt in their declarations to NFSS. This does not matter for scripts and scriptscripts because even \HUGE writings do not request script sizes greater than 24.88pt. However, the main (i. e. non-script) symbols of math expressions in \HUGE, or even in \Huge (for 12pt documents), will be shrinked to 24.88pt size, thereby issuing NFSS warnings about unavailable font sizes for OT1, OML, or OMS encodings. (If there are messages about unavailable T1 font sizes, you should try the ecpatch option or get a recent version of L^{A}TEX and of the EC fonts.)

• As another effect of the main symbol size shrinking, the fraction denominators come too close to the fraction rules.

• The algorithm used in msizetst.tex for calculating the positions of the line delimiters gives results that may be misleading if NFSS substitutes the font size for the sample by another one. In particular, if NFSS substitutes huge font sizes by smaller ones, the line delimiters move wider apart while the main parts of the sample get smaller, thus indicating much more available space than in the normal case.

As a consequence, the 35.83pt math samples will not overprint the line delimiters if only CM fonts are used, but once proper fonts have been selected, they will—unless the smallscripts option is used.

• By means of adding very strong magnifications to the CM font declarations, CM math fonts can be used even at 29.86pt and 35.83pt. Thereby I have made sure that the aforementioned artifacts disappear when math fonts are used in the requested sizes. However, I have not included this hack for demonstration, in order not to provide any means for over-using the CM fonts. The maximum design size for the CM math fonts is 12pt; any size greater than this is achieved by magnification, thereby making the symbols look bolder. At 24.88pt and above, the magnified “medium” math fonts really look like “bold” math variants.

Even without math fonts at more than 24.88pt, the improvements in typesetting huge math expressions can be demonstrated by variation of the options passed to the moresize package in the test file msizetst.tex. Before complaining, remember that the moresize package has been intended to provide means for using huge fonts, but not for providing the fonts themselves. I know that there is a growing demand for math fonts at more-than-12pt design size and that modern 256-character versions are being developed. Therefore, making documents which explicitly misuse CM fonts for math expressions would be counterproductive.

For more detailed information, see the documentation of the package code and of the test code.

Finally, a word about the aforementioned shortcomings in standard L^{A}TEX. Improvements in reliability or functionality of L^{A}TEX’s document formatting procedures are welcome. However, asking the L^{A}TEX3 team to change the math script size setups or to enlarge \Huge does not actually mean changing methods but changing document design decisions. In order to maintain backward compatibility, such design decisions will be left unchanged in standard L^{A}TEX. The best places for making changes to the standard layout are in (new) document class definition files or in package files. This is stated in the ltnews07.tex L^{A}TEX 2ε newsletter and was also told to me when I made the above suggestions. (However, adding the missing EC font size declarations has been appreciated.)

This means that you can neither hope nor fear that the unclipping of \Huge and less-bigger math script sizes will be incorporated into standard L^{A}TEX. If you want those features, you have to select them explicitly by using the moresize package. However, ambitioned document class writers are welcome to evaluate the moresize package and to include its features in their own class definitions in order to enable unrestricted use of today’s and tomorrow’s modern fonts.

4 Package Code

This section documents the contents of the ready-to-use package file moresize.sty.

1 ⟨∗package⟩

4.1 Preliminaries

Announce the file as a L^{A}TEX 2ε package.

 2 \ProvidesPackage{moresize}[1997/07/14 v1.8 (more font sizes)]

\@xxxpt \@xxxvipt By convention, declare macros for the new point sizes.

 3 \providecommand\@xxxpt{29.86}
 4 \providecommand\@xxxvipt{35.83}

4.2 Size Selection Commands

\HUGE \ssmall Define the author commands \HUGE and \ssmall, depending on the main document font size option. In case of 12pt, fix the clipping of \Huge which occurs in

size12.clo (classes.dtx).
 5 \DeclareOption{10pt}{
 6 \def\ssmall{\@setfontsize\ssmall\@vipt\@viipt}
 7 \def\HUGE{\@setfontsize\HUGE\@xxxpt{36}}}
 8 \DeclareOption{11pt}{
 9 \def\ssmall{\@setfontsize\ssmall\@viipt\@viiipt}
10 \def\HUGE{\@setfontsize\HUGE\@xxxpt{36}}}
11 \DeclareOption{12pt}{
12 \def\ssmall{\@setfontsize\ssmall\@viipt\@viiipt}
13 \def\Huge{\@setfontsize\Huge\@xxxpt{36}}
14 \def\HUGE{\@setfontsize\HUGE\@xxxvipt{43}}}

The definitions given here are similar to most size command definitions in L^{A}TEX 2ε’s classes.dtx. The following rules have been observed and taken as guidelines:

• Size commands other than \footnotesize–\normalsize are not intended for typesetting document structures more complex than paragraphs. Therefore, their definitions do not contain specifications of dimension parameters for list environments or displayed equations.

• Baselineskips for text sizes below 8pt are chosen to be 1pt higher than the text size. Baselineskips above 10pt are set to somewhat rounded pt sizes around 1.2 times the text size.

4.3 Math Size Options

Consider the declarations in L^{A}TEX 2ε’s fontdef.dtx:

     \DeclareMathSizes{\@xpt}{\@xpt}{7}{5}
     \DeclareMathSizes{\@xipt}{\@xipt}{8}{6}
     \DeclareMathSizes{\@xiipt}{\@xiipt}{8}{6}
     \DeclareMathSizes{\@xivpt}{\@xivpt}{\@xpt}{7}
     \DeclareMathSizes{\@xviipt}{\@xviipt}{\@xiipt}{\@xpt}
     \DeclareMathSizes{\@xxpt}{\@xxpt}{\@xivpt}{\@xiipt}
     \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xxpt}{\@xviipt}

The script and scriptscript sizes for \@xxvpt are one magstep bigger than the sizes extrapolated from the context. This seems to be an error. And in fact, fractions like \frac{X}{Y} placed in 25pt text strech the baseline skip, whereas this does not happen at lower sizes.

This will be fixed when given the option normalscripts:

15 \DeclareOption{normalscripts}{
16 \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xviipt}{\@xivpt}}

In any case, declare math sizes for the new point sizes.

17 \DeclareMathSizes{\@xxxpt}{\@xxxpt}{\@xxpt}{\@xviipt}
18 \DeclareMathSizes{\@xxxvipt}{\@xxxvipt}{\@xxvpt}{\@xxpt}

There remains a one-magstep ratio between the script and scriptscript sizes for text sizes above \@xivpt, whereas for text sizes between \@xpt and \@xivpt, approximately two magsteps are taken. An option is defined for applying the two-magsteps rule to text sizes above \@xivpt, including the new \@xxxpt and

\@xxxvipt sizes.
19 \DeclareOption{smallscripts}{
20 \DeclareMathSizes{\@xviipt}{\@xviipt}{\@xiipt}{8}
21 \DeclareMathSizes{\@xxpt}{\@xxpt}{\@xivpt}{\@xpt}
22 \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xviipt}{\@xiipt}
23 \DeclareMathSizes{\@xxxpt}{\@xxxpt}{\@xxpt}{\@xivpt}
24 \DeclareMathSizes{\@xxxvipt}{\@xxxvipt}{\@xxvpt}{\@xviipt}}

4.4 EC Font Declaration Patch

\UndeclareFontFamily  \UndeclareFontFamily{⟨ENC ⟩}{⟨family⟩} makes NFSS forget the font informa-

tion for the font family ⟨family⟩ with encoding ⟨ENC ⟩ and thus causes the corresponding font declaration file (⟨enc ⟩⟨family ⟩.fd) to be reloaded on demand.

25 \newcommand\UndeclareFontFamily[2]{%
26 \global\expandafter\let\csname#1+#2\endcsname\relax}

The EC font declaration patch is an optional bug fix, and possibly obsolete.

27 \DeclareOption{ecpatch}{
28 \typeout{*** Using EC font declaration patch for LaTeX2e < 1997/12/01 ***}

\EC@family Declaration of generic font families from the EC or the previously released DC edition is done by the macro \EC@family. It is defined in the relevant font definition files by means of \providecommand. Hence, predefining this macro will override the definition given in the fd files. Now take the original definition and complete the size specification with 29.86pt and 35.83pt entries. Since \nfss@catcodes have not been activated, white space in the \DeclareFontShape call must be avoided.

29 \def\EC@family#1#2#3#4#5{%
30  \DeclareFontShape{#1}{#2}{#3}{#4}{%
31  <5><6><7><8><9><10><10.95><12><14.4>%
32  <17.28><20.74><24.88><29.86><35.83>genb*#5}{}}

\EC@ttfamily For the typewriter families, a similar macro is used.

33 \def\EC@ttfamily#1#2#3#4#5{%
34  \DeclareFontShape{#1}{#2}{#3}{#4}{%
35  <5><6><7><8>#50800%
36  <9><10><10.95><12><14.4><17.28><20.74><24.88>%
37  <29.86><35.83>genb*#5}{}}

Now undeclare font families that are usually mapped to generic EC or DC fonts. On demand, they will be redeclared under control of the predefined \EC@family

or \EC@ttfamily macros.
38 \UndeclareFontFamily{T1}{cmr}
39 \UndeclareFontFamily{TS1}{cmr}
40 \UndeclareFontFamily{T1}{cmss}
41 \UndeclareFontFamily{TS1}{cmss}
42 \UndeclareFontFamily{T1}{cmtt}
43 \UndeclareFontFamily{TS1}{cmtt}
44 \UndeclareFontFamily{T1}{cmvtt}
45 \UndeclareFontFamily{TS1}{cmvtt}
46 \UndeclareFontFamily{T1}{cmsc}% from `smallcap' package
47 \UndeclareFontFamily{T1}{cmdh}
48 \UndeclareFontFamily{T1}{cmfib}
49 \UndeclareFontFamily{T1}{cmfr}

The patch is now complete.

50 }

Of course, a proper way in NFSS for adding size specifications to existing font shape declarations would be appreciated. But once the fonts are declared properly, this should not be necessary at all.

4.5 Configuration

In the standard classes, 10pt writing is the default. Therefore, the same is assumed here. Global options or explicitly given package options may override this.

51 \ExecuteOptions{10pt}

Before processing the package options, a configuration file moresize.cfg may be input, typically containing \ExecuteOptions{ecpatch} for systems with installed EC fonts and a L^{A}TEX 2ε version older than December 1997.

52 \InputIfFileExists{moresize.cfg}{}{}
53 \ProcessOptions

54 ⟨/package⟩

5 Test Code

This section documents the contents of the test document source file msizetst.tex.

55 ⟨∗testfile⟩

This is a L^{A}TEX 2ε document.

56 %% This is a test file for text and math size settings.
57 %% You might want to test several configurations.
58 %% It might be a good idea to save different versions of this file
59 %% under different names.
60 \documentclass[11pt]{article}

61

Here the package of interest is loaded.

62 %% Available options for the `moresize' package:
63 %%   10pt, 11pt, 12pt   (in \documentclass) affects \HUGE and \ssmall sizes
64 %%   normalscripts      avoid script size explosion in huge writings
65 %%   smallscripts       smaller, more appropriate script sizes
66 %%   ecpatch            if NFSS doesn't want big EC fonts, force it
67 \usepackage[smallscripts]{moresize}

68

For testing the 29.86pt and 35.83pt sizes, the T1-encoded EC or DC fonts may be needed.

69 %% Use the `t1enc' package for testing with DC/EC fonts
70 \usepackage{t1enc}

71

\calcmathspace \mathht \mathdp The amount of vertical space usable for math expressions within a paragraph without probably stretching the baseline skip can be calculated by means of the macro \calcmathspace. When called, \calcmathspace uses the caller’s current text size and \baselineskip settings as well as height and depth of the characters [ and ] from the current text font for estimating the height and depth which an inline math expression may have. The results are stored in the length parameters \mathht and \mathdp, respectively.

72 %% Consider a paragraph with a text line of depth d (below the baseline),
73 %% followed by a line with an inline formula,
74 %% followed by a text line with height h (above the baseline).
75 %% Then the formula's height may not exceed \baselineskip - d,
76 %% and its depth may not exceed \baselineskip - h,
77 %% or the baseline skips will be stretched.
78 %% The brackets `[' and `]' are used for estimating d and h.
79 %% Note that the space for the formula seems to get larger if NFSS
80 %% substitutes a smaller font, because \baselineskip is not reduced!
81 \newlength\mathht       %% height available for an inline formula
82 \newlength\mathdp       %% depth available for an inline formula
83 \newcommand\calcmathspace{%
84  \settodepth\mathht{[}%
85  \setlength\mathht{-\mathht}%
86  \addtolength\mathht{\baselineskip}%
87  \settoheight\mathdp{]}%
88  \setlength\mathdp{-\mathdp}%
89  \addtolength\mathdp{\baselineskip}}

90

\linebox The command \linebox{⟨text⟩} typesets ⟨text⟩ in a box with fixed height and depth corresponding to a line that extends so high and so deep that it just touches the preceding and following lines which are assumed to contain ordinary text. The upper and lower bounds of the box are delimited by horizontal lines.

 91 %% The following command shows its argument, typeset in text style,
 92 %% between two horizontal lines showing the available space in a text line.
 93 %% If the argument overprints the lines, it would stretch
 94 %% the baseline skip in a paragraph.
 95 \newcommand\linebox[1]{\calcmathspace\begin{tabular}{@{}l@{}}\hline
 96  \raisebox{0pt}[\mathht][\mathdp]{#1}\\\hline\end{tabular}}

97

\msample The macro \msample should contain fairly simple math expressions with nested sub- or superscripts and/or fractions which should fit into paragraphs of text without stretching the baseline skip.

 98 %% A macro for sample math expressions.
 99 %% The original definition gives expressions which should fit into
100 %% paragraphs without enlarging the baseline skip.
101 %% Note that \sum or \int would not look good because \TeX\ typesets them
102 %% at fixed sizes. There may be packages around for fixing this.
103 \newcommand\msample{\ensuremath{
104  \frac{X}{Y}
105 \,      g^{i_1\ldots i_n}_{j_1\ldots j_n}
106 \,      \frac{t^2}{2!}
107 \,      e^{-\frac{t}{\tau}}

108 }}

109

\Size Interested testers may like to directly specify point sizes instead of using author commands. The command \Size{⟨font size⟩}{⟨baselineskip⟩} is provided for easying such specifications. ⟨font size⟩ and ⟨baselineskip⟩ must be specified as numbers of pt, with the pt omitted.

110 %% None of the size options 10pt, 11pt, and 12pt offers the entire spectrum
111 %% of available font sizes.
112 %% For example, the 10pt option offers no command for selecting 10.95pt,
113 %% and the 12pt option does not provide a command for 9pt.
114 %% The 11pt option fills both gaps, but misses the extremes 35.83pt and 5pt.
115 %% Therefore, a shorthand for lower-level size switches is provided.
116 %% E.g. \Size{20.74}{25} selects a 20.74pt font size with 25pt baselineskip.
117 \newcommand\Size[2]{\fontsize{#1}{#2}\selectfont}

118

Now typesetting can begin. Remember to echo the options used.

119 \begin{document}
120 %% Don't forget to list the moresize options in the test output!
121 \textsf{moresize} options:
122 %%[10pt]
123 [11pt]
124 %%[12pt]
125 %%[normalscripts]
126 [smallscripts]
127 %%[ecpatch]

128

129 %% Are you using HUGE fonts?
130 %%Using CM fonts only.
131 %%Using DC fonts for text, CM fonts for math.
132 Using EC fonts for text, CM fonts for math.

133

Now comes a table containing samples at all sizes available with author commands, completed by explicit 35.83pt and 5pt samples. This is intended for use with the 11pt option; 10pt or 12pt test documents have either 5pt or 35.83pt samples duplicated (in \tiny or \HUGE, respectively), but miss the 10.95pt or 9pt font sizes.

134 \begin{center}
135 \newcommand\n{\\\\[-1ex]}       %% for separating the tabular lines
136 \begin{tabular}{@{}ll@{}}
137  \Size{35.83}{43}\linebox{36pt}
138  & \Size{35.83}{43}\linebox{\msample}
139 \n      \HUGE\linebox{HUGE}     & \HUGE\linebox{\msample}
140 \n      \Huge\linebox{Huge}     & \Huge\linebox{\msample}
141 \n      \huge\linebox{huge}     & \huge\linebox{\msample}
142 \n      \LARGE\linebox{LARGE}   & \LARGE\linebox{\msample}
143 \n      \Large\linebox{Large}   & \Large\linebox{\msample}
144 \n      \large\linebox{large}   & \large\linebox{\msample}
145 \n      \normalsize\linebox{normalsize}
146  & \normalsize\linebox{\msample}
147 \n      \small\linebox{small}   & \small\linebox{\msample}
148 \n      \footnotesize\linebox{footnotesize}
149  & \footnotesize\linebox{\msample}
150 \n      \scriptsize\linebox{scriptsize}
151  & \scriptsize\linebox{\msample}
152 \n      \ssmall\linebox{ssmall} & \ssmall\linebox{\msample}
153 \n      \tiny\linebox{tiny}     & \tiny\linebox{\msample}
154 \n      \Size{5}{6}\linebox{5pt}
155  & \Size{5}{6}\linebox{\msample}
156 \end{tabular}
157 \end{center}

That’s all on one test page.

158 \end{document}

159 ⟨/testfile⟩