The beton package

Frank Jensen

1995/03/05

1 Introduction

The purpose of the beton package is to provide a setup so that documents using the package will automatically be typeset with the Concrete fonts designed by Don Knuth.

The beton package is based on Knuth’s macros for the book “Concrete Mathematics” [1]. Knuth’s macros can be found through anonymous ftp to labrea.

stanford.edu: look for the file gkpmac.tex in directory pub/tex/local/lib.

Also, the fonts can be found at that site: look in directory pub/tex/local/cm.

The Concrete fonts look best with a larger value for \baselineskip than the value normally used with the Computer Modern fonts. Therefore, the beton package makes some decisions about line spacing that override the values specified by the standard L^{A}TEX classes and packages. See Section 4 for further details.

In [1], the margin contains numerous humorous notes, so-called ‘graffiti’, contributed by the students that attended the course by Graham, Knuth, and Patashnik. These graffiti are typeset in a nine point slanted condensed version of the Concrete fonts. The current version of the beton package does not provide any commands to support such graffiti. However, such commands could easily be provided, e.g., by changing the \marginpar command.

The beton package deals with the text font issues of [1]; i.e., it does not make any decisions about page layout (such as the height and width of the text area), font size, numbering scheme (e.g., [1] uses the page number for the numbering of tables [but not figures, since the book doesn’t have any numbered illustrations]; use a separate package to get such a scheme), math fonts (use the euler package to get this distinctive part of the look of [1]), or the amount of space above and below displayed equations. However, the beton package does set up the following:

• Concrete fonts for text (Section 3).

• Increased value for \baselineskip (Section 4). This may not be appropriate for documents with short lines (e.g., two-column documents), so an option (standard-baselineskips) is provided to turn this feature off.

• An option (oldstyle-equation-numbers) to request ‘oldstyle’ numerals for equation numbers (Section 5).

• An option (concrete-math) to request ‘concrete’ math, if you insist (Section 6).^{1}

• Some commands to ‘fine tune’ the typography (Section 7).

Last, a note about the name of the present package: “beton” is the danish word for the ‘hard’ meaning of the english word “concrete” (and since there already exists a package of the name “concrete” by Frank Mittelbach and Rainer Schöpf, I chose “beton” for mnemonic reasons).

2 Hello world

First, we announce the package.

