Debian Codegraph @

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

raw
1 % \CheckSum{115}
2 % \iffalse
3 %
4 % concmath.dtx --- LaTeX package for Concrete Math fonts.
5 %
6 % Copyright (C) 1995--99 Ulrik Vieth
7 %
8 % This program is free software; you can redistribute it and/or
9 % modify it under the terms of the LaTeX Project Public License
10 % as described in lppl.txt in the base LaTeX distribution; either
11 % version 1 of the License, or (at your option) any later version.
12 %
13 % This program is distributed in the hope that it will be useful,
14 % but WITHOUT ANY WARRANTY; without even the implied warranty of
15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 %
17 % \fi
18 %
19 % \iffalse
20 %<*driver>
21 \documentclass[fleqn]{ltxdoc}
22 \usepackage[amssymb]{concmath}
23 \usepackage{mflogo}
24 \renewcommand\baselinestretch{1.1}
25 \begin{document}
26 \DocInput{concmath.dtx}
27 \end{document}
28 %</driver>
29 % \fi
30 %
31 %
32 % \title{The \texttt{concmath} package}
33 % \author{Ulrik Vieth}
34 % \date{1999-03-10 v2.0}
35 %
36 % \maketitle
37 %
38 % \section{About this package}
39 %
40 % The \texttt{concmath} package for \LaTeXe{} provides access to
41 % the Concrete Math fonts that were derived from the Concrete Roman
42 % fonts designed by Don Knuth \cite{DEK:Concrete,DEK:TUB-Concrete}.
43 % While the Concrete Roman fonts were originally developed as a
44 % text fonts to be used in combination with the AMS Euler fonts in
45 % math mode, the Concrete Math fonts provides a complementary set
46 % of math fonts, so that the Concrete typefaces may be used as a
47 % complete replacement for Computer Modern \cite{DEK:VolumeE}.
48 %
49 % Loading the \texttt{concmath} package without any options has the
50 % effect of switching the default text font family to Concrete
51 % Roman and redeclaring the default math symbol fonts and math
52 % alphabets to use Concrete Math. In addition, the
53 % \texttt{concmath} package also provides the following package
54 % options that may be used to activate some extra features:
55 %
56 % \textbf{The `\textsf{exscale}' option:} This option provides
57 % the functionality of the `\textsf{exscale}' package from the
58 % \LaTeX{} base distribution, but using scaled sizes of the
59 % Concrete version of the math extension font instead of Computer
60 % Modern.
61 %
62 % \textbf{The `\textsf{amsfonts}' and `\textsf{amssymb}' options:}
63 % These options provide the functionality of the standard
64 % `\textsf{amsfonts}' and `\textsf{amssymb}' packages, but using
65 % the Concrete versions of the AMS symbol fonts and math alphabets.
66 %
67 % \textbf{The `\textsf{sansbold}' option:} This option redefines
68 % the default bold series to use semibold condensed, thereby
69 % replacing the bold extended version of Computer Modern Roman by
70 % the semibold condensed version of Computer Modern Sans Serif in
71 % bold material such as titles and section headings. Since there
72 % are different opinions among package writers as to which of these
73 % choices is better suited for use in combination with Concrete
74 % Roman, both have been used in various \LaTeX{} packages
75 % \cite{latex-beton, latex-euler, latex-ccfonts} and both are
76 % supported in this package as well.
77 %
78 % Before we eventually get to the implementation of the
79 % \texttt{concmath} package and the corresponding font definition
80 % files, we shall first review the history of the Concrete Roman
81 % and Concrete Math font families. In particular, we shall discuss
82 % the procedure how the Concrete Math fonts were derived from the
83 % Concrete Roman fonts by applying systematic changes to the \MF{}
84 % parameter files.
85 %
86 %
87 % \section{History of the `Concrete Roman' fonts}
88 %
89 % When Don Knuth and his co-authors wrote \textit{Concrete
90 % Mathematics} \cite{DEK:Concrete,DEK:TUB-Concrete}, they decided
91 % to make their book typographically interesting by making it the
92 % first one to use a new family of typefaces. The book was to be
93 % set using the AMS Euler fonts designed by Hermann Zapf, replacing
94 % the usual Computer Modern fonts in math mode. As for the text
95 % font, the original intention was to use Computer Modern Roman as
96 % usual. However, the combination of Computer Modern in text mode
97 % and Euler in math mode soon turned out to be unsatisfactory, and
98 % Don Knuth eventually set out to develop a heavier variant of
99 % Computer Modern Roman that was better suited to match the
100 % somewhat darker color of the Euler fonts.
101 %
102 % The result was a square-serif style typeface named Concrete
103 % Roman, along with \textit{italics}, \textsl{slanted}, and
104 % \textsc{small-caps} variants for emphasis and various mark-up
105 % elements. Unlike Computer Modern Roman, Concrete Roman features
106 % a relatively uniform stroke thickness and does not exhibit strong
107 % contrasts between hairlines and stems, making it particularly
108 % robust for use in low-resolution printing, but also in
109 % display-oriented applications such as transparencies or posters.
110 %
111 % The original distribution of Knuth's Concrete fonts consisted
112 % exclusively of text fonts. There was no bold series, nor were
113 % there any math fonts, since the latter were to be taken from the
114 % Euler fonts (or Computer Modern for the geometric math symbols).
115 % While there does exists a Concrete Math Italics font shape,
116 % \texttt{ccmi10}, this does not actually represent a math font and
117 % was not designed to be used as such. It only serves as an extra
118 % text font that provides access to the oldstyle numerals
119 % \oldstylenums{0123456789} and miscellaneous text symbols, such as
120 % the tie accent. However, given the meta-ness inherent in the
121 % designs of the Computer Modern typefaces \cite{DEK:VolumeE}, it
122 % is relatively easy to develop a complete set of Concrete math
123 % fonts by applying some simple heuristics, as we shall see in the
124 % following section.
125 %
126 %
127 % \section{Design of the `Concrete Math' fonts}
128 %
129 % The Concrete Math fonts (also known as `\texttt{concmath}' fonts)
130 % were developed by the author in early 1995, originally for use in
131 % a poster presentation. When the use of magnified sizes of
132 % Computer Modern math fonts printed at low resolution turned out
133 % to be unsatisfactory for comfortable reading in poster sizes, the
134 % need for a somewhat darker alternative became apparent. Since
135 % the only existing alternative would have been to use the AMS
136 % Euler fonts in math mode, which were deemed a little too exotic
137 % for the intended application, the author set out to investigate
138 % the possibilities of generating a complete set of Concrete Math
139 % fonts by applying systematic changes to the \MF{} parameter
140 % files.
141 %
142 % An initial comparison of the existing parameter files for
143 % \texttt{ccr10} and \texttt{ccmi10} revealed that they were almost
144 % identical except for the font identifier, the slant parameter,
145 % several boolean variables, and the call to the \MF{} driver file.
146 % Unlike in the case of \texttt{cmr10} and \texttt{cmmi10}, there
147 % were no differences in the design parameters governing the
148 % appearance of the character shapes, so it became almost trivial
149 % to generate a full set of Concrete Math Italics fonts in the
150 % usual range of sizes between 5\,pt and 10\,pt by starting from
151 % the \texttt{ccr} parameter files and applying the necessary
152 % systematic changes listed in Table~\ref{tab:cc-parameters} to
153 % produce a math font.
154 %
155 % \begin{table}[tb]
156 % \small
157 % \begin{tabular}{lllllll}
158 % font encoding:
159 % & OT1 & OML & OMS & OMX
160 % & U+msa & U+msb \\
161 % font name:
162 % & \texttt{ccr10} & \texttt{xccmi10} & \texttt{xccsy10} & \texttt{xccex10}
163 % & \texttt{xccam10} & \texttt{xccbm10} \\
164 % font identifier:
165 % & \texttt{"CCR"} & \texttt{"CCMI"} & \texttt{"CCSY"} & \texttt{"CCEX"}
166 % & \texttt{"CCAM"} & \texttt{"CCBM"} \\
167 % parameters:
168 % & --- & \texttt{ccr10} & \texttt{ccr10} & \texttt{ccr10}
169 % & \texttt{ccr10} & \texttt{ccr10} \\
170 % fontdimens:
171 % & --- & --- & \texttt{cmsy10} & \texttt{cmex10}
172 % & \texttt{cmsy10} & \texttt{cmsy10} \\
173 % \textit{slant}: & 0 & 0.25 & 0.25 & 0 & 0 & 0.25 \\
174 % \textit{variant\_g}:
175 % & \textbf{false} & \textbf{true} & irrelevant & irrelevant
176 % & irrelevant & irrelevant \\
177 % \textit{math\_fitting}:
178 % & \textbf{false} & \textbf{true} & \textbf{true} & \textbf{false}
179 % & \textbf{true} & \textbf{true} \\
180 % \textbf{generate}:
181 % & \texttt{roman} & \texttt{mathit} & \texttt{mathsy} & \texttt{mathex}
182 % & \texttt{amsya} & \texttt{amsyb} \\
183 % \end{tabular}
184 % \bigskip
185 % \caption{\label{tab:cc-parameters}
186 % Comparison of the parameters for the Concrete Math typefaces.}
187 % \end{table}
188 %
189 % The resulting font shapes were called \texttt{xccmi} where the
190 % prefix `\texttt{x}' was used to avoid any potential name
191 % conflicts with font shapes from Don Knuth's distribution of the
192 % Concrete fonts, particularly in the case of \texttt{ccmi10},
193 % which despite its name is not a real math font, as discussed
194 % earlier.
195 %
196 % After the Concrete Math Italics fonts were in place, the next
197 % step was to create suitable math symbol and math extension fonts.
198 % Once again, the author started with a comparison of the parameter
199 % files of the corresponding Computer Modern fonts, which revealed
200 % that \texttt{cmmi} and \texttt{cmsy} were identical except for
201 % the font identifier, the driver file, and the extra |\fontdimen|
202 % parameters in \texttt{cmsy} that are required for use as a math
203 % symbol font in |\textfont2|. Similarly, the parameters of
204 % \texttt{cmex} matched those of \texttt{cmr} except for the font
205 % identifier, the driver file, and the |\fontdimen|s in
206 % \texttt{cmex} for a math extension font in |\textfont3|.
207 %
208 % In both cases, the corresponding Concrete versions, named
209 % \texttt{xccsy} and \texttt{xccex}, could be derived easily by
210 % starting from \texttt{xccmi}, applying some systematic changes,
211 % and merging in the code for the |\fontdimen| parameters from
212 % \texttt{cmsy} or~\texttt{cmex}. Since the details of these
213 % parameter calculations weren't documented anywhere, not even in
214 % Knuth's \textit{Computer Modern Typefaces} \cite{DEK:VolumeE},
215 % the author unfortunately had to rely on adapting whatever was
216 % there and hoping that it would somehow work for Concrete Math
217 % just as well.
218 %
219 % Finally, to round off the collection, the author also generated
220 % Concrete versions of the AMS math symbol fonts \texttt{msam} and
221 % \texttt{msbm}, which were called \texttt{xccam} and
222 % \texttt{xccbm}. As in the previous cases, the \MF{} parameter
223 % files of the fonts in question were compared to those of the
224 % Computer Modern math fonts, and it was found that both AMS symbol
225 % fonts were based on the \texttt{cmsy} parameters. The
226 % corresponding Concrete versions were then generated by starting
227 % from \texttt{xccsy} and applying the usual systematic changes.
228 % In the case of \texttt{xccam}, which also contains some text
229 % symbols `$\circledR$' and `$\circledS$' based on small-caps
230 % parameters, the ``lower'' parameters were taken from
231 % \texttt{cccsc10} in the 10\,pt version, but from \texttt{msam}
232 % in the smaller sizes for lack of any other alternatives. While
233 % this may not give optimal results for the circled letters, it
234 % shouldn't have any adverse effect on the math symbols.
235 %
236 %
237 % \StopEventually {
238 % \section*{Acknowledgement}
239 %
240 % Many features implemented in this package have been influenced by
241 % several other \LaTeX{} packages \cite{latex-beton, latex-euler,
242 % latex-ccfonts} that provide a more or less similar functionality.
243 % The author has tried to remain compatible with these packages
244 % wherever possible, although some design decisions have been taken
245 % that may lead to subtle differences. Potential users are invited
246 % to analyze and compare these packages, and to choose whatever
247 % suits them best. We hope that even if you found that another
248 % package provides a better solution for your needs, you may have
249 % still learned something interesting about the background of the
250 % Concrete Roman and Concrete Math fonts from reading this
251 % documentation.
252 %
253 % \begin{thebibliography}{1}
254 % \bibitem{DEK:Concrete}
255 % \textsc{Ronald L. Graham}, \textsc{Donald E. Knuth}, and
256 % \textsc{Oren Patashnik}.
257 % \newblock \textit{Concrete Mathematics}.
258 % \newblock Addison-Wesley, 1989.
259 % \bibitem{DEK:TUB-Concrete}
260 % \textsc{Donald E. Knuth}.
261 % \newblock \textit{Typesetting Concrete Mathematics}.
262 % \newblock \textsl{TUGboat} 10\#1, 31--36, 1989.
263 % \bibitem{DEK:VolumeE}
264 % \textsc{Donald E. Knuth}.
265 % \newblock \textit{Computer Mordern Typefaces}.
266 % \newblock Volume~E of \textit{Computers \& Typesetting}.
267 % \newblock Addison-Wesley, 1986.
268 % \bibitem{latex-beton}
269 % \textsc{Frank Jensen}.
270 % \newblock The \texttt{beton} package.\\
271 % \newblock \texttt{CTAN:macros/latex/contrib/supported/beton/}.
272 % \bibitem{latex-euler}
273 % \textsc{Frank Jensen}.
274 % \newblock The \texttt{euler} package.\\
275 % \newblock \texttt{CTAN:macros/latex/contrib/supported/euler/}.
276 % \bibitem{latex-ccfonts}
277 % \textsc{Walter Schmidt}.
278 % \newblock The \texttt{ccfonts} package.\\
279 % \newblock \texttt{CTAN:macros/latex/contrib/supported/ccfonts/}.
280 % \end{thebibliography}
281 % }
282 %
283 %
284 % \section{The implementation}
285 %
286 % After having reviewed the history of the Concrete Roman and
287 % Concrete Math fonts, we now turn to the implementation of the
288 % \texttt{concmath} \LaTeX{} package and the corresponding font
289 % definition files.
290 %
291 %
292 % \subsection{Hello, World!}
293 %
294 % First, we announce the package and the font definition files.
295 %
296 % \begin{macrocode}
297 %<package>\NeedsTeXFormat{LaTeX2e}[1996/12/01]
298 %<package>\ProvidesPackage{concmath}
299 %<OT1ccr>\ProvidesFile{ot1ccr.fd}
300 %<OMLccr>\ProvidesFile{omlccr.fd}
301 %<OMSccr>\ProvidesFile{omsccr.fd}
302 %<OMLccm>\ProvidesFile{omlccm.fd}
303 %<OMSccsy>\ProvidesFile{omsccsy.fd}
304 %<OMXccex>\ProvidesFile{omxccex.fd}
305 %<Ucca>\ProvidesFile{ucca.fd}
306 %<Uccb>\ProvidesFile{uccb.fd}
307 %<+package>[1999/03/10 v2.0b LaTeX package for Concrete math fonts]
308 %<-package>[1999/03/10 v2.0b LaTeX font defs for Concrete math fonts]
309 % \end{macrocode}
310 %
311 %
312 % \subsection{Font definition files}
313 %
314 % \subsubsection{Concrete Roman}
315 %
316 % Here are the standard font definitions for Concrete Roman,
317 % including the \textit{italics}, \textsl{slanted}, and
318 % \textsc{small-caps} variants, which are usually only available
319 % in~10\,pt size. While it would be a trivial exercise to create a
320 % full set of slanted fonts by taking the \texttt{ccr} parameter
321 % files and setting the slant parameter to~$1/6$ in the
322 % \texttt{ccsl} parameter files, we shall only use the sizes
323 % provided in Knuth's official distribution. As for the italics
324 % and small-caps versions, there is no way to generate appropriate
325 % smaller sizes without extensive tuning and testing to derive new
326 % parameter sets.
327 %
328 % \begin{macrocode}
329 %<*OT1ccr>
330 \DeclareFontFamily{OT1}{ccr}{\hyphenchar\font45 }
331 \DeclareFontShape{OT1}{ccr}{m}{n}{
332 <5> <6> <7> <8> <9> gen * ccr
333 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> ccr10}{}
334 \DeclareFontShape{OT1}{ccr}{m}{sl}{
335 <5> <6> <7> <8> <9> ccsl9
336 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> ccsl10}{}
337 \DeclareFontShape{OT1}{ccr}{m}{it}{
338 <5> <6> <7> <8> <9>
339 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> ccti10}{}
340 \DeclareFontShape{OT1}{ccr}{m}{sc}{
341 <5> <6> <7> <8> <9>
342 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> cccsc10}{}
343 % \end{macrocode}
344 %
345 % Next, here are the font substitutions for the bold series. Since
346 % there is no bold series in Concrete, we will use the
347 % corresponding Computer Modern fonts.
348 %
349 % \begin{macrocode}
350 \DeclareFontShape{OT1}{ccr}{bx}{n} {<-> ssub * cmr/bx/n}{}
351 \DeclareFontShape{OT1}{ccr}{bx}{sl}{<-> ssub * cmr/bx/sl}{}
352 \DeclareFontShape{OT1}{ccr}{bx}{it}{<-> ssub * cmr/bx/it}{}
353 % \end{macrocode}
354 %
355 % Next, here are the font substitutions for the semibold series.
356 % As we shall see below, the \texttt{concmath} package provides a
357 % `\textsf{boldsans}' option which redefines |\bfdefault| and thus
358 % turns all bold material into semibold condensed (which will then
359 % be substituted by semibold condensed sans serif). Since some
360 % people prefer to use semibold condensed Computer Modern Sans
361 % Serif in combination with Concrete Roman, this unusual
362 % substitution allows to switch between both choices by selecting
363 % or omitting a package option.
364 %
365 % \begin{macrocode}
366 \DeclareFontShape{OT1}{ccr}{sbc}{n} {<-> ssub * cmss/sbc/n}{}
367 \DeclareFontShape{OT1}{ccr}{sbc}{sl}{<-> ssub * cmss/sbc/n}{}
368 \DeclareFontShape{OT1}{ccr}{sbc}{it}{<-> ssub * cmss/sbc/n}{}
369 % \end{macrocode}
370 %
371 % Finally, here is the font shape declaration for the special
372 % purpose condensed slanted font that was used in \textit{Concrete
373 % Mathematics} for so-called `graffiti'. The \texttt{concmath}
374 % package does not bother to provide macros for such kinds of
375 % marginal notes, thus users who want to use this feature will have
376 % to develop their own.
377 %
378 % \begin{macrocode}
379 \DeclareFontShape{OT1}{ccr}{c}{sl}{<9> ccslc9}{}
380 %</OT1ccr>
381 % \end{macrocode}
382 %
383 %
384 % \subsubsection{Concrete Roman Font Substitutions}
385 %
386 % For technical reasons it necessary to provide font substitutions
387 % for Concrete Roman text symbols in the `OML' and `OMS' encodings.
388 % Any references to \texttt{ccr} in these encodings will be
389 % substituted by references to the corresponding Concrete math
390 % italics and math symbol fonts.
391 %
392 % \begin{macrocode}
393 %<*OMLccr>
394 \DeclareFontFamily{OML}{ccr}{\skewchar\font127 }
395 \DeclareFontShape{OML}{ccr}{m}{it} {<->ssub * ccm/m/it}{}
396 \DeclareFontShape{OML}{ccr}{bx}{it} {<->ssub * ccm/b/it}{}
397 \DeclareFontShape{OML}{ccr}{sbc}{it}{<->ssub * ccm/m/it}{}
398 %</OMLccr>
399 % \end{macrocode}
400 % \begin{macrocode}
401 %<*OMSccr>
402 \DeclareFontFamily{OMS}{ccr}{\skewchar\font48 }
403 \DeclareFontShape{OMS}{ccr}{m}{n} {<->ssub * ccsy/m/n}{}
404 \DeclareFontShape{OMS}{ccr}{bx}{n} {<->ssub * ccsy/b/n}{}
405 \DeclareFontShape{OMS}{ccr}{sbc}{n}{<->ssub * ccsy/m/n}{}
406 %</OMSccr>
407 % \end{macrocode}
408 %
409 %
410 % \subsubsection{Concrete Math Italics}
411 %
412 % Now, we turn to the font definitions for Concrete Math Italics.
413 % Since the \texttt{xccmi} parameters were derived from
414 % \texttt{ccr} with some systematic changes, these fonts are
415 % available in the same range of sizes, i.e.\ between 5\,pt and
416 % 10\,pt.
417 %
418 % \begin{macrocode}
419 %<*OMLccm>
420 \DeclareFontFamily{OML}{ccm}{\skewchar\font127 }
421 \DeclareFontShape{OML}{ccm}{m}{it}{
422 <5> <6> <7> <8> <9> gen * xccmi
423 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> xccmi10}{}
424 \DeclareFontShape{OML}{ccm}{b}{it}{<-> ssub * cmm/b/it}{}
425 % \end{macrocode}
426 %
427 % Similar to the 9\,pt slanted condensed text font for use in
428 % `graffiti', there also exists a 9\,pt slanted condensed version
429 % of Concrete Math Italics, stripped down to the oldstyle numerals
430 % only. This font shape is included here only for completeness,
431 % and users should be aware that it won't be usable as a math font.
432 %
433 % \begin{macrocode}
434 \DeclareFontShape{OML}{ccm}{c}{it}{<9> ccmic9}{}
435 %</OMLccm>
436 % \end{macrocode}
437 %
438 %
439 % \subsubsection{Concrete Math Symbols}
440 %
441 % Here are the font definitions for the Concrete Math Symbol fonts.
442 % Since the \texttt{xccsy} parameters are identical to those of
443 % \texttt{xccmi} except for the extra |\fontdimen| parameters
444 % (which were adapted from \texttt{cmsy}), these fonts are
445 % available in the same range of sizes as Concrete Roman and
446 % Concrete Math Italics.
447 %
448 % Most of the geometric math symbols that depend only on the rule
449 % thickness will probably turn out to be identical to their
450 % Computer Modern counterparts. However, since the `OMS' encoding
451 % also contains a few greek-like symbols such as `$\nabla$' and
452 % `$\amalg$' that are clearly affected by the parameter changes, a
453 % Concrete version of the math symbol font is obviously necessary.
454 %
455 % \begin{macrocode}
456 %<*OMSccsy>
457 \DeclareFontFamily{OMS}{ccsy}{\skewchar\font48 }
458 \DeclareFontShape{OMS}{ccsy}{m}{n}{
459 <5> <6> <7> <8> <9> gen * xccsy
460 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> xccsy10}{}
461 \DeclareFontShape{OMS}{ccsy}{b}{n}{<-> ssub * cmsy/b/n}{}
462 %</OMSccsy>
463 % \end{macrocode}
464 %
465 %
466 % \subsubsection{Concrete Math Extension}
467 %
468 % Here are the font definitions for the Concrete Math Extension
469 % fonts. Since the \texttt{xccex} parameters are identical to
470 % those of \texttt{ccr} except for the extra |\fontdimen|
471 % parameters (which are adapted from \texttt{cmex}), these fonts
472 % are available in the same range of sizes as Computer Modern Math
473 % Extension, i.e.\ between 7\,pt and 10\,pt. By default, the math
474 % extension font is loaded only in a fixed size at 10\,pt.
475 % However, the \texttt{concmath} package also provides an
476 % `\textsf{exscale}' option to load the math extension font in
477 % scaled sizes.
478 %
479 % \begin{macrocode}
480 %<*OMXccex>
481 \DeclareFontFamily{OMX}{ccex}{}
482 \DeclareFontShape{OMX}{ccex}{m}{n}{<-> sfixed * xccex10}{}
483 %</OMXccex>
484 % \end{macrocode}
485 %
486 %
487 % \subsubsection{Concrete AMS Symbols}
488 %
489 % Finally, here are the font definitions for the Concrete versions
490 % of the AMS symbol fonts, \texttt{msam} and \texttt{msbm}. Since
491 % the parameters of \texttt{xccam} and \texttt{xccbm} are directly
492 % derived from \texttt{xccsy}, these fonts are provided in the full
493 % range of sizes between 5\,pt and 10\,pt.
494 %
495 % As in the case of the Concrete Math Symbol font, most of the
496 % geometric math symbols will probably remain unchanged from the
497 % Computer Modern version, but letter-like symbols such as
498 % `$\yen$', `$\mho$', `$\eth$' or `$\backepsilon$' will obviously
499 % be subject to the parameter changes in the Concrete version,
500 % making it necessary to have Concrete versions of the AMS symbol
501 % fonts in the first place.
502 %
503 % Unfortunately, it appears that some of the characters in the AMS
504 % symbol fonts do not work out very well in the Concrete version or
505 % suffer from undesirable side-effects. One such problem is that
506 % wide accents are getting much heavier than usual:
507 % $$ \tilde{i} \quad \widetilde{ii} \quad \widetilde{iii}
508 % \quad \widetilde{iiii} \quad \widetilde{iiiiii}
509 % \quad \widetilde{iiiiiiii}
510 % $$
511 % Another problem is that some characters, such as `$\varkappa$' or
512 % `$\digamma$', do not reflect the parameter changes for a Concrete
513 % version and still exhibit noticeable contrasts between stems and
514 % hairlines typical of Computer Modern fonts. It is possible that
515 % this behavior may be due to sub-optimal or inappropriate \MF{}
516 % coding. However, the author decided to refrain from changes to
517 % the AMS font sources for the sake of compatibility.
518 %
519 %
520 % \begin{macrocode}
521 %<*Ucca>
522 \DeclareFontFamily{U}{cca}{}
523 \DeclareFontShape{U}{cca}{m}{n}{
524 <5> <6> <7> <8> <9> gen * xccam
525 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> xccam10}{}
526 %</Ucca>
527 % \end{macrocode}
528 % \begin{macrocode}
529 %<*Uccb>
530 \DeclareFontFamily{U}{ccb}{}
531 \DeclareFontShape{U}{ccb}{m}{n}{
532 <5> <6> <7> <8> <9> gen * xccbm
533 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> xccbm10}{}
534 %</Uccb>
535 % \end{macrocode}
536 %
537 %
538 % \subsection{The \texttt{concmath} package}
539 %
540 % After we have discussed the font definition files, we now turn to
541 % the \texttt{concmath} package itself, starting with the
542 % declaration of package options.
543 %
544 %
545 % \subsubsection{Declaring package options}
546 %
547 % As mentioned in the introduction, the \texttt{concmath} package
548 % provides an `\textsf{exscale}' option that provides the
549 % functionality of the `\textsf{exscale}' package from the \LaTeX{}
550 % base distribution, but using the Concrete version of the math
551 % extension font.
552 %
553 % Since it doesn't seem to be possible to nest a
554 % |\DeclareFontShape| declaration within the |\AtBeginDocument|
555 % hook, we have to make use of a global switch |\ifcc@exscale| and
556 % put the relevant code directly into the package file to be
557 % executed immediately after |\ProcessOptions|. Apart from this
558 % minor complication, the code for this option is relatively
559 % simple. We just load the default \LaTeX{} `\textsf{exscale}'
560 % package and redeclare the |largesymbols| symbol font afterwards.
561 %
562 % \begin{macrocode}
563 %<*package>
564 \newif\ifcc@exscale \cc@exscalefalse
565 \DeclareOption{exscale}{%
566 \cc@exscaletrue % something to do after \ProcessOptions
567 \AtBeginDocument{\RequirePackage{exscale}
568 \DeclareSymbolFont{largesymbols}{OMX}{ccex}{m}{n}}}
569 % \end{macrocode}
570 %
571 % The declaration of `\textsf{amsfonts}' and `\textsf{amssymb}'
572 % options is similar, but slightly easier. Here, wee simply load
573 % the relevant \LaTeX{} package files and redeclare the AMS Symbol
574 % fonts afterwards using the Concrete versions.
575 %
576 % \begin{macrocode}
577 \DeclareOption{amsfonts}{%
578 \AtBeginDocument{\RequirePackage{amsfonts}
579 \DeclareSymbolFont{AMSa}{U}{cca}{m}{n}
580 \DeclareSymbolFont{AMSb}{U}{ccb}{m}{n}
581 \DeclareSymbolFontAlphabet{\mathbb}{AMSb}}}
582 \DeclareOption{amssymb}{%
583 \AtBeginDocument{\RequirePackage{amssymb}
584 \DeclareSymbolFont{AMSa}{U}{cca}{m}{n}
585 \DeclareSymbolFont{AMSb}{U}{ccb}{m}{n}
586 \DeclareSymbolFontAlphabet{\mathbb}{AMSb}}}
587 % \end{macrocode}
588 %
589 % Finally, here is the declaration of the `\textsf{boldsans}'
590 % option that allows to globally turn bold titles and headings into
591 % sans serif semibold condensed, if that is what you prefer to use
592 % in combination with a Concrete Roman text font.
593 %
594 % \begin{macrocode}
595 \DeclareOption{boldsans}{%
596 \renewcommand{\bfdefault}{sbc}}
597 % \end{macrocode}
598 %
599 %
600 % \subsubsection{Setting up defaults for text and math mode}
601 %
602 % Now, let's finish off the package file with the code to set up
603 % the defaults to use Concrete Roman and Concrete Math. For the
604 % text, we begin by setting the default text font family to
605 % Concrete Roman.
606 %
607 % \begin{macrocode}
608 \renewcommand{\rmdefault}{ccr}
609 % \end{macrocode}
610 %
611 % For the math, we redeclare all the standard symbol fonts using
612 % the Concrete versions. Since the encodings of these fonts are
613 % exactly the same as those of their Computer Modern counterparts,
614 % there is fortunately no need to repeat all the tedious
615 % |\DeclareMathSymbol| commands from \texttt{fontmath.ltx}.
616 %
617 % \begin{macrocode}
618 \DeclareSymbolFont{operators} {OT1}{ccr} {m}{n}
619 \DeclareSymbolFont{letters} {OML}{ccm} {m}{it}
620 \DeclareSymbolFont{symbols} {OMS}{ccsy}{m}{n}
621 \DeclareSymbolFont{largesymbols}{OMX}{ccex}{m}{n}
622 % \end{macrocode}
623 % \begin{macrocode}
624 \SetSymbolFont{operators} {bold}{OT1}{ccr} {bx}{n}
625 \SetSymbolFont{letters} {bold}{OML}{ccm} {b}{it}
626 \SetSymbolFont{symbols} {bold}{OMS}{ccsy}{b}{n}
627 % \end{macrocode}
628 %
629 % After the math symbol fonts have been set up, we also have to
630 % redeclare the math alphabets to use the newly defined Concrete
631 % versions.
632 %
633 % \begin{macrocode}
634 \DeclareSymbolFontAlphabet{\mathrm} {operators}
635 \DeclareSymbolFontAlphabet{\mathnormal}{letters}
636 \DeclareSymbolFontAlphabet{\mathcal} {symbols}
637 \DeclareMathAlphabet {\mathbf}{OT1}{ccr}{bx}{n}
638 \DeclareMathAlphabet {\mathit}{OT1}{ccr}{m}{it}
639 % \end{macrocode}
640 %
641 % Finally, we have to adapt the definition of |\oldstylenums| from
642 % the \LaTeX{} format to use the Concrete version of the oldstyle
643 % numerals \oldstylenums{0123456789}. It is a little unfortunate
644 % that there is still one last remaining hard-wired reference to
645 % Computer Modern fonts in \texttt{latex.ltx}, making it necessary
646 % to repeat the whole definition with trivial changes, but there's
647 % little we can do about it.
648 %
649 % Since this package does not try to imitate the look and feel of
650 % Knuth's \textit{Concrete Mathematics}, we don't bother about
651 % setting up equation numbers to be printed using oldstyle numbers.
652 % The latter is a design decision independent of the choice of
653 % fonts that's probably better left to the individual application.
654 %
655 % \begin{macrocode}
656 \def\oldstylenums#1{%
657 \begingroup
658 \spaceskip\fontdimen\tw@\font
659 \usefont{OML}{ccm}{\f@series}{it}%
660 \mathgroup\symletters #1%
661 \endgroup}
662 % \end{macrocode}
663 %
664 %
665 % \subsubsection{Executing options}
666 %
667 % After all the default values have been set up for Concrete Roman
668 % and Concrete Math, all that's left to do is to process the
669 % options and take special care of the `\textsf{exscale}' option.
670 % The font shape declarations for the scaled version of the
671 % Concrete Math Extension font are embedded directly in the package
672 % file rather than an external font definition file, but they will
673 % be executed only if the |\ifcc@exscale| flag has been set true
674 % during the option processing.
675 %
676 % \begin{macrocode}
677 \ProcessOptions
678 \ifcc@exscale
679 \DeclareFontFamily{OMX}{ccex}{}
680 \DeclareFontShape{OMX}{ccex}{m}{n}{
681 <-8> sfixed * xccex7 <8> xccex8 <9> xccex9
682 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> xccex10}{}
683 \fi
684 %</package>
685 % \end{macrocode}
686 % This concludes the implementation of the \texttt{concmath} package.
687 %
688 % \Finale
689 \endinput