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}}
59 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
60 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
61 %% Digits \0\1\2\3\4\5\6\7\8\9
62 %% Exclamation \! Double quote \" Hash (number) \#
63 %% Dollar \$ Percent \% Ampersand \&
64 %% Acute accent \' Left paren \( Right paren \)
65 %% Asterisk \* Plus \+ Comma \,
66 %% Minus \- Point \. Solidus \/
67 %% Colon \: Semicolon \; Less than \<
68 %% Equals \= Greater than \> Question mark \?
69 %% Commercial at \@ Left bracket \[ Backslash \\
70 %% Right bracket \] Circumflex \^ Underscore \_
71 %% Grave accent \` Left brace \{ Vertical bar \|
72 %% Right brace \} Tilde \~}
79 % \GetFileInfo{fix-cm.dtx}
81 % \title{The \Lpack{fix-cm} package\thanks{This file
82 % has version number \fileversion, last
83 % revised \filedate.}}
84 % \author{Frank Mittelbach, David Carlisle, Chris Rowley, Walter
85 % Schmidt\thanks{Walter wrote \Lpack{fix-cm}}}
87 % \MaintainedByLaTeXTeam{latex}
91 %\Lpack{fix-cm} improves the definitions of the Computer Modern
99 % \section{Introduction}
103 % To use the \Lpack{fix-cm} package,
104 % load \danger it \emph{before} \cmd{\documentclass},
105 % and use the command \cmd{\RequirePackage} to do so, rather than the
106 % normal \cmd{\usepackage}:
109 % |\RequirePackage{fix-cm}|\\
110 % |\documentclass| \dots
114 % \section{Using EC fonts (T1 encoding) makes my documents look
117 % No I'm not trying to collect any cites from the news group
118 % discussion on this topic. In a nutshell, if one adds
120 %\usepackage[T1]{fontenc}
122 % to a document that uses the Computer Modern typefaces,
123 % then not only the T1 encoding is used but the fonts
124 % used in the document look noticeably different. This is due to the fact
125 % that the EC fonts have more font series designs, e.g.\ a 14.4\,pt bold
126 % etc and those get used in the standard \texttt{.fd} files, while
127 % with Computer Modern (in OT1 encoding) such sizes were scaled
128 % versions of smaller sizes---with a noticeable different look and
131 % So we provide a package \Lpack{fix-cm} to ensure that comparable
132 % definitions are used. In addition to that, the package
133 % \Lpack{fix-cm} also enables continuous scaling of the CM fonts.
134 % This package was written by Walter Schmidt.
137 %^^A The documentation in this section was prepared by Walter Schmidt.
141 % \subsection{What \Lpack{fix-cm} does}
144 % Loading the package \Lpack{fix-cm} changes the font definitions of the
145 % Computer Modern fonts, in order to achieve the following effects:
148 % The appearance of the T1 and TS1 encoded CM fonts (aka `EC') is
149 % made as similar as possible to the traditional (OT1 encoded) ones.
150 % Particularly, a number of broken or ugly design sizes are no
151 % longer used, the look of the bold sans serif typeface at large
152 % sizes is considerably improved, and mismatches between the text
153 % fonts and the corresponding math fonts are avoided. As a side
154 % effect, PostScript and PDF documents may become smaller, because
155 % fewer fonts need to be embedded.
157 % The Computer Modern fonts are made available with arbitrary sizes.
159 % Only those design sizes of the fonts will be used, that are
160 % normally available in Type1 format, too. You need not load the
161 % extra package \Lpack{cmmib57} for this purpose.
163 % The package acts on the following font families:
166 % The text font families \file{cmr}, \file{cmss}, \file{cmtt} and
167 % \file{cmvtt} with OT1, T1 and TS1 encoding.
169 % The default math fonts used by \LaTeX, i.e., the font families
170 % \file{cmm} with encoding OML and \file{cms} with encoding OMS.
172 % The symbols used by the package \Lpack{latexsym}, i.e., the font
173 % family \file{lasy}.
175 % Note that the package does \emph{not} act on:
177 % \item Font families such as CM~Fibonacci, CM~Dunhill etc.,
178 % which are provided for experimental purposes or for fun only.
180 % CM text fonts with character sets other than Latin, e.g.,
181 % Cyrillic. Loading of the required font and encoding definitions
182 % while the fonts are not actually used, would not be a good idea.
183 % This should be addressed by particular packages or by changing the
184 % standard FDs of these fonts.
186 % Extra math fonts such as the AMS symbol fonts. While
187 % they match the style of Computer Modern, they are frequently used
188 % in conjunction with other font families, too. Thus,
189 % \Lpack{fix-cm} is obviously not the right place to make sure that
190 % they can be scaled continuously. Ask the maintainers of these
191 % fonts to provide this feature, which is badly needed!
193 % The math extension font \file{cmex}. Whether or not this font
194 % should be scaled is a question of its own, and there are other
195 % packages (\Lpack{exscale}, \Lpack{amsmath}, \Lpack{amsfonts}) to
199 % \subsection{How to load the package}
201 % The package should be loaded \danger \emph{before} \cmd{\documentclass},
202 % using the command |\RequirePackage{fix-cm}|, rather than the
203 % normal \cmd{\usepackage}.
205 % If the package is loaded in the preamble, a preceding package or
206 % even the code of the document class may have used any of the CM
207 % fonts already. However, the definitions of those fonts, that are
208 % already in use, cannot be changed any more.
211 % \subsection{Usage notes}
212 % In contrast to what you may expect, \Lpack{fix-cm} does \emph{not}
213 % ensure that line and page breaks stay the same, when you switch an
214 % existing document from OT1 to T1 encoding. The package does not
215 % turn off all of the additional design sizes in the EC fonts
216 % collection: Those, that contribute considerably to the typographical
217 % quality and do not conflict with the math fonts,
218 % are---indeed---used.
220 % Be careful when using arbitrary, non-standard font sizes with
221 % applications that need bitmap fonts: You may end up \danger with
222 % lots of possibly huge \file{.pk} files. Also, \MF{} chokes
223 % sometimes on extremely small or large sizes, because of arithmetic
226 % \Lpack{fix-cm} supersedes the experimental packages \Lpack{cmsd} and
227 % \Lpack{fix-ec}, which are no longer distributed.
229 % The packages \Lpack{type1cm} and \Lpack{type1ec} must not be loaded
230 % additionally; they enable only continuous scaling.
237 % \section{Implementation}
239 % \subsection{Preliminaries}
240 % The \LaTeX{} kernel does not declare the font encoding TS1.
241 % However, we are going to set up font definitions for this encoding,
242 % so we have to declare it now.
248 % In case the package is loaded in the preamble, any of the CM fonts may
249 % have been used already and cannot be redefined. Yet we try to
250 % intercept at least the problem that is most likely to occur, i.e.,
251 % a hidden \cmd{\normalfont}. Most of the standard definitions
252 % are ok, but those for T1 encoding and 10.95\,pt need to be removed:
254 \expandafter \let \csname T1/cmr/m/n/10.95\endcsname \relax
255 \expandafter \let \csname T1/cmss/m/n/10.95\endcsname \relax
256 \expandafter \let \csname T1/cmtt/m/n/10.95\endcsname \relax
257 \expandafter \let \csname T1/cmvtt/m/n/10.95\endcsname \relax
260 % \Lpack{fix-cm} may still fail, if the EC fonts are preloaded in the
261 % \LaTeX{} format file. This situation is, however, very unlikely and could occur
262 % only with a customized format.
264 % The remainder of the package is enclosed in a group, where the catcodes
265 % are guaranteed to be appropriate for the processing of font definitions.
271 % \subsection{T1 encoding}
273 % \paragraph{CM Roman}
275 \DeclareFontFamily{T1}{cmr}{}
276 \DeclareFontShape{T1}{cmr}{m}{n}{
286 \DeclareFontShape{T1}{cmr}{m}{sl}{
296 \DeclareFontShape{T1}{cmr}{m}{it}{
304 \DeclareFontShape{T1}{cmr}{m}{sc}{
314 \DeclareFontShape{T1}{cmr}{m}{ui}{
322 \DeclareFontShape{T1}{cmr}{b}{n}{
332 \DeclareFontShape{T1}{cmr}{bx}{n}{
341 \DeclareFontShape{T1}{cmr}{bx}{sl}{
350 \DeclareFontShape{T1}{cmr}{bx}{it}{
357 \DeclareFontShape{T1}{cmr}{bx}{sc}{
369 % \paragraph{CM Sans}
371 \DeclareFontFamily{T1}{cmss}{}
372 \DeclareFontShape{T1}{cmss}{m}{n}{
379 \DeclareFontShape{T1}{cmss}{m}{sl}{
386 \DeclareFontShape{T1}{cmss}{m}{it}
387 {<->ssub*cmss/m/sl}{}
388 \DeclareFontShape{T1}{cmss}{m}{sc}
390 \DeclareFontShape{T1}{cmss}{sbc}{n}{
393 \DeclareFontShape{T1}{cmss}{bx}{n}{
397 \DeclareFontShape{T1}{cmss}{bx}{sl}{
401 \DeclareFontShape{T1}{cmss}{bx}{it}
402 {<->ssub*cmss/bx/sl}{}
404 % The following substitutions are not provided in the default
405 % \file{.fd} files. I have included them, so that you can
406 % easily use the EC fonts with the default bold series being
407 % \file{b} rather than \file{bx}.
409 \DeclareFontShape{T1}{cmss}{b}{n}
410 {<->ssub*cmss/bx/n}{}
411 \DeclareFontShape{T1}{cmss}{b}{sl}
412 {<->ssub*cmss/bx/sl}{}
413 \DeclareFontShape{T1}{cmss}{b}{it}
414 {<->ssub*cmss/bx/sl}{}
417 % \paragraph{CM Typewriter}
419 \DeclareFontFamily{T1}{cmtt}{\hyphenchar \font\m@ne}
420 \DeclareFontShape{T1}{cmtt}{m}{n}{
427 \DeclareFontShape{T1}{cmtt}{m}{it}{
434 \DeclareFontShape{T1}{cmtt}{m}{sl}{
441 \DeclareFontShape{T1}{cmtt}{m}{sc}{
448 \DeclareFontShape{T1}{cmtt}{bx}{n}
449 {<->sub * cmtt/m/n}{}
450 \DeclareFontShape{T1}{cmtt}{bx}{it}
451 {<->sub * cmtt/m/it}{}
452 \DeclareFontShape{T1}{cmtt}{bx}{sl}
453 {<->sub * cmtt/m/sl}{}
455 % Substitutions not provided in the default \file{.fd} files:
457 \DeclareFontShape{T1}{cmtt}{b}{n}
458 {<->sub * cmtt/m/n}{}
459 \DeclareFontShape{T1}{cmtt}{b}{it}
460 {<->sub * cmtt/m/it}{}
461 \DeclareFontShape{T1}{cmtt}{b}{sl}
462 {<->sub * cmtt/m/sl}{}
465 % \paragraph{CM Typewiter (var.)}
467 \DeclareFontFamily{T1}{cmvtt}{}
468 \DeclareFontShape{T1}{cmvtt}{m}{n}{
475 \DeclareFontShape{T1}{cmvtt}{m}{it}{
484 % \subsection{TS1 encoding}
486 % \paragraph{CM Roman}
488 \DeclareFontFamily{TS1}{cmr}{\hyphenchar\font\m@ne}
489 \DeclareFontShape{TS1}{cmr}{m}{n}{
499 \DeclareFontShape{TS1}{cmr}{m}{sl}{
509 \DeclareFontShape{TS1}{cmr}{m}{it}{
517 \DeclareFontShape{TS1}{cmr}{m}{ui}{
525 \DeclareFontShape{TS1}{cmr}{b}{n}{
535 \DeclareFontShape{TS1}{cmr}{bx}{n}{
544 \DeclareFontShape{TS1}{cmr}{bx}{sl}{
553 \DeclareFontShape{TS1}{cmr}{bx}{it}{
562 % \paragraph{CM Sans}
564 \DeclareFontFamily{TS1}{cmss}{\hyphenchar\font\m@ne}
565 \DeclareFontShape{TS1}{cmss}{m}{n}{
572 \DeclareFontShape{TS1}{cmss}{m}{it}
573 {<->ssub*cmss/m/sl}{}
574 \DeclareFontShape{TS1}{cmss}{m}{sl}{
581 \DeclareFontShape{TS1}{cmss}{sbc}{n}{
584 \DeclareFontShape{TS1}{cmss}{bx}{n}{
588 \DeclareFontShape{TS1}{cmss}{bx}{sl}{
592 \DeclareFontShape{TS1}{cmss}{bx}{it}
593 {<->ssub*cmss/bx/sl}{}
595 % Substitutions not provided in the default \file{.fd} files:
597 \DeclareFontShape{TS1}{cmss}{b}{n}
598 {<->ssub*cmss/bx/n}{}
599 \DeclareFontShape{TS1}{cmss}{b}{sl}
600 {<->ssub*cmss/bx/sl}{}
601 \DeclareFontShape{TS1}{cmss}{b}{it}
602 {<->ssub*cmss/bx/sl}{}
605 % \paragraph{CM Typewriter}
607 \DeclareFontFamily{TS1}{cmtt}{\hyphenchar \font\m@ne}
608 \DeclareFontShape{TS1}{cmtt}{m}{n}{
615 \DeclareFontShape{TS1}{cmtt}{m}{it}{
622 \DeclareFontShape{TS1}{cmtt}{m}{sl}{
629 \DeclareFontShape{TS1}{cmtt}{bx}{n}
630 {<->sub * cmtt/m/n}{}
631 \DeclareFontShape{TS1}{cmtt}{bx}{it}
632 {<->sub * cmtt/m/it}{}
633 \DeclareFontShape{TS1}{cmtt}{bx}{sl}
634 {<->sub * cmtt/m/sl}{}
636 % Substitutions not provided in the default \file{.fd} files:
638 \DeclareFontShape{TS1}{cmtt}{b}{n}
639 {<->sub * cmtt/m/n}{}
640 \DeclareFontShape{TS1}{cmtt}{b}{it}
641 {<->sub * cmtt/m/it}{}
642 \DeclareFontShape{TS1}{cmtt}{b}{sl}
643 {<->sub * cmtt/m/sl}{}
646 % \paragraph{CM Typewriter (var.)}
648 \DeclareFontFamily{TS1}{cmvtt}{}
649 \DeclareFontShape{TS1}{cmvtt}{m}{n}{
656 \DeclareFontShape{TS1}{cmvtt}{m}{it}{
665 % \subsection{OT1 encoding}
667 % \paragraph{CM Roman}
669 \DeclareFontFamily{OT1}{cmr}{\hyphenchar\font45 }
670 \DeclareFontShape{OT1}{cmr}{m}{n}{
680 \DeclareFontShape{OT1}{cmr}{m}{sl}{
686 \DeclareFontShape{OT1}{cmr}{m}{it}{
693 \DeclareFontShape{OT1}{cmr}{m}{sc}{
696 \DeclareFontShape{OT1}{cmr}{m}{ui}{
699 \DeclareFontShape{OT1}{cmr}{b}{n}{
702 \DeclareFontShape{OT1}{cmr}{bx}{n}{
711 \DeclareFontShape{OT1}{cmr}{bx}{sl}{
714 \DeclareFontShape{OT1}{cmr}{bx}{it}{
717 \DeclareFontShape{OT1}{cmr}{bx}{ui}
721 % \paragraph{CM Sans}
723 \DeclareFontFamily{OT1}{cmss}{\hyphenchar\font45 }
724 \DeclareFontShape{OT1}{cmss}{m}{n}{
731 \DeclareFontShape{OT1}{cmss}{m}{it}
733 \DeclareFontShape{OT1}{cmss}{m}{sl}{
740 \DeclareFontShape{OT1}{cmss}{m}{sc}
742 \DeclareFontShape{OT1}{cmss}{m}{ui}
744 \DeclareFontShape{OT1}{cmss}{sbc}{n}{
747 \DeclareFontShape{OT1}{cmss}{bx}{n}{
750 \DeclareFontShape{OT1}{cmss}{bx}{ui}
754 % \paragraph{CM Typewriter}
756 \DeclareFontFamily{OT1}{cmtt}{\hyphenchar \font\m@ne}
757 \DeclareFontShape{OT1}{cmtt}{m}{n}{
763 \DeclareFontShape{OT1}{cmtt}{m}{it}{
766 \DeclareFontShape{OT1}{cmtt}{m}{sl}{
769 \DeclareFontShape{OT1}{cmtt}{m}{sc}{
772 \DeclareFontShape{OT1}{cmtt}{m}{ui}
773 {<->ssub*cmtt/m/it}{}
774 \DeclareFontShape{OT1}{cmtt}{bx}{n}
776 \DeclareFontShape{OT1}{cmtt}{bx}{it}
777 {<->ssub*cmtt/m/it}{}
778 \DeclareFontShape{OT1}{cmtt}{bx}{ui}
779 {<->ssub*cmtt/m/it}{}
782 % \paragraph{CM Typewriter (var.)}
784 \DeclareFontFamily{OT1}{cmvtt}{\hyphenchar\font45 }
785 \DeclareFontShape{OT1}{cmvtt}{m}{n}{
788 \DeclareFontShape{OT1}{cmvtt}{m}{it}{
793 % \subsection{OML and OMS encoded math fonts}
795 \DeclareFontFamily{OML}{cmm}{\skewchar\font127 }
796 \DeclareFontShape{OML}{cmm}{m}{it}{
805 \DeclareFontShape{OML}{cmm}{b}{it}{<-6>cmmib5<6-8>cmmib7<8->cmmib10}{}
806 \DeclareFontShape{OML}{cmm}{bx}{it}
810 \DeclareFontFamily{OMS}{cmsy}{\skewchar\font48 }
811 \DeclareFontShape{OMS}{cmsy}{m}{n}{
819 \DeclareFontShape{OMS}{cmsy}{b}{n}{<-6>cmbsy5<6-8>cmbsy7<8->cmbsy10}{}
822 % \subsection{\LaTeX{} symbols}
824 \DeclareFontFamily{U}{lasy}{}
825 \DeclareFontShape{U}{lasy}{m}{n}{
833 \DeclareFontShape{U}{lasy}{b}{n}{
834 <-10> ssub * lasy/m/n