%\iffalse <Not read by DocStrip>
% Copyright 1997,1998,1999 Christian Cornelssen
% This program can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory macros/latex/base/lppl.txt; either
% version 1 of the License, or any later version.
%<*driver>
\documentclass{ltxdoc}
\begin{document}
  \DocInput{moresize.dtx}
\end{document}
%</driver>
%\fi
%\def\basename{moresize}
%\def\fileversion{v1.9}
%\def\filedate{1999/07/26}
%\newcommand\testfile[1][.tex]{\fln{msizetst#1}}
%\newcommand\fnt[1]{\textrm{#1}}                ^^A for fonts
%\newcommand\fln[1]{\texttt{#1}}                ^^A for filenames
%\newcommand\pkg[1]{\textsf{#1}}                ^^A for packages
%\newcommand\opt[1]{\texttt{#1}}                ^^A for package options
%\newcommand\env[1]{\texttt{#1}}                ^^A for environments
%\newcommand\this{\pkg{\basename}}              ^^A for this package
%\newcommand\thisfln[1]{\fln{\basename #1}}     ^^A for related files
%\newcommand\fntcm{\fnt{CM}}
%\newcommand\fntdc{\fnt{DC}}
%\newcommand\fntec{\fnt{EC}}
%\newcommand\NFSS{\textrm{NFSS}}
%\providecommand\MF{\textsc{Metafont}}
%\title{\this: More font sizes with \LaTeX}
%\author{Christian Cornelssen (\texttt{cornsub1@flintstone.ukbf.fu-berlin.de})}
%\date{\fileversion\ [\filedate]}
%\maketitle
%\section{Introduction}
%  When writing yet another \LaTeX\ introduction with a demonstration of 
%  font sizes, I discovered that \cmd{\Huge} and \cmd{\huge} were set to 
%  the same size. No good for a demonstration! I localized the definition 
%  in the \fln{size12.clo} class option file and found that the font size 
%  for \cmd{\Huge} had to be increased from 24.88pt to 29.86pt.
%
%  \DescribeMacro{\HUGE}
%  Therefore, I produced a package \this\ redefining \cmd{\Huge} and 
%  defining an even ``bigger'' font size command \cmd{\HUGE}, because I 
%  wanted to be able to use font sizes up to 35.83pt, as provided by the 
%  \fntec\ fonts' standard edition.
%
%  \DescribeMacro{\ssmall}
%  Additionally, I defined a size command \cmd{\ssmall} filling the 
%  gap between the sizes selectable by \cmd{\tiny} and \cmd{\scriptsize}.
%
%  The documentation in the \LaTeXe\ distribution's source file 
%  \fln{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 
%  \fln{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 typical $10:7:5$ ratio for text sizes from 10pt upwards.
%  The math size changings can be activated by means of options 
%  passed to the \this\ package.
%
%  For testing the new sizes and for visualizing the effects of the math size 
%  settings, a \LaTeX\ file \testfile\ containing sample text and math 
%  expressions at various sizes is provided.
%
%\section{User Interface}
%  The \this\ package can be loaded by the \LaTeXe\ command
%  \begin{quote}
%    |\usepackage|\oarg{options}|{|\thisfln{}|}|
%  \end{quote}
%  By default, \this\ neither redefines existing macros nor changes 
%  the standard math size declarations.
%  However, the package provides the additional font size selection commands 
%  \cmd{\HUGE} and \cmd{\ssmall}, and declares math sizes 
%  for the new 29.86pt and 35.83pt text sizes.
%
%  Available Options are:
%  \begin{description}
%  \item[\opt{10pt}]
%    This option provides the same settings as the default.
%    \cmd{\HUGE} is defined to select a 29.86pt font size, and 
%    \cmd{\ssmall} is made to give 6pt.
%    These definitions continuously extend the set of size commands given in 
%    the \fln{size10.clo} standard class option file.
%
%  \item[\opt{11pt}]
%    This option makes \cmd{\HUGE} and \cmd{\ssmall} select 29.86pt and 
%    7pt, respectively, which is suitable for use with the settings given in 
%    the \fln{size11.clo} standard class option file.
%
%  \item[\opt{12pt}]
%    With this option, \cmd{\HUGE} and \cmd{\ssmall} are defined to 
%    select 35.83pt and 7pt, respectively.
%
%    Additionally, the size selection command \cmd{\Huge} is redefined 
%    to give 29.86pt.
%    This is done because the setting given in the \fln{size12.clo} standard 
%    class option file saturates the \cmd{\Huge} font size at the same level 
%    as given by \cmd{\huge} (24.88pt)---presumably with the \fntcm\ font 
%    restrictions of old \LaTeX~2.09 in mind.
%    Nowadays, with \LaTeXe's flexible \NFSS, font size selection commands 
%    are not associated with a predetermined font family any longer, 
%    hence such restrictions are out of place.
%    Note that \NFSS\ automatically resorts to lower sizes if a demanded font 
%    size is not available, so standard \fntcm\ font users will not be 
%    affected by the new size settings, but \fntec\ font users can benefit 
%    from them.
%
%  \item[\opt{ecpatch}]
%    This is a bug fix for the \fntec\ font declarations given in the 
%    \LaTeXe\ releases from December 1996 through December 1997.
%    Therein, the declarations of the \fntec\ fonts do not include 
%    font sizes above 24.88pt, although the \fntec\ font standard edition 
%    provides font metrics files for 29.86pt and 35.83pt.
%    As a consequence, \NFSS\ would deny usage of those font sizes 
%    and substitute 24.88pt instead.
%
%    The \opt{ecpatch} option installs macros which override any declaration 
%    of an \fntec\ 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 \LaTeXe\ distribution source file \fln{cmfonts.fdd} 
%    from which the \fln{t1cm*.fd} files are generated, and remaking the 
%    \LaTeXe\ format file.
%    Indeed, a proper fix has been incorporated into the \LaTeXe\ 
%    distribution shortly after December 1997; therefore, recent distributions 
%    should not require the \opt{ecpatch} option.
%
%    As can be concluded from the above, the decision whether to use 
%    \opt{ecpatch} or not should be determined by the availibility of 
%    \fntec\ (\emph{not} \fntdc!) fonts and by the version of the 
%    \LaTeXe\ base distribution both of which may vary independently from the 
%    author's main \LaTeX\ input file.
%    Therefore, the appropriate spot for invoking \opt{ecpatch} 
%    is a configuration file placed somewhere in the \LaTeXe\ input 
%    directory tree with filename \thisfln{.cfg},
%    containing a line like
%    \begin{quote}
%\begin{verbatim}
%\ExecuteOptions{ecpatch}
%\end{verbatim}
%    \end{quote}
%    This frees authors of \LaTeXe\ input files from the need of specifying 
%    \opt{ecpatch} themselves when using the \this\ package 
%    and thus preserves the portability of \LaTeXe\ documents across 
%    different \LaTeXe\ releases.
%
%    Note that \opt{ecpatch} is useful only if the following conditions 
%    are met:
%    \begin{enumerate}
%    \item
%      The ``official'' \fntec\ fonts are available,
%      including TFM files for the sizes 29.86pt and 35.83pt.
%      With \fntdc\ fonts instead, \opt{ecpatch} will not work 
%      correctly.\footnote{
%      \opt{ecpatch} may work with the last (``new'') 
%      \fntdc\ font release if provided with TFM files for all standard 
%      \fntec\ font sizes.
%      Typically, the 29.86pt size would be missing.}
%    \item
%      The \LaTeXe\ base has been configured to support \fntec\ fonts
%      (i.e.\ \fln{cmfonts.fdd} has been unpacked by \fln{ec.ins}\footnote{
%      Using \fln{newdc.ins} for \fntdc\ fonts with all TFM files mentioned 
%      above could also work.}).
%    \item
%      The \LaTeXe\ base (or at least its \fln{cmfonts.fdd}) has a release 
%      date before 1998. Later releases do not need \opt{ecpatch}.\footnote{
%      Applying \opt{ecpatch} to newer \LaTeXe\ releases has not caused 
%      any harm in my testings so far.}
%    \end{enumerate}
%    Anyway---upgrading your system to a recent \LaTeXe\ base 
%    with ``official'' \fntec\ fonts would be a better solution 
%    than using \opt{ecpatch}.
%
%  \item[\opt{normalscripts}]
%    This option decreases the script and scriptscript sizes associated 
%    with the 24.88pt text size by one magstep, in order to damp the 
%    script size explosion defined in the \LaTeXe\ source file 
%    \fln{fontdef.dtx}.
%    With this setting, a formula like $\frac{X}{Y}$ within a \cmd{\Huge} 
%    paragraph (e.\,g.\ a document title) does no longer affect line spacing, 
%    as should be.
%
%  \item[\opt{smallscripts}]
%    Starting from the \opt{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 an approximate $10:7:5$ ratio 
%    between text, script, and scriptscript sizes in bigger-than-normal 
%    writings.
%  \end{description}
%
%  The math script size option names roughly describe the changes to the 
%  standard \LaTeX\ setup.
%  Therefore, \opt{normalscripts} may not look ``normal'' in the sense of 
%  ``just right'', but differs from the standard setup in 24.88pt 
%  writings only.
%  I prefer \opt{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 remember this package\dots
%
%\section{The test file \testfile}
%  A test file \testfile\ is provided for evaluating the math size 
%  settings. You may rename it and then manipulate it as you wish, 
%  typically for testing the options passed to the \this\ 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 normally 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.
%
%  However, the output for sizes above 24.88pt may be erroneous or 
%  misleading under certain circumstances:
%  \begin{itemize}
%  \item
%    Even when using \fntec\ text fonts, math expressions may still use 
%    \fntcm\ fonts which are limited to 24.88pt in their declarations 
%    to \NFSS\@.
%    This does not matter for scripts and scriptscripts because even 
%    \cmd{\HUGE} writings do not request script sizes greater than 24.88pt.
%    However, the main (i.\,e.\ non-script) symbols of math expressions in 
%    \cmd{\HUGE}, or even in \cmd{\Huge} (for \opt{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 \opt{ecpatch} option or get a recent 
%    version of \LaTeX\ and of the \fntec\ fonts.)
%
%  \item
%    As another effect of the main symbol size shrinking, 
%    the vertical position of the main math axis is lowered,
%    thereby moving fraction rules towards the denominators.
%
%  \item
%    The calculation of the amount of vertical space available within a 
%    normal line yields wrong results if fonts with the desired size 
%    are not available.
%    In detail, the appearant amount of free vertical space gets increased by 
%    twice the difference between the requested font size and the size chosen 
%    by \NFSS\@.
%
%    If you use properly-declared \fntec\ fonts for testing the samples,
%    this problem should not occur.
%  \end{itemize}
%
%  By adding extreme magnification factors to the \fntcm\ font declarations, 
%  I have verified that the aforementioned artifacts disappear 
%  when math fonts in the requested sizes are made available (though heavily 
%  ``bolded'' by the magnification).
%  However, I have not included that hack for demonstration,
%  in order not to provide any means for over-using the \fntcm\ math fonts.
%  According to the \LaTeXe\ newsletters \fln{ltnews09.tex} 
%  and \fln{ltnews11.tex}, \TeX\ users can look forward to a modern 
%  math font concept allowing easy setup and use of alternate math fonts.
%  Therefore, making documents which explicitly misuse \fntcm\ fonts for 
%  huge math expressions would be counterproductive.
%  However, even without math fonts at more than 24.88pt, the improvements 
%  in typesetting huge math expressions can be demonstrated by varying 
%  the options passed to the \this\ package in the test file \testfile.
%
%\StopEventually{}
%\section{Package Code}
%  This section documents the contents of the ready-to-use package file 
%  \thisfln{.sty}.
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
%  \subsection{Preliminaries}
%    Announce the file as a \LaTeXe\ package.
%    \begin{macrocode}
\ProvidesPackage{moresize}[1999/07/26 v1.9 (more font sizes)]
%    \end{macrocode}
%
%  \begin{macro}{\@xxxpt}
%  \begin{macro}{\@xxxvipt}
%    As a convention, declare macros for the new point sizes.
%    \begin{macrocode}
\providecommand\@xxxpt{29.86}
\providecommand\@xxxvipt{35.83}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \subsection{Size Selection Commands}
%  \begin{macro}{\HUGE}
%  \begin{macro}{\ssmall}
%    Define the author commands \cmd{\HUGE} and \cmd{\ssmall}, 
%    depending on the main document font size option.
%    In case of \opt{12pt}, fix the clipping of \cmd{\Huge} which 
%    occurs in \fln{size12.clo} (\fln{classes.dtx}).
%    \begin{macrocode}
\DeclareOption{10pt}{
  \def\ssmall{\@setfontsize\ssmall\@vipt\@viipt}
  \def\HUGE{\@setfontsize\HUGE\@xxxpt{36}}}
\DeclareOption{11pt}{
  \def\ssmall{\@setfontsize\ssmall\@viipt\@viiipt}
  \def\HUGE{\@setfontsize\HUGE\@xxxpt{36}}}
\DeclareOption{12pt}{
  \def\ssmall{\@setfontsize\ssmall\@viipt\@viiipt}
  \def\Huge{\@setfontsize\Huge\@xxxpt{36}}
  \def\HUGE{\@setfontsize\HUGE\@xxxvipt{43}}}
%    \end{macrocode}
%    The definitions given here are similar to most size command definitions 
%    in \LaTeXe's \fln{classes.dtx}.
%    The following rules have been observed and taken as guidelines:
%    \begin{itemize}
%    \item
%      Size commands other than \cmd{\footnotesize}--\cmd{\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.
%    \item
%      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.
%    \end{itemize}
%  \end{macro}
%  \end{macro}
%
%  \subsection{Math Size Options}
%    Consider the declarations in \LaTeXe's \fln{fontdef.dtx}:
%    \begin{quote}
%\begin{verbatim}
%\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}
%\end{verbatim}
%    \end{quote}
%    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 \opt{normalscripts}:
%    \begin{macrocode}
\DeclareOption{normalscripts}{
  \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xviipt}{\@xivpt}}
%    \end{macrocode}
%
%    In any case, declare math sizes for the new point sizes.
%    \begin{macrocode}
\DeclareMathSizes{\@xxxpt}{\@xxxpt}{\@xxpt}{\@xviipt}
\DeclareMathSizes{\@xxxvipt}{\@xxxvipt}{\@xxvpt}{\@xxpt}
%    \end{macrocode}
%
%    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.
%    \begin{macrocode}
\DeclareOption{smallscripts}{
  \DeclareMathSizes{\@xviipt}{\@xviipt}{\@xiipt}{8}
  \DeclareMathSizes{\@xxpt}{\@xxpt}{\@xivpt}{\@xpt}
  \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xviipt}{\@xiipt}
  \DeclareMathSizes{\@xxxpt}{\@xxxpt}{\@xxpt}{\@xivpt}
  \DeclareMathSizes{\@xxxvipt}{\@xxxvipt}{\@xxvpt}{\@xviipt}}
%    \end{macrocode}
%
%  \subsection{\fntec\ Font Declaration Patch}
%  \begin{macro}{\UndeclareFontFamily}
%    |\UndeclareFontFamily|\marg{ENC}\marg{family} makes \NFSS\ forget 
%    the font information for the font family \meta{family} with encoding 
%    \meta{ENC} and thus causes the corresponding font declaration file 
%    (\fln{\meta{enc}\meta{family}.fd}) to be reloaded on demand.
%    \begin{macrocode}
\newcommand\UndeclareFontFamily[2]{%
  \global\expandafter\let\csname#1+#2\endcsname\relax}
%    \end{macrocode}
%  \end{macro}
%
%    The \fntec\ font declaration patch is an optional bug fix, 
%    and possibly obsolete.
%    \begin{macrocode}
\DeclareOption{ecpatch}{
  \typeout
    {*** Using EC font declaration patch for pre-1998 LaTeX2e releases ***}
%    \end{macrocode}
%
%  \begin{macro}{\EC@family}
%    Declaration of font families from the \fntec\ or the previously 
%    released \fntdc\ edition is done by the macro \cmd{\EC@family}.
%    It is defined in the relevant font definition files by means of 
%    \cmd{\providecommand}.
%    Hence, predefining this macro will override the definition given in the 
%    \fln{fd} files.
%    Now take the original definition and complete the size specification 
%    with 29.86pt and 35.83pt entries.
%    Since \cmd{\nfss@catcodes} have not been activated, white space in the 
%    \cmd{\DeclareFontShape} call must be avoided.
%    \begin{macrocode}
  \def\EC@family#1#2#3#4#5{%
    \DeclareFontShape{#1}{#2}{#3}{#4}{%
      <5><6><7><8><9><10><10.95><12><14.4>%
      <17.28><20.74><24.88><29.86><35.83>genb*#5}{}}
%    \end{macrocode}
%  \end{macro}
%  \begin{macro}{\EC@ttfamily}
%    For the typewriter families, a similar macro is used.
%    \begin{macrocode}
  \def\EC@ttfamily#1#2#3#4#5{%
    \DeclareFontShape{#1}{#2}{#3}{#4}{%
      <5><6><7><8>#50800%
      <9><10><10.95><12><14.4><17.28><20.74><24.88>%
      <29.86><35.83>genb*#5}{}}
%    \end{macrocode}
%  \end{macro}
%
%    Now undeclare font families that are usually mapped 
%    to \fntec\ or \fntdc\ fonts.
%    On demand, they will be redeclared under control of the predefined 
%    \cmd{\EC@family} or \cmd{\EC@ttfamily} macros.
%    \begin{macrocode}
  \UndeclareFontFamily{T1}{cmr}
  \UndeclareFontFamily{TS1}{cmr}
  \UndeclareFontFamily{T1}{cmss}
  \UndeclareFontFamily{TS1}{cmss}
  \UndeclareFontFamily{T1}{cmtt}
  \UndeclareFontFamily{TS1}{cmtt}
  \UndeclareFontFamily{T1}{cmvtt}
  \UndeclareFontFamily{TS1}{cmvtt}
  \UndeclareFontFamily{T1}{cmsc}% from `smallcap' package
  \UndeclareFontFamily{T1}{cmdh}
  \UndeclareFontFamily{T1}{cmfib}
  \UndeclareFontFamily{T1}{cmfr}
%    \end{macrocode}
%    The patch is now complete.
%    \begin{macrocode}
}
%    \end{macrocode}
%    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.
%
%  \subsection{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.
%    \begin{macrocode}
\ExecuteOptions{10pt}
%    \end{macrocode}
%    Before processing the package options, a configuration file 
%    \thisfln{.cfg} may be input, 
%    typically containing |\ExecuteOptions{ecpatch}| 
%    for systems with installed \fntec\ fonts and a \LaTeXe\ version 
%    released before 1998.
%    \begin{macrocode}
\InputIfFileExists{moresize.cfg}{}{}
\ProcessOptions
%</package>
%    \end{macrocode}
%
%\section{Test Code}
%  This section documents the contents of the test document source file 
%  \testfile.
%    \begin{macrocode}
%<*testfile>
%    \end{macrocode}
%
%  This is a \LaTeXe\ document.
%    \begin{macrocode}
%% This is a test file for text and math size settings.
%% You might want to test several configurations.  Therefore,
%% it might be a good idea to save different versions of this file
%% under different names.
\documentclass[11pt,a4paper]{article}
\usepackage{exscale}    %% for scaled \sum, \int etc.

%    \end{macrocode}
%
%  Here the package of interest is loaded.
%    \begin{macrocode}
%% Available options for the `moresize' package:
%%   10pt, 11pt, 12pt   (in \documentclass) determines font sizes
%%   normalscripts      avoid script size explosion in huge writings
%%   smallscripts       smaller, more appropriate script sizes
%%   ecpatch            tell NFSS that huge EC fonts are available
\usepackage[smallscripts]{moresize}

%    \end{macrocode}
%
%  For testing the 29.86pt and 35.83pt sizes, the T1-encoded \fntec\ or 
%  \fntdc\ fonts may be needed.
%    \begin{macrocode}
%% Use the `t1enc' package for testing with DC/EC fonts
\usepackage{t1enc}

%    \end{macrocode}
%
%  \begin{macro}{\calcmathspace}
%  \begin{macro}{\mathht}
%  \begin{macro}{\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 \cmd{\calcmathspace}.
%    When called, \cmd{\calcmathspace} uses the caller's current text size 
%    and \cmd{\baselineskip} settings as well as height and depth of the 
%    characters |[| and |]| from the roman text font for estimating 
%    the height and depth which an inline math expression may have.
%    The results are stored in the length parameters \cmd{\mathht} and 
%    \cmd{\mathdp}, respectively.
%    \begin{macrocode}
%% Consider a paragraph with a text line of depth d (below the baseline),
%% followed by a line with an inline formula,
%% followed by a text line with height h (above the baseline).
%% Then the formula's height may not exceed \baselineskip - d,
%% and its depth may not exceed \baselineskip - h,
%% or the baseline skips will be stretched.
%% The roman-text brackets `[' and `]' are used for estimating d and h.
%% Note that the space for the formula seems to get larger if NFSS
%% substitutes a smaller font, because \baselineskip does not shrink
%% accordingly!
\newlength\mathht       %% height available for an inline formula
\newlength\mathdp       %% depth available for an inline formula
\newcommand\calcmathspace{%
        \settodepth\mathht{\textrm{[}}%
        \setlength\mathht{-\mathht}%
        \addtolength\mathht{\baselineskip}%
        \settoheight\mathdp{\textrm{]}}%
        \setlength\mathdp{-\mathdp}%
        \addtolength\mathdp{\baselineskip}}

%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\linebox}
%    The command \cmd{\linebox}\marg{text} typesets \meta{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.
%    \begin{macrocode}
%% The following command shows its argument, typeset in text style,
%% between two horizontal lines showing the available space in a text line.
%% If the argument overprints the lines, it would stretch
%% the baseline skip in a paragraph.
\newcommand\linebox[1]{\calcmathspace\begin{tabular}{@{}l@{}}\hline
        \raisebox{0pt}[\mathht][\mathdp]{#1}\\\hline\end{tabular}}

%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\msample}
%    The macro \cmd{\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.
%    \begin{macrocode}
%% A macro for sample math expressions.
%% The original definition gives expressions which should fit into
%% paragraphs without enlarging the baseline skip.
%% For variable-sized \sum or \int symbols, \usepackage{exscale} is needed.
%% Caution: Main (i.e. non-script) symbols are 24.88pt maximum 
%% with CM math fonts. You may try using text fonts instead,
%% but some vertical positionings and spacings still go wrong then.
\newcommand\msample{\ensuremath{
    \frac{X}{Y}
\,  g^{i_1\ldots i_n}_{j_1\ldots j_n}
\,  \frac{t^2}{2!}
\,  e^{-\frac{t}{\tau}}
}}

%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\Size}
%    Interested testers may like to directly specify point sizes instead of 
%    using author commands.
%    The command \cmd{\Size}\marg{font size}\marg{baselineskip} 
%    is provided for easying such specifications.
%    \meta{font size} and \meta{baselineskip} must be specified as numbers 
%    of pt, with the |pt| omitted.
%    \begin{macrocode}
%% None of the size options 10pt, 11pt, and 12pt offers the entire spectrum
%% of available font sizes.
%% For example, the 10pt option offers no command for selecting 10.95pt,
%% and the 12pt option does not provide a command for 9pt.
%% The 11pt option fills both gaps, but misses the extremes 35.83pt and 5pt.
%% Therefore, a shorthand for lower-level size switches is provided.
%% E.g. \Size{20.74}{25} selects a 20.74pt font size with 25pt baselineskip.
\newcommand\Size[2]{\fontsize{#1}{#2}\selectfont}

%    \end{macrocode}
%  \end{macro}
%
%  Now typesetting can begin.  Only one page should be needed.
%  Remember to echo the options used.
%    \begin{macrocode}
\begin{document}
\parindent0pt

%% The test output should fit onto one page
\pagestyle{empty}
\enlargethispage{1in}

%% Don't forget to list the moresize options in the test output!
\textsf{moresize} options:
%%[10pt]
[11pt]
%%[12pt]
%%[normalscripts]
[smallscripts]
%%[ecpatch]

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

%    \end{macrocode}
%
%  Now comes a table containing samples at sizes down to 5pt.
%  The original font size directives are intended for use with the \opt{11pt} 
%  option; with \opt{12pt} (\opt{10pt}) instead, the 35.83pt (5pt) size would 
%  appear twice.
%    \begin{macrocode}
\begin{center}
\newcommand\n{\\\\[-1ex]}       %% for separating the tabular lines
\begin{tabular}{@{}ll@{}}
        \Size{35.83}{43}\linebox{36pt}
                                & \Size{35.83}{43}\linebox{\msample}
\n      \HUGE\linebox{HUGE}     & \HUGE\linebox{\msample}
\n      \Huge\linebox{Huge}     & \Huge\linebox{\msample}
\n      \huge\linebox{huge}     & \huge\linebox{\msample}
\n      \LARGE\linebox{LARGE}   & \LARGE\linebox{\msample}
\n      \Large\linebox{Large}   & \Large\linebox{\msample}
\n      \large\linebox{large}   & \large\linebox{\msample}
\n      \normalsize\linebox{normalsize}
                                & \normalsize\linebox{\msample}
\n      \small\linebox{small}   & \small\linebox{\msample}
\n      \footnotesize\linebox{footnotesize}
                                & \footnotesize\linebox{\msample}
\n      \scriptsize\linebox{scriptsize}
                                & \scriptsize\linebox{\msample}
\n      \ssmall\linebox{ssmall} & \ssmall\linebox{\msample}
\n      \tiny\linebox{tiny}     & \tiny\linebox{\msample}
\n      \Size{5}{6}\linebox{5pt}
                                & \Size{5}{6}\linebox{\msample}
\end{tabular}
\end{center}
%    \end{macrocode}
%
%  That's all on one test page.
%    \begin{macrocode}
\end{document}
%</testfile>
%    \end{macrocode}
%\endinput