1 ⟨∗package⟩

 2 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
 3 \ProvidesPackage{beton}[\filedate\space\fileversion]
 4 \typeout{Package: `beton' \fileversion\space <\filedate> (FJ)}

3 Font definitions

The Concrete family comes in medium normal, medium italic, medium slanted, and medium caps and small caps. The .fd files for this family are defined in the cmfonts.fdd file (part of the L^{A}TEX ‘base’ distribution). Note that these .fd files are not generated during the normal installation process for L^{A}TEX; you have to explicitly run L^{A}TEX on the cmextra.ins file.

There are no bold variants of the Concrete fonts. However, in [1], Knuth chose the bold extended font from the Computer Modern (Roman) family to go with the Concrete fonts. The .fd files for the Concrete fonts implement this choice.

Instead of the CMR bold extended font, I recommend the CM Sans Serif demibold condensed font.^{2} Simply put the following lines in the preamble or in a package file (do not put spaces within the arguments to \DeclareFontShape):

\AtBeginDocument
  {\DeclareFontShape\encodingdefault{ccr}{bx}{n}{<->sub*cmss/sbc/n}{}%
   \DeclareFontShape\encodingdefault{ccr}{bx}{it}{<->sub*cmss/sbc/it}{}%
   \DeclareFontShape\encodingdefault{ccr}{bx}{sl}{<->sub*cmss/sbc/sl}{}%
   \DeclareFontShape\encodingdefault{ccr}{bx}{sc}{<->sub*cmss/sbc/sc}{}}

Or, alternatively, use the medium weight Concrete (Roman) fonts for headings (and other places where bold is commonly used). In my opinion, both alternatives are better than CMR bold extended.

There is also a math italic version of the Concrete fonts; the .fd file for this subfamily is also defined in cmfonts.fdd.

1Footnote numbers are typeset in math mode, so if the math fonts are not properly set up, these numbers will come out wrong. The euler package and the concrete-math option will both provide a proper setup.

2In 1992, I was involved in the production of a math book using Concrete for text and Euler for math; in that book, all headings were set in CM Sans Serif demibold condensed. (The layout and the choice of fonts were decided by a reputable danish designer.)

To typeset graffiti, special nine point condensed variants of the Concrete slanted and the Concrete math italic fonts were designed. These variants are not used by the current version of the beton package.

We set the default family for \rm to Concrete Roman:

 5 \def\rmdefault{ccr}

4 Baselineskip settings

Knuth chose a high value for \baselineskip to compensate for the relatively heavy (compared to Computer Modern) weight of the Concrete fonts.

\beton@baselineskip@table We specify the desired values for \baselineskip at various point sizes in a style similar to font definitions. Here is a tentative specification for the most important sizes of the Concrete fonts:

 6 \def\beton@baselineskip@table
 7 {<\@viiipt>10<\@ixpt>11.5<\@xpt>13<\@xipt>14.5<\@xiipt>16}

\@setfontsize All the standard L^{A}TEX size-changing commands (\small, \large, etc.) are defined in terms of the \@setfontsize macro. This macro is called with the following three arguments: #1 is the size-changing command; #2 is the font size; #3 is the \baselineskip value. We modify this macro to check

\beton@baselineskip@table for an alternative \baselineskip value.
 8 \def\beton@new@setfontsize#1#2#3%
 9 {\edef\@tempa{\def\noexpand\@tempb####1<#2}%
10  \@tempa>##2<##3\@nil{\def\beton@baselineskip@value{##2}}%
11  \edef\@tempa{\noexpand\@tempb\beton@baselineskip@table<#2}%
12  \@tempa><\@nil
13  \ifx\beton@baselineskip@value\@empty
14  \def\beton@baselineskip@value{#3}%
15  \fi
16  \beton@old@setfontsize{#1}{#2}\beton@baselineskip@value}

Since the oldlfont and newlfont packages redefine the \@setfontsize macro, we defer our changes until the end of the preamble. (See also Section 8.)

17 \AtBeginDocument
18 {\let\beton@old@setfontsize=\@setfontsize
19  \let\@setfontsize=\beton@new@setfontsize}

The \baselineskip values specified in the above table should be appropriate for most purposes, i.e., for one-column material in the normal article/report/book formats. However, it is usually desirable to use a smaller vaue for \baselineskip in two-column material. We therefore provide the option standard-baselineskips to turn off the above automatic mechanism for \baselineskip settings. (An alternative way to exercise control over the \baselineskip settings is to redefine

the \beton@baselineskip@table macro.)
20 \DeclareOption{standard-baselineskips}
21 {\AtBeginDocument{\let\@setfontsize=\beton@old@setfontsize}}

Note that the \let-assignment has to be executed after \beton@old@setfontsize has been defined; this is ensured by \AtBeginDocument and the fact that options to the beton package is processed at the end of the package (Section 8).

5 Equation numbers

\theequation \beton@oldstyle In [1], equation numbers are typeset with oldstyle numerals (from the math italic font). You have to specify the oldstyle-equation-numbers option to get them.

22 \DeclareOption{oldstyle-equation-numbers}
23 {\@ifundefined{chapter}
24  {\def\theequation{{\beton@oldstyle\arabic{equation}}}}
25  {\def\theequation{{\beton@oldstyle\thechapter}.%
26  {\beton@oldstyle\arabic{equation}}}}}
27 \DeclareRobustCommand\beton@oldstyle{\usefont{OML}{ccm}\f@series{it}}

Here, we assume that \thechapter generates a number (note that in appendices, we will get math italic letters as ‘chapter numbers’!). We also assume the standard format for equation numbers.

The \beton@oldstyle macro is also used in the definition of the \t accent macro (Section 7).

\oldstylenums \TextOldstyle \MathOldstyle We provide a new definition of the \oldstylenums macro: this definition allows

us to modify the generation of oldstyle numerals in text and in math separately,

using two hooks, \TextOldstyle and \MathOldstyle.
28 \DeclareRobustCommand\oldstylenums[1]%
29 {\begingroup
30  \spaceskip\fontdimen\tw@\font
31  \TextOldstyle \MathOldstyle #1%
32 \endgroup}

In text, oldstyle digits should come from the Concrete fonts.

33 \let\TextOldstyle=\beton@oldstyle

By default, oldstyle digits in math come from the ‘letters’ symbol font (this is also true if the concrete-math option to the beton package is specified).

34 \providecommand\MathOldstyle{\mathgroup\symletters}

6 Concrete math

The Concrete fonts were designed to blend well with the Euler math fonts, so I recommend the euler package to go with the beton package. If, however, for some reason, you wish to use the few Concrete fonts available for math, you can specify the concrete-math option for the beton package.

The concrete-math option selects Concrete Roman for math symbol font ‘operators’ and Concrete math italic for math symbol font ‘letters’. No bold versions and no ‘symbols’ or ‘largesymbols’ symbol fonts are available.

35 \DeclareOption{concrete-math}
36 {\DeclareSymbolFont{operators}{OT1}{ccr}{m}{n}%
37  \DeclareSymbolFont{letters}{OML}{ccm}{m}{it}}

We specify OT1 encoding (not \encodingdefault) for the ‘operators’ symbol font, since uppercase greek letters still come from this font in the standard setup.

7 Miscellany

\dash \qback \t Knuth added a little extra space around em-dashes in [1]; this is obtained by typing \dash---. Also, the ending double-quote is pulled a little closer to commas and

periods (,\qback'' and .\qback'').

The ‘tie-after’ (\t) accent macro needs a math italic font: Knuth’s macros use CM (my hypothesis is that this is due to historical reasons: Knuth may have decided to switch to oldstyle numerals for equation numbers after he wrote the \t macro). I believe Concrete should be used: Surely, it is best to have the accent come from the same font [family] as the accentee?

38 \def\dash---{\thinspace---\hskip.16667em\relax}
39 \def\qback{\kern-.15em} % between , or . and ''
40 \def\t#1{{\edef\next{\the\font}\beton@oldstyle\accent"7F\next#1}}

8 Processing options

Finally, we must remember to process the options:

41 \ProcessOptions

At this point, we have completed our changes to the \@setfontsize macro (through the \AtBeginDocument hook). To make the changes take effect (i.e., setting the correct \baselineskip value), we execute the \normalsize command.

42 \AtBeginDocument{\normalsize}

43 ⟨/package⟩

References

[1] R. L. Graham, D. E. Knuth, and O. Patashnik. Concrete Mathematics. Addison-Wesley, 1989.