The mflogo package^{∗}

Ulrik Vieth

             vieth@thphy.uni-duesseldorf.de

1995/12/04

1 Introduction

This contributed package for L^{A}TEX 2ε provides the font declarations needed to access the logo font family in terms of NFSS.^{1} It also provides a little example package file that shows how to define the and logos and some appropriate font changing commands in these terms.

Using this package, there should no longer be a need to define special macros for the slanted version of these logos, and it should be possible to avoid such errors as on page 2 of The L^{A}TEX Companion where the logo appears in upright shape within an italics context of a book title.

\logofamily Once you have installed the font definition file Ulogo.fd provided here, you

\textlogo can use low-level NFSS commands to access the logo fonts in your documents, even if you do not plan to use the example package mflogo.sty. Apart from defining the and logos in terms of NFSS, that package file also provides a declarative font changing command \logofamily and a font changing command \textlogo with one argument.

2 The �������� source files

In this package, we assume that your TEX distribution includes the sources for the logo font family, available from the directory /systems/knuth/lib on the CTAN network. These consists of the program file logo.mf^{2} and a number of driver files for various font shapes and sizes, all of them described in The book.

We also assume that your installation has the additional variants of the logo

fonts (logosl9 and logod10) from the directory /systems/knuth/local/lib.

Many modern TEX distributions already have them included, but in case you don’t have them, it shouldn’t be too difficult to retrieve them individually.

∗This file has version number v1.5c, last revised 1995/12/04.

1Throughout this document, the term NFSS should be understood to refer to release 2 of NFSS, i.e. the release that’s part of L^{A}TEX 2ε and that’s intended to become part of L^{A}TEX3 in the future.

2Please note that the file logo.mf has been updated by DEK in 1993, adding the letters ‘ ’ and ‘ ’ for the logo. If TEX complains about missing characters in some of the logo fonts while processing this documentation, you should consider updating your copy of logo.mf and regenerating all the logo fonts.

Finally, in order to provide a reasonably orthogonal range of sizes and shapes, this package uses another non-standard variant of the logo fonts (logosl8), which is derived from the existing variants by analogy.^{3} The source for this font shape is distributed separately with this package since we want to avoid the overhead of Docstrip in such a trivial file, which would result if it were generated from the same .dtx file as the L^{A}TEX font definitions and the example package file.

3 The font definition file: Ulogo.fd

Before we come to the actual L^{A}TEX package file, let us first turn to the font definition file for the logo font family.

1 ⟨∗Ulogo⟩

 2 \ProvidesFile{Ulogo.fd}
 3 [1995/12/04 v1.5c LaTeX font definitions for METAFONT logo fonts]

The first thing to do is to declare a new font family logo using an appropriate encoding scheme. According to The book the logo fonts have the font encoding scheme "AEFMNOT only" (or maybe "AEFMNOPST only" after the recent changes). Clearly, this is a well-defined encoding scheme, but not one of those presently supported by NFSS. One might be tempted to define some new encoding scheme ‘MF’, but the letter ‘M’ is already reserved for 256-character math fonts. Therefore, we will use the encoding scheme ‘U’ for the font family logo.

 4 \DeclareFontFamily{U}{logo}{}

3.1 Font shape declarations for medium series

Now, we will discuss the font shape declarations for the medium series. We will support sizes in the range from 8 pt up to magstep 5, which should be sufficient to cover the range from \footnotesize to \Huge. We assign the logosl fonts to \itshape because their slant parameter matches that of Computer Modern Italics rather than that of Computer Modern Slanted.^{4} For \slshape we provide a silent font substitution.

 5 \DeclareFontShape{U}{logo}{m}{n}{
 6 <8> <9> gen * logo
 7 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> logo10
 8 }{}
 9 \DeclareFontShape{U}{logo}{m}{it}{
10 <8> <9> gen * logosl
11 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> logosl10
12 }{}
13 \DeclareFontShape{U}{logo}{m}{sl}{
14 <-> ssub * logo/m/it
15 }{}

3This is just a simple matter of replacing ‘9’ by ‘8’. Perhaps some Unix hackers would like to have logosl8.mf generated using something like cat logosl9.mf | sed 's/9/8/' > logosl8.mf as part of a Makefile, but here we prefer distributing the resulting file to provide a system-independent solution.

4This might be due to the fact that the logosl fonts were first used in combination with Computer Modern Italics in the running heads of The book. Thus they may have been tuned for this purpose.

3.2 Font shape delarations for bold series

Finally, we turn to the font shape declarations for the bold and bold extended series. At present, there are no slanted versions of bold logo fonts, but they could be created easily, if desired. However, we do not attempt to create them here, because the resulting name would be too long to fit into 8 characters and it isn’t clear how it should be abbreviated.

