Debian Codegraph @

texmf-dist/source/latex/moresize/moresize.dtx

raw
1 %\iffalse <Not read by DocStrip>
2 % Copyright 1997,1998,1999 Christian Cornelssen
3 % This program can be redistributed and/or modified under the terms
4 % of the LaTeX Project Public License Distributed from CTAN
5 % archives in directory macros/latex/base/lppl.txt; either
6 % version 1 of the License, or any later version.
7 %<*driver>
8 \documentclass{ltxdoc}
9 \begin{document}
10 \DocInput{moresize.dtx}
11 \end{document}
12 %</driver>
13 %\fi
14 %\def\basename{moresize}
15 %\def\fileversion{v1.9}
16 %\def\filedate{1999/07/26}
17 %\newcommand\testfile[1][.tex]{\fln{msizetst#1}}
18 %\newcommand\fnt[1]{\textrm{#1}} ^^A for fonts
19 %\newcommand\fln[1]{\texttt{#1}} ^^A for filenames
20 %\newcommand\pkg[1]{\textsf{#1}} ^^A for packages
21 %\newcommand\opt[1]{\texttt{#1}} ^^A for package options
22 %\newcommand\env[1]{\texttt{#1}} ^^A for environments
23 %\newcommand\this{\pkg{\basename}} ^^A for this package
24 %\newcommand\thisfln[1]{\fln{\basename #1}} ^^A for related files
25 %\newcommand\fntcm{\fnt{CM}}
26 %\newcommand\fntdc{\fnt{DC}}
27 %\newcommand\fntec{\fnt{EC}}
28 %\newcommand\NFSS{\textrm{NFSS}}
29 %\providecommand\MF{\textsc{Metafont}}
30 %\title{\this: More font sizes with \LaTeX}
31 %\author{Christian Cornelssen (\texttt{[email protected]})}
32 %\date{\fileversion\ [\filedate]}
33 %\maketitle
34 %\section{Introduction}
35 % When writing yet another \LaTeX\ introduction with a demonstration of
36 % font sizes, I discovered that \cmd{\Huge} and \cmd{\huge} were set to
37 % the same size. No good for a demonstration! I localized the definition
38 % in the \fln{size12.clo} class option file and found that the font size
39 % for \cmd{\Huge} had to be increased from 24.88pt to 29.86pt.
40 %
41 % \DescribeMacro{\HUGE}
42 % Therefore, I produced a package \this\ redefining \cmd{\Huge} and
43 % defining an even ``bigger'' font size command \cmd{\HUGE}, because I
44 % wanted to be able to use font sizes up to 35.83pt, as provided by the
45 % \fntec\ fonts' standard edition.
46 %
47 % \DescribeMacro{\ssmall}
48 % Additionally, I defined a size command \cmd{\ssmall} filling the
49 % gap between the sizes selectable by \cmd{\tiny} and \cmd{\scriptsize}.
50 %
51 % The documentation in the \LaTeXe\ distribution's source file
52 % \fln{fontdef.dtx} reminded me to also declare math sizes for the new
53 % text sizes.
54 % When studying the docs, I found that the math script sizes defined in
55 % \fln{fontdef.dtx} grew faster than the text sizes, and that at least
56 % the script sizes for 24.88pt seemed to be absolutely inappropriate.
57 % Therefore, I designed two sets of text/math size combinations
58 % including the new 29.86pt and 35.83pt text sizes,
59 % one set just fixing the 25pt math script and scriptscript sizes,
60 % and another one with somewhat smaller scriptscript sizes in order to
61 % maintain the typical $10:7:5$ ratio for text sizes from 10pt upwards.
62 % The math size changings can be activated by means of options
63 % passed to the \this\ package.
64 %
65 % For testing the new sizes and for visualizing the effects of the math size
66 % settings, a \LaTeX\ file \testfile\ containing sample text and math
67 % expressions at various sizes is provided.
68 %
69 %\section{User Interface}
70 % The \this\ package can be loaded by the \LaTeXe\ command
71 % \begin{quote}
72 % |\usepackage|\oarg{options}|{|\thisfln{}|}|
73 % \end{quote}
74 % By default, \this\ neither redefines existing macros nor changes
75 % the standard math size declarations.
76 % However, the package provides the additional font size selection commands
77 % \cmd{\HUGE} and \cmd{\ssmall}, and declares math sizes
78 % for the new 29.86pt and 35.83pt text sizes.
79 %
80 % Available Options are:
81 % \begin{description}
82 % \item[\opt{10pt}]
83 % This option provides the same settings as the default.
84 % \cmd{\HUGE} is defined to select a 29.86pt font size, and
85 % \cmd{\ssmall} is made to give 6pt.
86 % These definitions continuously extend the set of size commands given in
87 % the \fln{size10.clo} standard class option file.
88 %
89 % \item[\opt{11pt}]
90 % This option makes \cmd{\HUGE} and \cmd{\ssmall} select 29.86pt and
91 % 7pt, respectively, which is suitable for use with the settings given in
92 % the \fln{size11.clo} standard class option file.
93 %
94 % \item[\opt{12pt}]
95 % With this option, \cmd{\HUGE} and \cmd{\ssmall} are defined to
96 % select 35.83pt and 7pt, respectively.
97 %
98 % Additionally, the size selection command \cmd{\Huge} is redefined
99 % to give 29.86pt.
100 % This is done because the setting given in the \fln{size12.clo} standard
101 % class option file saturates the \cmd{\Huge} font size at the same level
102 % as given by \cmd{\huge} (24.88pt)---presumably with the \fntcm\ font
103 % restrictions of old \LaTeX~2.09 in mind.
104 % Nowadays, with \LaTeXe's flexible \NFSS, font size selection commands
105 % are not associated with a predetermined font family any longer,
106 % hence such restrictions are out of place.
107 % Note that \NFSS\ automatically resorts to lower sizes if a demanded font
108 % size is not available, so standard \fntcm\ font users will not be
109 % affected by the new size settings, but \fntec\ font users can benefit
110 % from them.
111 %
112 % \item[\opt{ecpatch}]
113 % This is a bug fix for the \fntec\ font declarations given in the
114 % \LaTeXe\ releases from December 1996 through December 1997.
115 % Therein, the declarations of the \fntec\ fonts do not include
116 % font sizes above 24.88pt, although the \fntec\ font standard edition
117 % provides font metrics files for 29.86pt and 35.83pt.
118 % As a consequence, \NFSS\ would deny usage of those font sizes
119 % and substitute 24.88pt instead.
120 %
121 % The \opt{ecpatch} option installs macros which override any declaration
122 % of an \fntec\ font with an own declaration including the 29.86pt
123 % and 35.83pt sizes.
124 %
125 % Regard this patch as a temporary bug fix; the proper way requires
126 % updating the \LaTeXe\ distribution source file \fln{cmfonts.fdd}
127 % from which the \fln{t1cm*.fd} files are generated, and remaking the
128 % \LaTeXe\ format file.
129 % Indeed, a proper fix has been incorporated into the \LaTeXe\
130 % distribution shortly after December 1997; therefore, recent distributions
131 % should not require the \opt{ecpatch} option.
132 %
133 % As can be concluded from the above, the decision whether to use
134 % \opt{ecpatch} or not should be determined by the availibility of
135 % \fntec\ (\emph{not} \fntdc!) fonts and by the version of the
136 % \LaTeXe\ base distribution both of which may vary independently from the
137 % author's main \LaTeX\ input file.
138 % Therefore, the appropriate spot for invoking \opt{ecpatch}
139 % is a configuration file placed somewhere in the \LaTeXe\ input
140 % directory tree with filename \thisfln{.cfg},
141 % containing a line like
142 % \begin{quote}
143 %\begin{verbatim}
144 %\ExecuteOptions{ecpatch}
145 %\end{verbatim}
146 % \end{quote}
147 % This frees authors of \LaTeXe\ input files from the need of specifying
148 % \opt{ecpatch} themselves when using the \this\ package
149 % and thus preserves the portability of \LaTeXe\ documents across
150 % different \LaTeXe\ releases.
151 %
152 % Note that \opt{ecpatch} is useful only if the following conditions
153 % are met:
154 % \begin{enumerate}
155 % \item
156 % The ``official'' \fntec\ fonts are available,
157 % including TFM files for the sizes 29.86pt and 35.83pt.
158 % With \fntdc\ fonts instead, \opt{ecpatch} will not work
159 % correctly.\footnote{
160 % \opt{ecpatch} may work with the last (``new'')
161 % \fntdc\ font release if provided with TFM files for all standard
162 % \fntec\ font sizes.
163 % Typically, the 29.86pt size would be missing.}
164 % \item
165 % The \LaTeXe\ base has been configured to support \fntec\ fonts
166 % (i.e.\ \fln{cmfonts.fdd} has been unpacked by \fln{ec.ins}\footnote{
167 % Using \fln{newdc.ins} for \fntdc\ fonts with all TFM files mentioned
168 % above could also work.}).
169 % \item
170 % The \LaTeXe\ base (or at least its \fln{cmfonts.fdd}) has a release
171 % date before 1998. Later releases do not need \opt{ecpatch}.\footnote{
172 % Applying \opt{ecpatch} to newer \LaTeXe\ releases has not caused
173 % any harm in my testings so far.}
174 % \end{enumerate}
175 % Anyway---upgrading your system to a recent \LaTeXe\ base
176 % with ``official'' \fntec\ fonts would be a better solution
177 % than using \opt{ecpatch}.
178 %
179 % \item[\opt{normalscripts}]
180 % This option decreases the script and scriptscript sizes associated
181 % with the 24.88pt text size by one magstep, in order to damp the
182 % script size explosion defined in the \LaTeXe\ source file
183 % \fln{fontdef.dtx}.
184 % With this setting, a formula like $\frac{X}{Y}$ within a \cmd{\Huge}
185 % paragraph (e.\,g.\ a document title) does no longer affect line spacing,
186 % as should be.
187 %
188 % \item[\opt{smallscripts}]
189 % Starting from the \opt{normalscripts} math size settings, this option
190 % further reduces the scriptscript sizes associated with text sizes of
191 % 17.28pt and above.
192 % The idea behind this is to maintain an approximate $10:7:5$ ratio
193 % between text, script, and scriptscript sizes in bigger-than-normal
194 % writings.
195 % \end{description}
196 %
197 % The math script size option names roughly describe the changes to the
198 % standard \LaTeX\ setup.
199 % Therefore, \opt{normalscripts} may not look ``normal'' in the sense of
200 % ``just right'', but differs from the standard setup in 24.88pt
201 % writings only.
202 % I prefer \opt{smallscripts} which results in scriptscript sizes that are
203 % not really small---they are simply not as big as the standard ones.
204 % Note that this option only affects math expressions with nested fractions
205 % and/or sub-/superscripts in large writings (17.28pt text size and above),
206 % e.\,g.\ in titles or section headers.
207 % Therefore, it is quite likely that you have not encountered an example
208 % of that kind so far.
209 % But once you have, you should remember this package\dots
210 %
211 %\section{The test file \testfile}
212 % A test file \testfile\ is provided for evaluating the math size
213 % settings. You may rename it and then manipulate it as you wish,
214 % typically for testing the options passed to the \this\ package.
215 % The test document shows sample text and math expressions at various
216 % sizes, each framed above and below by horizontal lines delimiting the
217 % amount of vertical space that is normally available for math expressions
218 % within paragraphs of text.
219 % If the expressions overprint the delimiters, they are likely to cause
220 % stretching of the baseline skip when used within a paragraph.
221 %
222 % However, the output for sizes above 24.88pt may be erroneous or
223 % misleading under certain circumstances:
224 % \begin{itemize}
225 % \item
226 % Even when using \fntec\ text fonts, math expressions may still use
227 % \fntcm\ fonts which are limited to 24.88pt in their declarations
228 % to \NFSS\@.
229 % This does not matter for scripts and scriptscripts because even
230 % \cmd{\HUGE} writings do not request script sizes greater than 24.88pt.
231 % However, the main (i.\,e.\ non-script) symbols of math expressions in
232 % \cmd{\HUGE}, or even in \cmd{\Huge} (for \opt{12pt} documents),
233 % will be shrinked to 24.88pt size,
234 % thereby issuing \NFSS\ warnings about unavailable font sizes
235 % for OT1, OML, or OMS encodings.
236 % (If there are messages about unavailable T1 font sizes,
237 % you should try the \opt{ecpatch} option or get a recent
238 % version of \LaTeX\ and of the \fntec\ fonts.)
239 %
240 % \item
241 % As another effect of the main symbol size shrinking,
242 % the vertical position of the main math axis is lowered,
243 % thereby moving fraction rules towards the denominators.
244 %
245 % \item
246 % The calculation of the amount of vertical space available within a
247 % normal line yields wrong results if fonts with the desired size
248 % are not available.
249 % In detail, the appearant amount of free vertical space gets increased by
250 % twice the difference between the requested font size and the size chosen
251 % by \NFSS\@.
252 %
253 % If you use properly-declared \fntec\ fonts for testing the samples,
254 % this problem should not occur.
255 % \end{itemize}
256 %
257 % By adding extreme magnification factors to the \fntcm\ font declarations,
258 % I have verified that the aforementioned artifacts disappear
259 % when math fonts in the requested sizes are made available (though heavily
260 % ``bolded'' by the magnification).
261 % However, I have not included that hack for demonstration,
262 % in order not to provide any means for over-using the \fntcm\ math fonts.
263 % According to the \LaTeXe\ newsletters \fln{ltnews09.tex}
264 % and \fln{ltnews11.tex}, \TeX\ users can look forward to a modern
265 % math font concept allowing easy setup and use of alternate math fonts.
266 % Therefore, making documents which explicitly misuse \fntcm\ fonts for
267 % huge math expressions would be counterproductive.
268 % However, even without math fonts at more than 24.88pt, the improvements
269 % in typesetting huge math expressions can be demonstrated by varying
270 % the options passed to the \this\ package in the test file \testfile.
271 %
272 %\StopEventually{}
273 %\section{Package Code}
274 % This section documents the contents of the ready-to-use package file
275 % \thisfln{.sty}.
276 % \begin{macrocode}
277 %<*package>
278 % \end{macrocode}
279 %
280 % \subsection{Preliminaries}
281 % Announce the file as a \LaTeXe\ package.
282 % \begin{macrocode}
283 \ProvidesPackage{moresize}[1999/07/26 v1.9 (more font sizes)]
284 % \end{macrocode}
285 %
286 % \begin{macro}{\@xxxpt}
287 % \begin{macro}{\@xxxvipt}
288 % As a convention, declare macros for the new point sizes.
289 % \begin{macrocode}
290 \providecommand\@xxxpt{29.86}
291 \providecommand\@xxxvipt{35.83}
292 % \end{macrocode}
293 % \end{macro}
294 % \end{macro}
295 %
296 % \subsection{Size Selection Commands}
297 % \begin{macro}{\HUGE}
298 % \begin{macro}{\ssmall}
299 % Define the author commands \cmd{\HUGE} and \cmd{\ssmall},
300 % depending on the main document font size option.
301 % In case of \opt{12pt}, fix the clipping of \cmd{\Huge} which
302 % occurs in \fln{size12.clo} (\fln{classes.dtx}).
303 % \begin{macrocode}
304 \DeclareOption{10pt}{
305 \def\ssmall{\@setfontsize\ssmall\@vipt\@viipt}
306 \def\HUGE{\@setfontsize\HUGE\@xxxpt{36}}}
307 \DeclareOption{11pt}{
308 \def\ssmall{\@setfontsize\ssmall\@viipt\@viiipt}
309 \def\HUGE{\@setfontsize\HUGE\@xxxpt{36}}}
310 \DeclareOption{12pt}{
311 \def\ssmall{\@setfontsize\ssmall\@viipt\@viiipt}
312 \def\Huge{\@setfontsize\Huge\@xxxpt{36}}
313 \def\HUGE{\@setfontsize\HUGE\@xxxvipt{43}}}
314 % \end{macrocode}
315 % The definitions given here are similar to most size command definitions
316 % in \LaTeXe's \fln{classes.dtx}.
317 % The following rules have been observed and taken as guidelines:
318 % \begin{itemize}
319 % \item
320 % Size commands other than \cmd{\footnotesize}--\cmd{\normalsize} are
321 % not intended for typesetting document structures more complex
322 % than paragraphs.
323 % Therefore, their definitions do not contain specifications
324 % of dimension parameters for list environments or displayed equations.
325 % \item
326 % Baselineskips for text sizes below 8pt are chosen to be
327 % 1pt higher than the text size.
328 % Baselineskips above 10pt are set to somewhat rounded pt sizes
329 % around 1.2~times the text size.
330 % \end{itemize}
331 % \end{macro}
332 % \end{macro}
333 %
334 % \subsection{Math Size Options}
335 % Consider the declarations in \LaTeXe's \fln{fontdef.dtx}:
336 % \begin{quote}
337 %\begin{verbatim}
338 %\DeclareMathSizes{\@xpt}{\@xpt}{7}{5}
339 %\DeclareMathSizes{\@xipt}{\@xipt}{8}{6}
340 %\DeclareMathSizes{\@xiipt}{\@xiipt}{8}{6}
341 %\DeclareMathSizes{\@xivpt}{\@xivpt}{\@xpt}{7}
342 %\DeclareMathSizes{\@xviipt}{\@xviipt}{\@xiipt}{\@xpt}
343 %\DeclareMathSizes{\@xxpt}{\@xxpt}{\@xivpt}{\@xiipt}
344 %\DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xxpt}{\@xviipt}
345 %\end{verbatim}
346 % \end{quote}
347 % The script and scriptscript sizes for |\@xxvpt| are one magstep
348 % bigger than the sizes extrapolated from the context.
349 % This seems to be an error. And in fact, fractions like $\frac{X}{Y}$
350 % placed in 25pt text strech the baseline skip, whereas this does not
351 % happen at lower sizes.
352 %
353 % This will be fixed when given the option \opt{normalscripts}:
354 % \begin{macrocode}
355 \DeclareOption{normalscripts}{
356 \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xviipt}{\@xivpt}}
357 % \end{macrocode}
358 %
359 % In any case, declare math sizes for the new point sizes.
360 % \begin{macrocode}
361 \DeclareMathSizes{\@xxxpt}{\@xxxpt}{\@xxpt}{\@xviipt}
362 \DeclareMathSizes{\@xxxvipt}{\@xxxvipt}{\@xxvpt}{\@xxpt}
363 % \end{macrocode}
364 %
365 % There remains a one-magstep ratio between the script and scriptscript
366 % sizes for text sizes above |\@xivpt|, whereas for text sizes between
367 % |\@xpt| and |\@xivpt|, approximately two magsteps are taken.
368 % An option is defined for applying the two-magsteps rule to text sizes
369 % above |\@xivpt|, including the new |\@xxxpt| and |\@xxxvipt| sizes.
370 % \begin{macrocode}
371 \DeclareOption{smallscripts}{
372 \DeclareMathSizes{\@xviipt}{\@xviipt}{\@xiipt}{8}
373 \DeclareMathSizes{\@xxpt}{\@xxpt}{\@xivpt}{\@xpt}
374 \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xviipt}{\@xiipt}
375 \DeclareMathSizes{\@xxxpt}{\@xxxpt}{\@xxpt}{\@xivpt}
376 \DeclareMathSizes{\@xxxvipt}{\@xxxvipt}{\@xxvpt}{\@xviipt}}
377 % \end{macrocode}
378 %
379 % \subsection{\fntec\ Font Declaration Patch}
380 % \begin{macro}{\UndeclareFontFamily}
381 % |\UndeclareFontFamily|\marg{ENC}\marg{family} makes \NFSS\ forget
382 % the font information for the font family \meta{family} with encoding
383 % \meta{ENC} and thus causes the corresponding font declaration file
384 % (\fln{\meta{enc}\meta{family}.fd}) to be reloaded on demand.
385 % \begin{macrocode}
386 \newcommand\UndeclareFontFamily[2]{%
387 \global\expandafter\let\csname#1+#2\endcsname\relax}
388 % \end{macrocode}
389 % \end{macro}
390 %
391 % The \fntec\ font declaration patch is an optional bug fix,
392 % and possibly obsolete.
393 % \begin{macrocode}
394 \DeclareOption{ecpatch}{
395 \typeout
396 {*** Using EC font declaration patch for pre-1998 LaTeX2e releases ***}
397 % \end{macrocode}
398 %
399 % \begin{macro}{\EC@family}
400 % Declaration of font families from the \fntec\ or the previously
401 % released \fntdc\ edition is done by the macro \cmd{\EC@family}.
402 % It is defined in the relevant font definition files by means of
403 % \cmd{\providecommand}.
404 % Hence, predefining this macro will override the definition given in the
405 % \fln{fd} files.
406 % Now take the original definition and complete the size specification
407 % with 29.86pt and 35.83pt entries.
408 % Since \cmd{\nfss@catcodes} have not been activated, white space in the
409 % \cmd{\DeclareFontShape} call must be avoided.
410 % \begin{macrocode}
411 \def\EC@family#1#2#3#4#5{%
412 \DeclareFontShape{#1}{#2}{#3}{#4}{%
413 <5><6><7><8><9><10><10.95><12><14.4>%
414 <17.28><20.74><24.88><29.86><35.83>genb*#5}{}}
415 % \end{macrocode}
416 % \end{macro}
417 % \begin{macro}{\EC@ttfamily}
418 % For the typewriter families, a similar macro is used.
419 % \begin{macrocode}
420 \def\EC@ttfamily#1#2#3#4#5{%
421 \DeclareFontShape{#1}{#2}{#3}{#4}{%
422 <5><6><7><8>#50800%
423 <9><10><10.95><12><14.4><17.28><20.74><24.88>%
424 <29.86><35.83>genb*#5}{}}
425 % \end{macrocode}
426 % \end{macro}
427 %
428 % Now undeclare font families that are usually mapped
429 % to \fntec\ or \fntdc\ fonts.
430 % On demand, they will be redeclared under control of the predefined
431 % \cmd{\EC@family} or \cmd{\EC@ttfamily} macros.
432 % \begin{macrocode}
433 \UndeclareFontFamily{T1}{cmr}
434 \UndeclareFontFamily{TS1}{cmr}
435 \UndeclareFontFamily{T1}{cmss}
436 \UndeclareFontFamily{TS1}{cmss}
437 \UndeclareFontFamily{T1}{cmtt}
438 \UndeclareFontFamily{TS1}{cmtt}
439 \UndeclareFontFamily{T1}{cmvtt}
440 \UndeclareFontFamily{TS1}{cmvtt}
441 \UndeclareFontFamily{T1}{cmsc}% from `smallcap' package
442 \UndeclareFontFamily{T1}{cmdh}
443 \UndeclareFontFamily{T1}{cmfib}
444 \UndeclareFontFamily{T1}{cmfr}
445 % \end{macrocode}
446 % The patch is now complete.
447 % \begin{macrocode}
448 }
449 % \end{macrocode}
450 % Of course, a proper way in \NFSS\ for adding size specifications to
451 % existing font shape declarations would be appreciated.
452 % But once the fonts are declared properly, this should not be necessary
453 % at all.
454 %
455 % \subsection{Configuration}
456 % In the standard classes, 10pt writing is the default.
457 % Therefore, the same is assumed here.
458 % Global options or explicitly given package options may override this.
459 % \begin{macrocode}
460 \ExecuteOptions{10pt}
461 % \end{macrocode}
462 % Before processing the package options, a configuration file
463 % \thisfln{.cfg} may be input,
464 % typically containing |\ExecuteOptions{ecpatch}|
465 % for systems with installed \fntec\ fonts and a \LaTeXe\ version
466 % released before 1998.
467 % \begin{macrocode}
468 \InputIfFileExists{moresize.cfg}{}{}
469 \ProcessOptions
470 %</package>
471 % \end{macrocode}
472 %
473 %\section{Test Code}
474 % This section documents the contents of the test document source file
475 % \testfile.
476 % \begin{macrocode}
477 %<*testfile>
478 % \end{macrocode}
479 %
480 % This is a \LaTeXe\ document.
481 % \begin{macrocode}
482 %% This is a test file for text and math size settings.
483 %% You might want to test several configurations. Therefore,
484 %% it might be a good idea to save different versions of this file
485 %% under different names.
486 \documentclass[11pt,a4paper]{article}
487 \usepackage{exscale} %% for scaled \sum, \int etc.
488
489 % \end{macrocode}
490 %
491 % Here the package of interest is loaded.
492 % \begin{macrocode}
493 %% Available options for the `moresize' package:
494 %% 10pt, 11pt, 12pt (in \documentclass) determines font sizes
495 %% normalscripts avoid script size explosion in huge writings
496 %% smallscripts smaller, more appropriate script sizes
497 %% ecpatch tell NFSS that huge EC fonts are available
498 \usepackage[smallscripts]{moresize}
499
500 % \end{macrocode}
501 %
502 % For testing the 29.86pt and 35.83pt sizes, the T1-encoded \fntec\ or
503 % \fntdc\ fonts may be needed.
504 % \begin{macrocode}
505 %% Use the `t1enc' package for testing with DC/EC fonts
506 \usepackage{t1enc}
507
508 % \end{macrocode}
509 %
510 % \begin{macro}{\calcmathspace}
511 % \begin{macro}{\mathht}
512 % \begin{macro}{\mathdp}
513 % The amount of vertical space usable for math expressions within
514 % a paragraph without probably stretching the baseline skip
515 % can be calculated by means of the macro \cmd{\calcmathspace}.
516 % When called, \cmd{\calcmathspace} uses the caller's current text size
517 % and \cmd{\baselineskip} settings as well as height and depth of the
518 % characters |[| and |]| from the roman text font for estimating
519 % the height and depth which an inline math expression may have.
520 % The results are stored in the length parameters \cmd{\mathht} and
521 % \cmd{\mathdp}, respectively.
522 % \begin{macrocode}
523 %% Consider a paragraph with a text line of depth d (below the baseline),
524 %% followed by a line with an inline formula,
525 %% followed by a text line with height h (above the baseline).
526 %% Then the formula's height may not exceed \baselineskip - d,
527 %% and its depth may not exceed \baselineskip - h,
528 %% or the baseline skips will be stretched.
529 %% The roman-text brackets `[' and `]' are used for estimating d and h.
530 %% Note that the space for the formula seems to get larger if NFSS
531 %% substitutes a smaller font, because \baselineskip does not shrink
532 %% accordingly!
533 \newlength\mathht %% height available for an inline formula
534 \newlength\mathdp %% depth available for an inline formula
535 \newcommand\calcmathspace{%
536 \settodepth\mathht{\textrm{[}}%
537 \setlength\mathht{-\mathht}%
538 \addtolength\mathht{\baselineskip}%
539 \settoheight\mathdp{\textrm{]}}%
540 \setlength\mathdp{-\mathdp}%
541 \addtolength\mathdp{\baselineskip}}
542
543 % \end{macrocode}
544 % \end{macro}
545 % \end{macro}
546 % \end{macro}
547 %
548 % \begin{macro}{\linebox}
549 % The command \cmd{\linebox}\marg{text} typesets \meta{text} in a box
550 % with fixed height and depth corresponding to a line that extends so high
551 % and so deep that it just touches the preceding and following lines
552 % which are assumed to contain ordinary text.
553 % The upper and lower bounds of the box are delimited by horizontal lines.
554 % \begin{macrocode}
555 %% The following command shows its argument, typeset in text style,
556 %% between two horizontal lines showing the available space in a text line.
557 %% If the argument overprints the lines, it would stretch
558 %% the baseline skip in a paragraph.
559 \newcommand\linebox[1]{\calcmathspace\begin{tabular}{@{}l@{}}\hline
560 \raisebox{0pt}[\mathht][\mathdp]{#1}\\\hline\end{tabular}}
561
562 % \end{macrocode}
563 % \end{macro}
564 %
565 % \begin{macro}{\msample}
566 % The macro \cmd{\msample} should contain fairly simple math expressions
567 % with nested sub- or superscripts and/or fractions which should fit
568 % into paragraphs of text without stretching the baseline skip.
569 % \begin{macrocode}
570 %% A macro for sample math expressions.
571 %% The original definition gives expressions which should fit into
572 %% paragraphs without enlarging the baseline skip.
573 %% For variable-sized \sum or \int symbols, \usepackage{exscale} is needed.
574 %% Caution: Main (i.e. non-script) symbols are 24.88pt maximum
575 %% with CM math fonts. You may try using text fonts instead,
576 %% but some vertical positionings and spacings still go wrong then.
577 \newcommand\msample{\ensuremath{
578 \frac{X}{Y}
579 \, g^{i_1\ldots i_n}_{j_1\ldots j_n}
580 \, \frac{t^2}{2!}
581 \, e^{-\frac{t}{\tau}}
582 }}
583
584 % \end{macrocode}
585 % \end{macro}
586 %
587 % \begin{macro}{\Size}
588 % Interested testers may like to directly specify point sizes instead of
589 % using author commands.
590 % The command \cmd{\Size}\marg{font size}\marg{baselineskip}
591 % is provided for easying such specifications.
592 % \meta{font size} and \meta{baselineskip} must be specified as numbers
593 % of pt, with the |pt| omitted.
594 % \begin{macrocode}
595 %% None of the size options 10pt, 11pt, and 12pt offers the entire spectrum
596 %% of available font sizes.
597 %% For example, the 10pt option offers no command for selecting 10.95pt,
598 %% and the 12pt option does not provide a command for 9pt.
599 %% The 11pt option fills both gaps, but misses the extremes 35.83pt and 5pt.
600 %% Therefore, a shorthand for lower-level size switches is provided.
601 %% E.g. \Size{20.74}{25} selects a 20.74pt font size with 25pt baselineskip.
602 \newcommand\Size[2]{\fontsize{#1}{#2}\selectfont}
603
604 % \end{macrocode}
605 % \end{macro}
606 %
607 % Now typesetting can begin. Only one page should be needed.
608 % Remember to echo the options used.
609 % \begin{macrocode}
610 \begin{document}
611 \parindent0pt
612
613 %% The test output should fit onto one page
614 \pagestyle{empty}
615 \enlargethispage{1in}
616
617 %% Don't forget to list the moresize options in the test output!
618 \textsf{moresize} options:
619 %%[10pt]
620 [11pt]
621 %%[12pt]
622 %%[normalscripts]
623 [smallscripts]
624 %%[ecpatch]
625
626 %% Are you using HUGE fonts?
627 %%Using CM fonts only.
628 %%Using DC fonts for text, CM fonts for math.
629 Using EC fonts for text, CM fonts for math.
630
631 % \end{macrocode}
632 %
633 % Now comes a table containing samples at sizes down to 5pt.
634 % The original font size directives are intended for use with the \opt{11pt}
635 % option; with \opt{12pt} (\opt{10pt}) instead, the 35.83pt (5pt) size would
636 % appear twice.
637 % \begin{macrocode}
638 \begin{center}
639 \newcommand\n{\\\\[-1ex]} %% for separating the tabular lines
640 \begin{tabular}{@{}ll@{}}
641 \Size{35.83}{43}\linebox{36pt}
642 & \Size{35.83}{43}\linebox{\msample}
643 \n \HUGE\linebox{HUGE} & \HUGE\linebox{\msample}
644 \n \Huge\linebox{Huge} & \Huge\linebox{\msample}
645 \n \huge\linebox{huge} & \huge\linebox{\msample}
646 \n \LARGE\linebox{LARGE} & \LARGE\linebox{\msample}
647 \n \Large\linebox{Large} & \Large\linebox{\msample}
648 \n \large\linebox{large} & \large\linebox{\msample}
649 \n \normalsize\linebox{normalsize}
650 & \normalsize\linebox{\msample}
651 \n \small\linebox{small} & \small\linebox{\msample}
652 \n \footnotesize\linebox{footnotesize}
653 & \footnotesize\linebox{\msample}
654 \n \scriptsize\linebox{scriptsize}
655 & \scriptsize\linebox{\msample}
656 \n \ssmall\linebox{ssmall} & \ssmall\linebox{\msample}
657 \n \tiny\linebox{tiny} & \tiny\linebox{\msample}
658 \n \Size{5}{6}\linebox{5pt}
659 & \Size{5}{6}\linebox{\msample}
660 \end{tabular}
661 \end{center}
662 % \end{macrocode}
663 %
664 % That's all on one test page.
665 % \begin{macrocode}
666 \end{document}
667 %</testfile>
668 % \end{macrocode}
669 %\endinput