1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
33 \ProvidesFile{fix-cm.dtx}
35 %<fix-cm>\NeedsTeXFormat{LaTeX2e}
36 %<fix-cm>\ProvidesPackage{fix-cm}
37 %<driver>\ProvidesFile{fix-cm.drv}
39 % \ProvidesFile{fix-cm.dtx}
40 [2015/01/14 v1.1t fixes to LaTeX]
44 \documentclass{ltxdoc}
45 \newcommand\Lopt[1]{\textsf{#1}}
47 \providecommand{\file}[1]{\texttt{#1}}
48 \providecommand{\MF}{\textsf{Metafont}}
49 \providecommand{\danger}{\marginpar[\hfill\protect\Huge!!]{\protect\Huge!!\hfill}}
63 % \GetFileInfo{fix-cm.dtx}
65 % \title{The \Lpack{fix-cm} package\thanks{This file
66 % has version number \fileversion, last
67 % revised \filedate.}}
68 % \author{Frank Mittelbach, David Carlisle, Chris Rowley, Walter
69 % Schmidt\thanks{Walter wrote \Lpack{fix-cm}}}
71 % \MaintainedByLaTeXTeam{latex}
75 %\Lpack{fix-cm} improves the definitions of the Computer Modern
83 % \section{Introduction}
87 % To use the \Lpack{fix-cm} package,
88 % load \danger it \emph{before} \cmd{\documentclass},
89 % and use the command \cmd{\RequirePackage} to do so, rather than the
90 % normal \cmd{\usepackage}:
93 % |\RequirePackage{fix-cm}|\\
94 % |\documentclass| \dots
98 % \section{Using EC fonts (T1 encoding) makes my documents look
101 % No I'm not trying to collect any cites from the news group
102 % discussion on this topic. In a nutshell, if one adds
104 %\usepackage[T1]{fontenc}
106 % to a document that uses the Computer Modern typefaces,
107 % then not only the T1 encoding is used but the fonts
108 % used in the document look noticeably different. This is due to the fact
109 % that the EC fonts have more font series designs, e.g.\ a 14.4\,pt bold
110 % etc and those get used in the standard \texttt{.fd} files, while
111 % with Computer Modern (in OT1 encoding) such sizes were scaled
112 % versions of smaller sizes---with a noticeable different look and
115 % So we provide a package \Lpack{fix-cm} to ensure that comparable
116 % definitions are used. In addition to that, the package
117 % \Lpack{fix-cm} also enables continuous scaling of the CM fonts.
118 % This package was written by Walter Schmidt.
121 %^^A The documentation in this section was prepared by Walter Schmidt.
125 % \subsection{What \Lpack{fix-cm} does}
128 % Loading the package \Lpack{fix-cm} changes the font definitions of the
129 % Computer Modern fonts, in order to achieve the following effects:
132 % The appearance of the T1 and TS1 encoded CM fonts (aka `EC') is
133 % made as similar as possible to the traditional (OT1 encoded) ones.
134 % Particularly, a number of broken or ugly design sizes are no
135 % longer used, the look of the bold sans serif typeface at large
136 % sizes is considerably improved, and mismatches between the text
137 % fonts and the corresponding math fonts are avoided. As a side
138 % effect, PostScript and PDF documents may become smaller, because
139 % fewer fonts need to be embedded.
141 % The Computer Modern fonts are made available with arbitrary sizes.
143 % Only those design sizes of the fonts will be used, that are
144 % normally available in Type1 format, too. You need not load the
145 % extra package \Lpack{cmmib57} for this purpose.
147 % The package acts on the following font families:
150 % The text font families \file{cmr}, \file{cmss}, \file{cmtt} and
151 % \file{cmvtt} with OT1, T1 and TS1 encoding.
153 % The default math fonts used by \LaTeX, i.e., the font families
154 % \file{cmm} with encoding OML and \file{cms} with encoding OMS.
156 % The symbols used by the package \Lpack{latexsym}, i.e., the font
157 % family \file{lasy}.
159 % Note that the package does \emph{not} act on:
161 % \item Font families such as CM~Fibonacci, CM~Dunhill etc.,
162 % which are provided for experimental purposes or for fun only.
164 % CM text fonts with character sets other than Latin, e.g.,
165 % Cyrillic. Loading of the required font and encoding definitions
166 % while the fonts are not actually used, would not be a good idea.
167 % This should be addressed by particular packages or by changing the
168 % standard FDs of these fonts.
170 % Extra math fonts such as the AMS symbol fonts. While
171 % they match the style of Computer Modern, they are frequently used
172 % in conjunction with other font families, too. Thus,
173 % \Lpack{fix-cm} is obviously not the right place to make sure that
174 % they can be scaled continuously. Ask the maintainers of these
175 % fonts to provide this feature, which is badly needed!
177 % The math extension font \file{cmex}. Whether or not this font
178 % should be scaled is a question of its own, and there are other
179 % packages (\Lpack{exscale}, \Lpack{amsmath}, \Lpack{amsfonts}) to
183 % \subsection{How to load the package}
185 % The package should be loaded \danger \emph{before} \cmd{\documentclass},
186 % using the command |\RequirePackage{fix-cm}|, rather than the
187 % normal \cmd{\usepackage}.
189 % If the package is loaded in the preamble, a preceding package or
190 % even the code of the document class may have used any of the CM
191 % fonts already. However, the definitions of those fonts, that are
192 % already in use, cannot be changed any more.
195 % \subsection{Usage notes}
196 % In contrast to what you may expect, \Lpack{fix-cm} does \emph{not}
197 % ensure that line and page breaks stay the same, when you switch an
198 % existing document from OT1 to T1 encoding. The package does not
199 % turn off all of the additional design sizes in the EC fonts
200 % collection: Those, that contribute considerably to the typographical
201 % quality and do not conflict with the math fonts,
202 % are---indeed---used.
204 % Be careful when using arbitrary, non-standard font sizes with
205 % applications that need bitmap fonts: You may end up \danger with
206 % lots of possibly huge \file{.pk} files. Also, \MF{} chokes
207 % sometimes on extremely small or large sizes, because of arithmetic
210 % \Lpack{fix-cm} supersedes the experimental packages \Lpack{cmsd} and
211 % \Lpack{fix-ec}, which are no longer distributed.
213 % The packages \Lpack{type1cm} and \Lpack{type1ec} must not be loaded
214 % additionally; they enable only continuous scaling.
221 % \section{Implementation}
223 % \subsection{Preliminaries}
224 % The \LaTeX{} kernel does not declare the font encoding TS1.
225 % However, we are going to set up font definitions for this encoding,
226 % so we have to declare it now.
232 % In case the package is loaded in the preamble, any of the CM fonts may
233 % have been used already and cannot be redefined. Yet we try to
234 % intercept at least the problem that is most likely to occur, i.e.,
235 % a hidden \cmd{\normalfont}. Most of the standard definitions
236 % are ok, but those for T1 encoding and 10.95\,pt need to be removed:
238 \expandafter \let \csname T1/cmr/m/n/10.95\endcsname \relax
239 \expandafter \let \csname T1/cmss/m/n/10.95\endcsname \relax
240 \expandafter \let \csname T1/cmtt/m/n/10.95\endcsname \relax
241 \expandafter \let \csname T1/cmvtt/m/n/10.95\endcsname \relax
244 % \Lpack{fix-cm} may still fail, if the EC fonts are preloaded in the
245 % \LaTeX{} format file. This situation is, however, very unlikely and could occur
246 % only with a customized format.
248 % The remainder of the package is enclosed in a group, where the catcodes
249 % are guaranteed to be appropriate for the processing of font definitions.
255 % \subsection{T1 encoding}
257 % \paragraph{CM Roman}
259 \DeclareFontFamily{T1}{cmr}{}
260 \DeclareFontShape{T1}{cmr}{m}{n}{
270 \DeclareFontShape{T1}{cmr}{m}{sl}{
280 \DeclareFontShape{T1}{cmr}{m}{it}{
288 \DeclareFontShape{T1}{cmr}{m}{sc}{
298 \DeclareFontShape{T1}{cmr}{m}{ui}{
306 \DeclareFontShape{T1}{cmr}{b}{n}{
316 \DeclareFontShape{T1}{cmr}{bx}{n}{
325 \DeclareFontShape{T1}{cmr}{bx}{sl}{
334 \DeclareFontShape{T1}{cmr}{bx}{it}{
341 \DeclareFontShape{T1}{cmr}{bx}{sc}{
353 % \paragraph{CM Sans}
355 \DeclareFontFamily{T1}{cmss}{}
356 \DeclareFontShape{T1}{cmss}{m}{n}{
363 \DeclareFontShape{T1}{cmss}{m}{sl}{
370 \DeclareFontShape{T1}{cmss}{m}{it}
371 {<->ssub*cmss/m/sl}{}
372 \DeclareFontShape{T1}{cmss}{m}{sc}
374 \DeclareFontShape{T1}{cmss}{sbc}{n}{
377 \DeclareFontShape{T1}{cmss}{bx}{n}{
381 \DeclareFontShape{T1}{cmss}{bx}{sl}{
385 \DeclareFontShape{T1}{cmss}{bx}{it}
386 {<->ssub*cmss/bx/sl}{}
388 % The following substitutions are not provided in the default
389 % \file{.fd} files. I have included them, so that you can
390 % easily use the EC fonts with the default bold series being
391 % \file{b} rather than \file{bx}.
393 \DeclareFontShape{T1}{cmss}{b}{n}
394 {<->ssub*cmss/bx/n}{}
395 \DeclareFontShape{T1}{cmss}{b}{sl}
396 {<->ssub*cmss/bx/sl}{}
397 \DeclareFontShape{T1}{cmss}{b}{it}
398 {<->ssub*cmss/bx/sl}{}
401 % \paragraph{CM Typewriter}
403 \DeclareFontFamily{T1}{cmtt}{\hyphenchar \font\m@ne}
404 \DeclareFontShape{T1}{cmtt}{m}{n}{
411 \DeclareFontShape{T1}{cmtt}{m}{it}{
418 \DeclareFontShape{T1}{cmtt}{m}{sl}{
425 \DeclareFontShape{T1}{cmtt}{m}{sc}{
432 \DeclareFontShape{T1}{cmtt}{bx}{n}
433 {<->sub * cmtt/m/n}{}
434 \DeclareFontShape{T1}{cmtt}{bx}{it}
435 {<->sub * cmtt/m/it}{}
436 \DeclareFontShape{T1}{cmtt}{bx}{sl}
437 {<->sub * cmtt/m/sl}{}
439 % Substitutions not provided in the default \file{.fd} files:
441 \DeclareFontShape{T1}{cmtt}{b}{n}
442 {<->sub * cmtt/m/n}{}
443 \DeclareFontShape{T1}{cmtt}{b}{it}
444 {<->sub * cmtt/m/it}{}
445 \DeclareFontShape{T1}{cmtt}{b}{sl}
446 {<->sub * cmtt/m/sl}{}
449 % \paragraph{CM Typewiter (var.)}
451 \DeclareFontFamily{T1}{cmvtt}{}
452 \DeclareFontShape{T1}{cmvtt}{m}{n}{
459 \DeclareFontShape{T1}{cmvtt}{m}{it}{
468 % \subsection{TS1 encoding}
470 % \paragraph{CM Roman}
472 \DeclareFontFamily{TS1}{cmr}{\hyphenchar\font\m@ne}
473 \DeclareFontShape{TS1}{cmr}{m}{n}{
483 \DeclareFontShape{TS1}{cmr}{m}{sl}{
493 \DeclareFontShape{TS1}{cmr}{m}{it}{
501 \DeclareFontShape{TS1}{cmr}{m}{ui}{
509 \DeclareFontShape{TS1}{cmr}{b}{n}{
519 \DeclareFontShape{TS1}{cmr}{bx}{n}{
528 \DeclareFontShape{TS1}{cmr}{bx}{sl}{
537 \DeclareFontShape{TS1}{cmr}{bx}{it}{
546 % \paragraph{CM Sans}
548 \DeclareFontFamily{TS1}{cmss}{\hyphenchar\font\m@ne}
549 \DeclareFontShape{TS1}{cmss}{m}{n}{
556 \DeclareFontShape{TS1}{cmss}{m}{it}
557 {<->ssub*cmss/m/sl}{}
558 \DeclareFontShape{TS1}{cmss}{m}{sl}{
565 \DeclareFontShape{TS1}{cmss}{sbc}{n}{
568 \DeclareFontShape{TS1}{cmss}{bx}{n}{
572 \DeclareFontShape{TS1}{cmss}{bx}{sl}{
576 \DeclareFontShape{TS1}{cmss}{bx}{it}
577 {<->ssub*cmss/bx/sl}{}
579 % Substitutions not provided in the default \file{.fd} files:
581 \DeclareFontShape{TS1}{cmss}{b}{n}
582 {<->ssub*cmss/bx/n}{}
583 \DeclareFontShape{TS1}{cmss}{b}{sl}
584 {<->ssub*cmss/bx/sl}{}
585 \DeclareFontShape{TS1}{cmss}{b}{it}
586 {<->ssub*cmss/bx/sl}{}
589 % \paragraph{CM Typewriter}
591 \DeclareFontFamily{TS1}{cmtt}{\hyphenchar \font\m@ne}
592 \DeclareFontShape{TS1}{cmtt}{m}{n}{
599 \DeclareFontShape{TS1}{cmtt}{m}{it}{
606 \DeclareFontShape{TS1}{cmtt}{m}{sl}{
613 \DeclareFontShape{TS1}{cmtt}{bx}{n}
614 {<->sub * cmtt/m/n}{}
615 \DeclareFontShape{TS1}{cmtt}{bx}{it}
616 {<->sub * cmtt/m/it}{}
617 \DeclareFontShape{TS1}{cmtt}{bx}{sl}
618 {<->sub * cmtt/m/sl}{}
620 % Substitutions not provided in the default \file{.fd} files:
622 \DeclareFontShape{TS1}{cmtt}{b}{n}
623 {<->sub * cmtt/m/n}{}
624 \DeclareFontShape{TS1}{cmtt}{b}{it}
625 {<->sub * cmtt/m/it}{}
626 \DeclareFontShape{TS1}{cmtt}{b}{sl}
627 {<->sub * cmtt/m/sl}{}
630 % \paragraph{CM Typewriter (var.)}
632 \DeclareFontFamily{TS1}{cmvtt}{}
633 \DeclareFontShape{TS1}{cmvtt}{m}{n}{
640 \DeclareFontShape{TS1}{cmvtt}{m}{it}{
649 % \subsection{OT1 encoding}
651 % \paragraph{CM Roman}
653 \DeclareFontFamily{OT1}{cmr}{\hyphenchar\font45 }
654 \DeclareFontShape{OT1}{cmr}{m}{n}{
664 \DeclareFontShape{OT1}{cmr}{m}{sl}{
670 \DeclareFontShape{OT1}{cmr}{m}{it}{
677 \DeclareFontShape{OT1}{cmr}{m}{sc}{
680 \DeclareFontShape{OT1}{cmr}{m}{ui}{
683 \DeclareFontShape{OT1}{cmr}{b}{n}{
686 \DeclareFontShape{OT1}{cmr}{bx}{n}{
695 \DeclareFontShape{OT1}{cmr}{bx}{sl}{
698 \DeclareFontShape{OT1}{cmr}{bx}{it}{
701 \DeclareFontShape{OT1}{cmr}{bx}{ui}
705 % \paragraph{CM Sans}
707 \DeclareFontFamily{OT1}{cmss}{\hyphenchar\font45 }
708 \DeclareFontShape{OT1}{cmss}{m}{n}{
715 \DeclareFontShape{OT1}{cmss}{m}{it}
717 \DeclareFontShape{OT1}{cmss}{m}{sl}{
724 \DeclareFontShape{OT1}{cmss}{m}{sc}
726 \DeclareFontShape{OT1}{cmss}{m}{ui}
728 \DeclareFontShape{OT1}{cmss}{sbc}{n}{
731 \DeclareFontShape{OT1}{cmss}{bx}{n}{
734 \DeclareFontShape{OT1}{cmss}{bx}{ui}
738 % \paragraph{CM Typewriter}
740 \DeclareFontFamily{OT1}{cmtt}{\hyphenchar \font\m@ne}
741 \DeclareFontShape{OT1}{cmtt}{m}{n}{
747 \DeclareFontShape{OT1}{cmtt}{m}{it}{
750 \DeclareFontShape{OT1}{cmtt}{m}{sl}{
753 \DeclareFontShape{OT1}{cmtt}{m}{sc}{
756 \DeclareFontShape{OT1}{cmtt}{m}{ui}
757 {<->ssub*cmtt/m/it}{}
758 \DeclareFontShape{OT1}{cmtt}{bx}{n}
760 \DeclareFontShape{OT1}{cmtt}{bx}{it}
761 {<->ssub*cmtt/m/it}{}
762 \DeclareFontShape{OT1}{cmtt}{bx}{ui}
763 {<->ssub*cmtt/m/it}{}
766 % \paragraph{CM Typewriter (var.)}
768 \DeclareFontFamily{OT1}{cmvtt}{\hyphenchar\font45 }
769 \DeclareFontShape{OT1}{cmvtt}{m}{n}{
772 \DeclareFontShape{OT1}{cmvtt}{m}{it}{
777 % \subsection{OML and OMS encoded math fonts}
779 \DeclareFontFamily{OML}{cmm}{\skewchar\font127 }
780 \DeclareFontShape{OML}{cmm}{m}{it}{
789 \DeclareFontShape{OML}{cmm}{b}{it}{<-6>cmmib5<6-8>cmmib7<8->cmmib10}{}
790 \DeclareFontShape{OML}{cmm}{bx}{it}
794 \DeclareFontFamily{OMS}{cmsy}{\skewchar\font48 }
795 \DeclareFontShape{OMS}{cmsy}{m}{n}{
803 \DeclareFontShape{OMS}{cmsy}{b}{n}{<-6>cmbsy5<6-8>cmbsy7<8->cmbsy10}{}
806 % \subsection{\LaTeX{} symbols}
808 \DeclareFontFamily{U}{lasy}{}
809 \DeclareFontShape{U}{lasy}{m}{n}{
817 \DeclareFontShape{U}{lasy}{b}{n}{
818 <-10> ssub * lasy/m/n