## Mathematical typesetting (yet again)

I don’t apologise for revisiting one of my pet topics. This was partly inspired by reading Simon Garfield’s book Just my type over the holidays.

About the only generally accepted principle in typography is

People read most efficiently what they are used to.

Now the majority of written mathematics today is typeset in LaTeX, with Computer Modern fonts. On the other hand, the rest of the world rather likes uncontrolled experimentation in the choice of fonts: Garfield points out that the advent of font design programs puts this in everybody’s reach. The general principle may suggest that mathematicians should stick to their current way of working, but is there a case for more variety?

In fact, it doesn’t greatly matter what you do, since when you publish the paper, the journal will put it into their own house style. This can result in some horror stories. One from my own experience involved a publisher who, between getting my proof corrections and issuing the journal containing the paper, changed all the fonts. Not only was my work on producing good line and page breaks completely wasted, but the new fonts did not include blackboard bold, and the publisher had not even noticed – the paper appeared with blank spaces where blackboard bold letters should have been. I complained, and the paper was reprinted correctly in the next issue of the journal.

But bad things happen routinely too. A major academic publisher sets the abstract, section headings, and body text in three different fonts. That is possibly OK; the problem arises because mathematical formulae are also set in three different fonts.

One thing that is vital for mathematics is that the same object should be represented by the same character, and we use typography to distinguish different characters. When I was a student, I spent some time reading Richard Brauer’s papers. For him, $\mathfrak{G}$ is a group; its order is $g$, and a typical element of the group is $G$. Hard enough (with my limited exposure to Fraktur) as it was; imagine if the different Gs had proliferated because of the journal’s style!

But there are some situations in which we have control. I see three of these: producing course material for teaching; making beamer slides; and book publishing (if either you publish the book yourself, or you are lucky enough to have a publisher who trusts you to do the book design within their constraints, as I was with my book Permutation Groups).

I see no need to argue that we should continue to use LaTeX, or at least some flavour of TeX; its understanding of the rules of mathematical typesetting is far superior to any more recent software product. Now changing fonts in LaTeX is not especially difficult; any font can be used, as long as its metrics have been made available in TeX format. What is more difficult is ensuring balance between the text fonts and the mathematical fonts. All too often, you see a very different text font used with the standard Computer Modern math fonts.

Donald Knuth designed Computer Modern (the name “modern” indicates that the fonts are based on the “modern” designs associated with Bodoni and Didot in the eighteenth century) so that the text and math fonts would be well matched but well suited to purpose. The math italic font is slightly different from the text italic font for this reason. He later designed Computer Concrete (for the book Concrete Mathematics with Ron Graham and Oren Patashnik) to work with the AMS Euler math fonts. Other examples are somewhat limited, but include Times Roman and Palatino, each of which is called by loading a single package (mathptmx and mathpazo respectively).

The beamer package for slides uses sans serif fonts as the default; the designer made a positive decision to do so. But it is possible to change to other fonts. I have used this package to produce a few examples, shown here.

I don’t know how to display a PDF file within a WordPress page. (Turning it into a graphics file loses too much quality for my purpose here). So you will have to click on these examples separately. I have typeset a small shaggy dog story containing some mathematics in Beamer default sans serif, in Computer Modern, in Computer Concrete, in Palatino, and in Times Roman.

Personally, I use Times Roman for teaching material and Palatino for beamer slides. (The argument for sans serif beamer slides is that they tend to be quite low resolution and the detail of serifs is lost; I partly agree, but feel that Palatino is more robust than Computer Modern.)

What do you think?

I count all the things that need to be counted.
This entry was posted in typography. Bookmark the permalink.

### 15 Responses to Mathematical typesetting (yet again)

1. Stefan says:

I have adapted Charter as my default font for (preprints of) papers, and Vera for my slides. Both can be used through packages that supply a complete set of compatible math fonts and symbols. The packages are mathdesign and arev.

• I tried them out; neither is in our LaTeX distribution. If I can get them to work I will post versions of the demo.

• It seems that mathdesign uses fonts for which one has to pay, while arev (downloaded from CTAN) doesn’t work.

2. Doormat says:

Is there any chance you could post the LaTeX source which produced these PDFs? (Fonts always mystify me, especially in beamer, so it would be nice to see the actual commands needed…)

• Sure, but this is slightly complicated by the fact that Beamer changes the default font to sans serif and you have to get rid of that by a Beamer-specific command.

The point about the concrete, Times and Palatino fonts is that they are very easy to use. In an ordinary LaTeX document in, say, article class, you just put in a line

\usepackage{xxxx}

at the start of the document (after the \documentclass line), where xxxx is concrete, mathptmx or mathpazo. No other changes are required.

In Beamer you then have to say

\usefonttheme{serif}

or, if you want to use sans serif headers (as I did in the examples) you say

\usefonttheme[stillsansseriflarge]{serif}

If you also want to get rid of the Beamer navigation symbols (which make no sense in a one-page document), you put in the line

So, for example, here is the LaTeX source for the Palatino version:

\documentclass{beamer}
\usepackage{mathpazo}
\usefonttheme[stillsansseriflarge]{serif}

\begin{document}
\begin{frame}
\frametitle{A shaggy dog story in Palatino}
The quick brown fox jumps over the lazy dog. During the jump, the position
of his centre of mass is given by $x=ut$, $y=vt-\frac{1}{2}gt^2$, and so
describes the parabola $y=(v/u)x-(g/2u^2)x^2$.