We assign the logobf font shape to the semibold condensed series because there are some indications that it was designed to match Computer Modern Sans Serif Demibold Condensed, the font that was used in chapter headings in the TEX and manuals. In sizes below 10 pt, we simply substitute medium series because we want to avoid scaling down fonts below their design size.

16 \DeclareFontShape{U}{logo}{sbc}{n}{
17 <8> <9> sub * logo/m/n
18 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> logobf10
19 }{}

Since we assume that the extra variants of the logo fonts are available at your installation, we will use the logod font shape in the bold and bold extended series.

As the name logod implies a demibold version, this decision may seem a little odd, but there is a good reason behind it: As mentioned before, logobf was originally designed to match the semibold condensed version of Computer Modern Sans Serif. It also fits well in combination with the bold extended version of that font family because the weight of these two versions is not too different. However, when used in combination with the bold or bold extended version of Computer Modern Roman, the logobf font turns out to be slightly too heavy, and the logod font seems to be a more appropriate alternative.^{5}

For this reason, we assign the logod font to the bold series (only available in Computer Modern Roman) and set up a silent font substitution for the bold extended series, based on the assumption that Computer Modern Roman will be used in bfseries much more frequently than Computer Modern Sans Serif. However, when using bold extended Computer Modern Sans Serif, logod will be the wrong choice and one would prefer logobf instead.

Unfortunately, there doesn’t seem to be a completely satisfactory solution to this conflict of interests, short of modifying the standard font definitions for the Computer Modern family in a way that bold extended CM Sans Serif would be classified as ultrabold compared to bold extended CM Roman.

20 \DeclareFontShape{U}{logo}{b}{n}{
21 <8> <9> sub * logo/m/n
22 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> logod10
23 }{}
24 \DeclareFontShape{U}{logo}{bx}{n}{
25 <-> ssub * logo/b/n
26 }{}

27 ⟨/Ulogo⟩

5The history of the logod font is not very clear. It was first released together with updates for TEX and in March 1992. It might have been used in DEK’s book Literate Programming where bold extended Computer Modern Roman is used in headings.

4 The package file: mflogo.sty

After having discussed the font definition file, we now turn to the example package that shows how to access the logo font family by defining high-level macros based on the low-level macros of NFSS.

28 ⟨∗package⟩

29 \NeedsTeXFormat{LaTeX2e}[1994/06/01]
30 \ProvidesPackage{mflogo}
31 [1995/12/04 v1.5c LaTeX package for METAFONT and MetaPost logos]

\logofamily First, we define the declarative font changing command \logofamily. This is accomplished using the low-level NFSS commands \fontencoding and \fontfamily followed by \selectfont. If \logofamily is encountered in math mode, an error message will be issued.

   In the definition of \logofamily we now use \DeclareRobustCommand pro-

vided in the production L^{A}TEX 2ε releases dated 1994/06/01 or later.

32 \DeclareRobustCommand\logofamily{%
33 \not@math@alphabet\logofamily\relax
34 \fontencoding{U}\fontfamily{logo}\selectfont}

\textlogo Next, we define a font changing command \textlogo with one argument using \DeclareTextFontCommand also provided in the latest L^{A}TEX 2ε release.

35 \DeclareTextFontCommand{\textlogo}{\logofamily}

{\MF \atop \MP} Finally, we define macros for the  and  logos. Since the

letters ‘ ’ and ‘ ’ needed for the logo were added as recently as 1993, this will only work if you have an up-to-date version of the logo fonts. To update them, you just have to install the new version of the program file logo.mf and regenerate the logo fonts using exactly the same driver files as before.

There should be no doubt that \MF is the standard abbreviation for the - logo. For , we use the abbreviation \MP, which also seems to be the standard abbreviation used for input files and the program itself.

According to an e-mail message from John Hobby, he personally prefers the spelling “MetaPost” (in plain roman) instead of the logo font, but since it was Don Knuth himself who introduced the alternate spelling, it is acceptable to use the logo font for as well, if you prefer that.

36 \def\MF{\textlogo{META}\@dischyph\textlogo{FONT}\@}
37 \def\MP{\textlogo{META}\@dischyph\textlogo{POST}\@}

38 ⟨/package⟩

In order to fix the space factor after the logos in all uppercase letters, we better add \@, which expands to \spacefactor\@m, at the end of our macro definitions. This is exactly how it is done for the \TeX and \LaTeX logos in the L^{A}TEX 2ε sources

(see ltspace.dtx and ltlogos.dtx).

In closing, it should be pointed out that the above definitions of the - and logos will make them honour all font changing commands just like the TEX logo does and always did. Thus both logos will finally behave identically with respect to font changes, thanks to L^{A}TEX 2ε and the NFSS.