Eleventh Class (Wednesday 15 November 1995)

Announcements

Goals to accomplish during class

  1. Become aware of a variety of audio-visual multi-media technologies for mathematical communication.
  2. Start dreaming about the future uses of interactive technologies on the Internet.
  3. Learn the elements of changing fonts in LaTeX.

Activity in the lecture room

Participate in a multi-media extravaganza:

Activity in the computer lab

People often want to change the fonts in LaTeX documents. You should not get carried away with fonts, because frequent font changes can be distracting, but there are special situations in which it is appropriate to vary the default fonts.

Slides

One case in which extra-large fonts are useful is the preparation of transparencies for display on the overhead projector. LaTeX has a slides document class especially designed for producing transparencies. Here is an example.


\documentclass{slides}
\begin{document}
\begin{slide}
  \begin{center}
      A sample slide
  \end{center}
  \begin{itemize}
  \item Slides automatically come out in a large font.
  \item This font is expressly designed to be legible when
      displayed via the overhead projector.
  \item Avoid overloading the audience: 
    do not put too many lines on one slide.
  \end{itemize}
\end{slide}
\end{document}

Try cutting this example out with the mouse, running it through LaTeX, and previewing it with xdvi.

For a real-life example of output from the slides document class, you may look at the slides from my lecture at MSRI last week and at the corresponding LaTeX source code. For a first approximation of what I said in the lecture, you may look at my lecture notes. (You may not understand all the mathematics, but you should get some of the jokes.)

Here are some warnings about using slides for a lecture:

Changing the document font size

By default, LaTeX sets the body of an article in 10 point type. This is fine for books produced on a very high quality printer, but documents printed on an average laser printer are generally more legible if larger type is used.

LaTeX provides two standard options for setting a document in larger type: 11 point and 12 point. You just change the \documentclass{article} line to \documentclass[11pt]{article} or \documentclass[12pt]{article} and LaTeX takes care of the rest.

Occasionally it is useful to magnify a document even further. For example, if you are providing camera-ready copy that is going to be photo-reduced, you might want to magnify the article to counteract the subsequent reduction. The recommended way to magnify a document is through options of the printer driver.

Using dvips, for example, you can say dvips -x1200 filename to magnify the output by a factor of 1.2 or dvips -x1440 filename to magnify by a factor of 1.44. (Magnification by a power of 1.2 is built in; if you magnify by some other factor, you may have to wait for the system to build the fonts at nonstandard sizes.)

If you use the printer driver to magnify the document, you may need to modify the margins in your LaTeX source file via \setlength so that the text doesn't run off the page.

Changing the type size locally

You can change the size of a small portion of text by using a size declaration. To localize the change, make sure it is inside an environment or inside a pair of curly braces. Try the following example to see the size variations.


\documentclass{article}

\begin{document}
{Here \tiny is \scriptsize a \footnotesize silly \small example
\normalsize that \large illustrates \Large the \LARGE size
\huge changing \Huge commands.}

Use sparingly.
\end{document}

Changing the document font style

By default, LaTeX uses the Computer Modern fonts created by Donald Knuth. In principle, LaTeX can work with any fonts. However, since LaTeX does some fancy footwork behind the scenes with ligatures and kerns and accents, the fonts have to be encoded in a special way.

There are a number of PostScript fonts that have been put into the public domain and that are available for use with LaTeX. For an example, grab the Alice excerpt from Class 8 and pop it into your text editor. Then put in the preamble \usepackage{times} and run the document through latex and xdvi and preview it with ghostview. Can you see the difference between Times Roman and Computer Modern?

You can also try \usepackage{palatino} or \usepackage{bookman}.

A complication is that the fonts used for mathematics are special, and they do not change when you change the main document font. There exist mathematics fonts specially designed to fit attractively with Times Roman, for example, but they are not in the public domain. Integrated font sets that include matched mathematics fonts are available commercially from Y&Y, Inc. and from Blue Sky Research.

Changing the font style locally

You already know that you can emphasize text in LaTeX \emph{like this} or {\em like this}. You can also change the shape in other ways, change the weight to boldface, or change the font family. Try the following example.


\documentclass{article}
\begin{document}
This \textsl{is} \textsc{another} \textbf{silly} \textsf{example}
\texttt{illustrating} \textnormal{fonts}.
\end{document}

Here \textsl calls for slanted type (different from italic), \textsc calls for small capitals, \textbf calls for boldface, \textsf calls for a sans serif font, \texttt calls for a typewriter style (fixed width) font, and \textnormal calls for the normal document font.

For special effects (such as a letterhead), it is occasionally useful to declare an absolutely fixed font that is not affected by font-changing commands. Here is one example.

\DeclareFixedFont{\myownfont}{OT1}{cmss}{m}{n}{14pt}
{\myownfont Texas A\&M University}

The above commands cause "Texas A&M University" to be set in Donald Knuth's Computer Modern sans serif font (cmss) in the Old T1 encoding, in medium weight, in normal shape (not slanted), and in 14 point size. As is clear from this example, the low-level interface to fonts is rather complicated! Consult The LaTeX Companion for details.

Homework for after class


/ Home / Contents /


Harold P. Boas
Last modified: Mon Aug 1 17:47:17 EDT 2022