Meanwhile, the dog is lazy but she is not idle. She is contemplating a
proof strategy for showing that, if $\zeta(\sigma+\mathrm{i}t)=0$, where
$\zeta$ is the analytic continuation to the whole complex plane of the
function given by $\zeta(s)=\displaystyle{\sum_{n=0}^\infty\frac{1}{n^s}}$
for $\Re s>1$,
$\sigma$ and $t$ are real, and $t\ne0$, then $\sigma=\frac{1}{2}$.

\end{frame}
\end{document}

• Doormat says:

Thanks! (The concrete doesn’t work so well on my work machine, but I think that’s a font issue tied up with some network drive being unwritable; I’ll have more of a play on MiXTeX at home)

• That is very likely to be the problem. When I made the PDF files, there was a pause while the computer invoked texmf to build the fonts.

3. Doormat says:

I’ve been playing with this a bit, and it all works (at least at home, once I updated MikTeX). Thanks!

But, one issue I see is that for all the example, except Computer Concrete, the fonts are lovely and smooth, even when very zoomed it. For Concrete, the fonts seem to be bitmapped, and so zooming in, you start to see the pixels. I think this was actually the problem on my office linux box– the defualt previewer is just very bad at smoothing. Any idea what Concrete is being embedded in the PDF file as a smooth font? (I guess this might have a very technical answer!)

• I don’t know for sure how PDF and LaTeX interact, so this is just guesswork. Maybe someone else reading this has more information.

When Knuth produced TeX and Metafont in the late 1970s, he was far ahead of the state of computer technology at the time: Metafont contains mathematical descriptions of the characters which can then be bitmapped at any scale. But, in order for the system to be usable, the programs which converted TeX output to marks on the screen, paper, or film needed bitmapped fonts; he also put a lot of thought into questions of digitisation of font characters so that these would be as good as possible, subject to the limitations of the output devices. Back when most users had dot matrix printers, 300dpi was more than good enough.

Then came PostScript, and then PDF, which handle the issue of digitisation in a different way. I don’t know any program which turns Metafont code into PDF fonts. (There is MetaPost, which outputs PostScript; I don’t know whether this can be used directly in PDF, which I believe is a cut-down version of PostScript.) The easy way is to simply use the bitmapped characters; then, of course, they look bad at high magnification. I assume that this is what happens with the Concrete fonts (which were originally coded in Metafont).

It is easier if you are using fonts designed for PDF. All TeX needs to know are various measurements (height, width, kerning and ligature information, and so on), not what the characters look like; it positions boxes into which the actual characters are put by the output program, in this case PDF, which (presumably) knows what to do with its own characters at any scale.

• Doormat says:

Hmm, I’ve been playing with this a bit. Yes, it seems that by default, LaTeX uses bitmapped fonts for Concrete– this looks fine in DVI, but not so good in PDF (and, obviously, really bad if you zoom in).

I found a slightly complicated way to fix this. Firstly I downloaded and installed the “cm-super” package on MixTex (at 66MB or so, that’s a bit of a pain). This alledgely installs scalable Type 1 fonts, but I had no luck. A bit of Googling suggested that adding the command
\usepackage[T1]{fontenc}
would help. And, indeed, it does! But MikTex then installed some more (small!) packages. So I don’t know if cm-super was really needed or not.

However, using the T1 encoding does change the font spacing a little bit (you see it most in, say “Two”, where the T now really hangs over the w).

Anyway, this is all getting a little beyond me. But at least I have a solution to making nice looking PDFs in the concrete font.

4. At the conference I am at this week in Kloster Irsee, almost all of the Beamer presentations use the default sans-serf font. Alfred Wassermann, however, bucked the trend by using Computer Concrete – and very nice it looked, in my opinion. Good talk, too!

5. I just put up the file in Vera Sans (see Stefan’s comment above):

Click to access fox_arev.pdf

6. chris holden says:

When I look back on all the typeset mathematical material I’ve seen, I think the most beautiful is in the mid-century McGraw Hill series (e.g. Baby Rudin). Of course part of the charm is the actual human work put into the arrangement, but the basic fonts, including kerning, ligatures and other spacing are sublime.

Do you know if anyone has ever tried to recreate something like this as a latex package?

• I agree with you about McGraw-Hill. As a student I had G. F. Simmons’ “Introduction to Topology and Modern Analysis”, a beautiful book whose beauty was enhanced by the typesetting. I see that it is still in print; I still recommend it to students.

When Donald Knuth devised TeX, he attempted to recreate the expertise of traditional typesetters – there is an eloquent passage about this in “The TeXbook” which I will try to dig out – but I don’t think he had a particular style in mind (except for the fonts, which were “modern” in the style of Bodoni and Didot). I am not aware of anyone having done what you suggest!

7. J. Stafford-Baker says:

As an ex hot-metal compositor I’m fascinated by your and your compatriots struggles, and can
tell you that decent hot metal setting of math called for craft skills of the highest order. The Ox and Cam u. presses were naturally the frontrunners but there was a time when the US U. presses got UK trade setting houses to do their difficult setting for them, and then ship repro pulls across for them to print offset. over there. They really could not get the stuff done well there at that date – the 60s maybe. The blessed Monotype Corporation had devised a unique system in the UK for this work called ‘four line maths’, based on a 9 point em quad. The results were superb. .

This site uses Akismet to reduce spam. Learn how your comment data is processed.