summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/psnfssx/tmmath/tmmaths.dtx
blob: 9a05621735d1f19b7c4c3d80e41b48f60e6e413d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
%\CheckSum{305}
%
% \iffalse
%
% File `tmmaths.dtx'
% Copyright (c) 1999--2003 Walter Schmidt
%
% This program may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of LaTeX
% version 1999/12/01 or later.
%
% This program consists of the files tmmaths.dtx, tmmaths.ins and
% tmmaths.txt.
% 
% \fi
%
% \iffalse
%
%<*driver>
\ProvidesFile{tmmaths.dtx}
%</driver>
%<tmmaths>\ProvidesPackage{tmmaths}
           [2004/01/19 v2.4 (WaS/MicroPress)]
%
%<*driver> 
\documentclass[11pt]{ltxdoc}
\RequirePackage{url}
\CodelineNumbered
\OnlyDescription
\parindent1em
\leftmargini=2em
\leftmarginii=2em
\leftmarginiii=2em
\leftmarginiv=2em
\leftmargin\leftmargini
\labelwidth\leftmargin \advance\labelwidth by -\labelsep
\begin{document}
 \DocInput{tmmaths.dtx}
\end{document}
%</driver>
% \fi
%
% \DeleteShortVerb{\|}
% \MakeShortVerb{\+}
% 
% \GetFileInfo{tmmaths.dtx}
% \title{The \LaTeX{} macro package \texttt{tmmaths}}
% \author{Walter Schmidt\thanks{\texttt{w.a.schmidt@gmx.net}}}
% \date{\fileversion{} -- \filedate}
% \maketitle
%
%
%
% \section{The TM-Math font set}
%                                                      
% MicroPress' TM-Math font set extends the Adobe Times typefaces:
% \begin{itemize}
%   \item Additional text and text companion symbols make the 
%   full OT1 and T1 character sets and a subset of the 
%   text companion symbols available, including the Euro sign.
%   With \LaTeX, the enhanced Times typefaces are provided
%   as a font family named \texttt{tmr}.
%   \item Several math fonts, matching the `Times' style, are provided
%   to support all of \TeX's math typesetting capabilites and fully
%  replace the default Computer Modern fonts.
% \end{itemize}
%
%
% \section{The package \texttt{tmmaths}}
% Loading the package \texttt{tmmaths}
% \begin{verse}
% +\usepackage{tmmaths}+
% \end{verse}
% makes \LaTeX{} use the Times and TM-Math fonts:
% The default roman text font family (+\rmdefault+) is changed to \texttt{tmr},
% i.e.\ enhanced Adobe Times, and the math fonts are changed to TM-Math.
% Notice that the +\mathsf+ and +\mathtt+ alphabets remains unchanged, i.e., 
% CM Sans Serif and CM Typewriter.
%
% \subsection{Font encoding}
% The package does \emph{not} change the default output font
% encoding from OT1.  It is, however, recommended to switch to
% the extended T1 and TS1 encodings,
% so as to provide access all glyphs.
% This is enabled by the following additional commands:
% \begin{verse}
% +\usepackage[T1]{fontenc}+\\
% +\usepackage{textcomp}+
% \end{verse}
%
% \subsection{The \texttt{slantedGreek} option}
% When the macro package is loaded using the option \texttt{[slantedGreek]},
% uppercase Greek letters in math will, by default, be slanted.
%
% \subsection{Upright Greek}
% A full upright Greek alphabet is made available.
% The macros +\upalpha+, +\upbeta+ \dots\ +\upGamma+, +\upDelta+ etc.\ 
% always produce upright Greek letters, regardless of the \texttt{slantedGreek} option.
%
% \subsection{Bold italic letters in formulas}
% The \texttt{tmmaths} package provides a {\bfseries\itshape bold italic}
% math alphabet  +\mathbold+.  It includes both Latin and Greek.
% (Do not mix this up with +\mathbf+, which implements
% the {\bfseries bold upright} text font for use in math!)
% 
% \subsection{Using the AMS math symbol fonts}
% The TM-Math font set includes matching AMS symbol fonts, too.
% \LaTeX{} will use these, if the package \texttt{amssymb} 
% is loaded in conjunction with \texttt{tmmaths}.  The sequence of loading does
% not matter.
%
% \subsection{Changes over \texttt{tmmath.sty}}
% As compared with MicroPress' original \texttt{tmmath.sty}, this package
% provides a numbe of improvements:
% \begin{itemize}
% \item the option \texttt{slantedGreek}
% \item support for a full upright Greek alphabet, without loading
% any additional package
% \item AMS symbols can be used by just loading the package \texttt{amssymb};
% no extra packages are needed, and the sequence of of loading does not matter.
% \end{itemize}
%
%
% \section{Availability and support}
% The latest versions of these packages can be obtained from the directory
% \path{macros/latex/contrib/psnfssx/tmmath} of any CTAN host.
%
% \noindent
% The TM-Math fonts are provided by 
% \begin{verse}
% MicroPress, Inc.\\
% 6830~Harrow~Street\\
% Forest Hills NY 11375\\
% USA\\
% \texttt{<http://www.micropress-inc.com>}.
% \end{verse}
% 
% 
% \StopEventually{\par\vfill\noindent{\small
% Adobe is a trademark of Adobe Systems Incorporated.
% Times is a registered trademark of Linotype-Hell AG and/or
% its subsidiaries.  Times New Roman is a trademark of The
% Monotype Corporation.
% TM-Math is a trademark of \mbox{MicroPress},~Inc.
% \par}}
%
%
%
% \section{The package code}
%
% \subsection{The options}
% The option for slanted uppercase Greek:
%    \begin{macrocode}
%<*tmmaths>
\newif\iftmmath@slantedGreek
\DeclareOption{slantedGreek}{\tmmath@slantedGreektrue}
\ProcessOptions\relax
%    \end{macrocode}
%
% \subsection{Setting up the text fonts}
% The package \texttt{tmmaths} switches the default roman text font
% family to \texttt{tmr} and provides an improved Aring, at least 
% with OT1 encoding:
%    \begin{macrocode}
\renewcommand*\rmdefault{tmr}
\def\tmmath@Aring
{%
  \leavevmode
  \setbox0\hbox{h}%
  \dimen@\ht0 %
  \advance\dimen@-1ex%
  {\ooalign{\hfil\raise.65\dimen@\hbox{\r{}}\hfil\crcr A}}%
}%
\DeclareTextCompositeCommand{\r}{OT1}{A}{\tmmath@Aring}%
\normalfont
%    \end{macrocode}
%
% \subsection{Setting up the math fonts}
% The definitions of the standard symbol fonts are straightforward:
%    \begin{macrocode}
\DeclareSymbolFont{operators}{OT1}{tmr}{m}{n}%
\SetSymbolFont{operators}{bold}{OT1}{tmr}{bx}{n}%
\DeclareSymbolFont{letters}{OML}{tmm}{m}{it}%
\DeclareSymbolFont{symbols}{OMS}{tmsy}{m}{n}%
\DeclareSymbolFont{largesymbols}{OMX}{tmex}{m}{n}%
\SetSymbolFont{letters}{bold}{OML}{tmm}{b}{it}%
\SetSymbolFont{symbols}{bold}{OMS}{tmsy}{b}{n}%
\DeclareMathAlphabet{\mathbf}{OT1}{tmr}{bx}{n}%
\DeclareMathAlphabet{\mathit}{OT1}{tmr}{m}{it}%
\SetMathAlphabet\mathit{bold}{OT1}{tmr}{bx}{it}%
\DeclareMathAlphabet{\mathbold}{OML}{tmm}{b}{it}
%    \end{macrocode}
%
% \subsection{Lowercase Greek}
% Make +\mathbold+ act on lowercase Greek, too:
%    \begin{macrocode}
\DeclareMathSymbol{\alpha}{\mathalpha}{letters}{11}
\DeclareMathSymbol{\beta}{\mathalpha}{letters}{12}
\DeclareMathSymbol{\gamma}{\mathalpha}{letters}{13}
\DeclareMathSymbol{\delta}{\mathalpha}{letters}{14}
\DeclareMathSymbol{\epsilon}{\mathalpha}{letters}{15}
\DeclareMathSymbol{\zeta}{\mathalpha}{letters}{16}
\DeclareMathSymbol{\eta}{\mathalpha}{letters}{17}
\DeclareMathSymbol{\theta}{\mathalpha}{letters}{18}
\DeclareMathSymbol{\iota}{\mathalpha}{letters}{19}
\DeclareMathSymbol{\kappa}{\mathalpha}{letters}{20}
\DeclareMathSymbol{\lambda}{\mathalpha}{letters}{21}
\DeclareMathSymbol{\mu}{\mathalpha}{letters}{22}
\DeclareMathSymbol{\nu}{\mathalpha}{letters}{23}
\DeclareMathSymbol{\xi}{\mathalpha}{letters}{24}
\DeclareMathSymbol{\pi}{\mathalpha}{letters}{25}
\DeclareMathSymbol{\rho}{\mathalpha}{letters}{26}
\DeclareMathSymbol{\sigma}{\mathalpha}{letters}{27}
\DeclareMathSymbol{\tau}{\mathalpha}{letters}{28}
\DeclareMathSymbol{\upsilon}{\mathalpha}{letters}{29}
\DeclareMathSymbol{\phi}{\mathalpha}{letters}{30}
\DeclareMathSymbol{\chi}{\mathalpha}{letters}{31}
\DeclareMathSymbol{\psi}{\mathalpha}{letters}{32}
\DeclareMathSymbol{\omega}{\mathalpha}{letters}{33}
\DeclareMathSymbol{\varepsilon}{\mathalpha}{letters}{34}
\DeclareMathSymbol{\vartheta}{\mathalpha}{letters}{35}
\DeclareMathSymbol{\varpi}{\mathalpha}{letters}{36}
\DeclareMathSymbol{\varphi}{\mathalpha}{letters}{39}
\DeclareMathSymbol{\varrho}{\mathalpha}{letters}{37}
\DeclareMathSymbol{\varsigma}{\mathalpha}{letters}{38}
%    \end{macrocode}
% The uppercase Greek letters are redefined, if the option
% \texttt{slantedGreeek} has been selected:
%    \begin{macrocode}
\iftmmath@slantedGreek
  \DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{0}
  \DeclareMathSymbol{\Delta}{\mathalpha}{letters}{1}
  \DeclareMathSymbol{\Theta}{\mathalpha}{letters}{2}
  \DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{3}
  \DeclareMathSymbol{\Xi}{\mathalpha}{letters}{4}
  \DeclareMathSymbol{\Pi}{\mathalpha}{letters}{5}
  \DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{6}
  \DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{7}
  \DeclareMathSymbol{\Phi}{\mathalpha}{letters}{8}
  \DeclareMathSymbol{\Psi}{\mathalpha}{letters}{9}
  \DeclareMathSymbol{\Omega}{\mathalpha}{letters}{10}
\fi
%    \end{macrocode}
%
% \subsection{Upright Greek}
% Uppercase upright Greek is taken from the `operators' font:
%    \begin{macrocode}
\DeclareMathSymbol{\upGamma}  {\mathord}{operators}{"00}
\DeclareMathSymbol{\upDelta}  {\mathord}{operators}{"01}
\DeclareMathSymbol{\upTheta}  {\mathord}{operators}{"02}
\DeclareMathSymbol{\upLambda} {\mathord}{operators}{"03}
\DeclareMathSymbol{\upXi}     {\mathord}{operators}{"04}
\DeclareMathSymbol{\upPi}     {\mathord}{operators}{"05}
\DeclareMathSymbol{\upSigma}  {\mathord}{operators}{"06}
\DeclareMathSymbol{\upUpsilon}{\mathord}{operators}{"07}
\DeclareMathSymbol{\upPhi}    {\mathord}{operators}{"08}
\DeclareMathSymbol{\upPsi}    {\mathord}{operators}{"09}
\DeclareMathSymbol{\upOmega}  {\mathord}{operators}{"0A}
%    \end{macrocode}
% The lowercase upright Greek letters are -- unfortunately -- not in the `letters'
% font, so we  need to set up a particular math alphabet for them:
%    \begin{macrocode}
\DeclareFontFamily{U}{tmrmex}{}
\DeclareFontShape{U}{tmrmex}{m}{n}{<->tmrm10ex}{}
\DeclareFontShape{U}{tmrmex}{b}{n}{<->tmrb10ex}{}
\DeclareSymbolFont{upright}{U}{tmrmex}{m}{n}%
\SetSymbolFont{upright}{bold}{U}{tmrmex}{b}{n}
\DeclareMathSymbol{\upalpha}{\mathord}{upright}{211}
\DeclareMathSymbol{\upbeta}{\mathord}{upright}{212}
\DeclareMathSymbol{\upgamma}{\mathord}{upright}{213}
\DeclareMathSymbol{\updelta}{\mathord}{upright}{214}
\DeclareMathSymbol{\upepsilon}{\mathord}{upright}{215}
\DeclareMathSymbol{\upzeta}{\mathord}{upright}{216}
\DeclareMathSymbol{\upeta}{\mathord}{upright}{217}
\DeclareMathSymbol{\uptheta}{\mathord}{upright}{218}
\DeclareMathSymbol{\upiota}{\mathord}{upright}{219}
\DeclareMathSymbol{\upkappa}{\mathord}{upright}{220}
\DeclareMathSymbol{\uplambda}{\mathord}{upright}{221}
\DeclareMathSymbol{\upmu}{\mathord}{upright}{222}
\DeclareMathSymbol{\upnu}{\mathord}{upright}{223}
\DeclareMathSymbol{\upxi}{\mathord}{upright}{224}
\DeclareMathSymbol{\uppi}{\mathord}{upright}{225}
\DeclareMathSymbol{\uprho}{\mathord}{upright}{226}
\DeclareMathSymbol{\upsigma}{\mathord}{upright}{227}
\DeclareMathSymbol{\uptau}{\mathord}{upright}{228}
\DeclareMathSymbol{\upupsilon}{\mathord}{upright}{229}
\DeclareMathSymbol{\upphi}{\mathord}{upright}{230}
\DeclareMathSymbol{\upchi}{\mathord}{upright}{231}
\DeclareMathSymbol{\uppsi}{\mathord}{upright}{232}
\DeclareMathSymbol{\upomega}{\mathord}{upright}{233}
\DeclareMathSymbol{\upvarepsilon}{\mathord}{upright}{234}
\DeclareMathSymbol{\upvartheta}{\mathord}{upright}{235}
\DeclareMathSymbol{\upvarpi}{\mathord}{upright}{236}
\DeclareMathSymbol{\upvarphi}{\mathord}{upright}{239}
\DeclareMathSymbol{\upvarrho}{\mathord}{upright}{237}
\DeclareMathSymbol{\upvarsigma}{\mathord}{upright}{238}
%    \end{macrocode}
%
% \subsubsection{Miscellaneous symbols}
% The TM-Math fonts provide a ready-made +\hbar+:
%    \begin{macrocode}
\DeclareMathSymbol{\hbar}{\mathord}{letters}{"80}%
%    \end{macrocode}
%
% \subsection{Using the AMS packages and fonts}
% The following code is deferred until +\begin{document}+:
%    \begin{macrocode}
\AtBeginDocument{%
%    \end{macrocode}
% Fix multiple integrals from \texttt{amsmath} for use with TM-Math fonts:
%    \begin{macrocode}
  \@ifpackageloaded{amsmath}{%
    \def\intkern@{\mkern-3mu\mathchoice{\mkern-1.5mu}{}{}{}}%
  }{}
%    \end{macrocode}
% AMS symbols should be taken from the TM fonts:
%    \begin{macrocode}
  \DeclareFontFamily{U}{msa}{}
  \DeclareFontShape{U}{msa}{m}{n}{<->tmam10}{}
  \DeclareFontFamily{U}{msb}{}
  \DeclareFontShape{U}{msb}{m}{n}{<->tmbm10}{}
}
%</tmmaths>
%    \end{macrocode}
%
%
% \section*{DocStrip modules in the source file \texttt{tmmaths.dtx}}
% \begin{quote}
% \begin{tabular}{ll}
% module: & contents:\\[0.5ex]
% +tmmaths+ & file \texttt{tmmaths.sty}\\
% +driver+ &  driver for documentation \\
% \end{tabular}
% \end{quote}
%
%
% \Finale
%
%
% \iffalse
% The next line of code prevents DocStrip from adding the
% character table to the modules:
\endinput
% \fi
%
%% \CharacterTable
%%  {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
%%   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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%