Debian Codegraph @

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

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2015-2019 by Enrico Gregorio
4 % <Enrico dot Gregorio (at) univr dot it>
5 % ---------------------------------------
6 %
7 % This file may be distributed and/or modified under the
8 % conditions of the LaTeX Project Public License, either version 1.3c
9 % of this license or (at your option) any later version.
10 % The latest version of this license is in:
11 %
12 % http://www.latex-project.org/lppl.txt
13 %
14 % and version 1.3c or later is part of all distributions of LaTeX
15 %
16 % \fi
17 %
18 % \iffalse
19 %<*driver>
20 \ProvidesFile{fixcmex.dtx}
21 %</driver>
22 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
23 %<package>\ProvidesPackage{fixcmex}
24 %<*package>
25 [2019/08/05 v1.1 Scalable math extensions font (Enrico Gregorio)]
26 %</package>
27 %
28 %<*driver>
29 \documentclass{ltxdoc}
30
31 \EnableCrossrefs
32 \CodelineIndex
33 \RecordChanges
34 \begin{document}
35 \DocInput{fixcmex.dtx}
36 \end{document}
37 %</driver>
38 % \fi
39 %
40 % \CheckSum{48}
41 %
42 % \changes{v1.0}{2015/11/10}{Initial version}
43 % \changes{v1.1}{2019/08/05}{Fix lmodern}
44 %
45 % \GetFileInfo{fixcmex.dtx}
46 %
47 % \DoNotIndex{\begingroup,\endgroup,\aftergroup,\@nil,\cmex,\lmex}
48 % \DoNotIndex{\def,\edef,\else,\escapechar,\expandafter,\fi,\ifx}
49 % \DoNotIndex{\m@ne,\string,\textfont,\the,\thr@@}
50 %
51 %
52 % \title{The \textsf{fixcmex} package\thanks{This document corresponds
53 % to \textsf{itnumpar}~\fileversion, dated \filedate.}}
54 %
55 % \author{Enrico Gregorio \\ \texttt{Enrico dot Gregorio (at) univr
56 % dot it}}
57 %
58 % \date{\filedate}
59 %
60 % \maketitle
61 %
62 % \section{Description}
63 %
64 % Knuth's Computer Modern fonts only provide the math extensions
65 % font \texttt{cmex10} at just one size. Together with a release
66 % of AMS-\TeX{}, the American Mathematical Society also provided
67 % the font at sizes 7, 8 and 9; these fonts are automatically loaded
68 % when \verb+\usepackage{amsmath}+ is done for a document. The
69 % option \texttt{cmex10} is allowed for reverting back to the fixed
70 % size, but it should only be used when the \TeX{} distribution is
71 % more than, say twenty years old (at the time of writing).
72 %
73 % Where's the difference? With the standard setup, a symbol like
74 % summation or integral in a footnote or in a \verb+\Large+ context
75 % will have the same size as in normal text. This size is also
76 % independent of the main point size of a document.
77 %
78 % When \textsf{amsmath} (or \textsf{exscale}) is loaded, the symbols
79 % will be scaled, but only at the standard sizes, not arbitrarily.
80 % This is not a limitation any more, because the Type1 version of
81 % the \texttt{cmex} fonts has been available for several years and
82 % this package addresses it.
83 %
84 % Many people use the Latin Modern fonts that are, in several respects,
85 % superior to the European Modern fonts when T1 font encoding is
86 % required. However, when \verb+\usepackage{lmodern}+ is done,
87 % the situation about the math extensions font goes back to the
88 % standard state described above, because \texttt{lmex10} is only
89 % provided at a fixed size.
90 %
91 % The present package can be used when the main font of the document
92 % is Computer Modern (or European Modern, if T1 encoding is selected)
93 % or Latin Modern. It redefines the math extensions font so that it
94 % is arbitrarily scalable, using the optical size fonts provided by
95 % the AMS together with the original \texttt{cmex10} font.
96 %
97 % The package should be loaded as late as possible, in any case
98 % \emph{after} any font package. Its position with respect to
99 % \textsf{hyperref} or \textsf{cleveref} is irrelevant. It will do
100 % nothing if the math extensions font turns out to be not from
101 % Computer Modern or Latin Modern (with a warning).
102 %
103 % There are no options and no commands.
104 %
105 % \StopEventually{\PrintChanges\PrintIndex}
106 %
107 % \section{Implementation}
108 % \begin{macro}{\fixcmex@fix}
109 % \changes{v1.1}{2019/08/05}{Fix lmodern}
110 % The main command just resets the math extensions font to
111 % be \texttt{cmex}, fully scalable.
112 % \begin{macrocode}
113 %<*package>
114 \def\fixcmex@fix{%
115 \DeclareFontShape{OMX}{cmex}{m}{n}{%
116 <-7.5> cmex7
117 <7.5-8.5> cmex8
118 <8.5-9.5> cmex9
119 <9.5-> cmex10
120 }{}%
121 \SetSymbolFont{largesymbols}{normal}{OMX}{cmex}{m}{n}%
122 \SetSymbolFont{largesymbols}{bold}{OMX}{cmex}{m}{n}%
123 \mathversion{\math@version}%
124 }
125 \@onlypreamble\fixcmex@fix
126 % \end{macrocode}
127 % \end{macro}
128 %
129 % Next, at begin document, the \verb+\check@mathfonts+ command
130 % makes sure the font assignments are performed for the normal
131 % size and the family name corresponding to the OMX encoding
132 % is extracted. If it is either \texttt{cmex} or \texttt{lmex}
133 % the command \verb+\fixcmex@fix+ will be executed. Otherwise
134 % a warning is issued, telling that the package has done nothing.
135 % \begin{macrocode}
136 \AtBeginDocument{%
137 \begingroup
138 \check@mathfonts
139 \expandafter\expandafter\expandafter
140 \split@name\expandafter\string\the\textfont\thr@@\@nil
141 \escapechar=\m@ne
142 \edef\fixcmex@cmex{\string\cmex}\edef\fixcmex@lmex{\string\lmex}%
143 \ifx\f@family\fixcmex@cmex
144 \aftergroup\fixcmex@fix
145 \else
146 \ifx\f@family
147 \fixcmex@lmex\aftergroup\fixcmex@fix
148 \else
149 \PackageWarningNoLine{fixcmex}{No change in the math extension font}%
150 \fi
151 \fi
152 \endgroup
153 }
154 %</package>
155 % \end{macrocode}
156 % \Finale
157 \endinput