UMass Amherst
Department of Mathematics and Statistics
Directory  Courses  Undergraduate  Graduate  Research  Seminars  Calendar  Contacts  Resources  Donate  
RCF  Math/Stat Res Ctr  OWL Login  SPIRE  Links  US Math Depts  For Dept Members  

A Crash Course in LaTeX with the New Font Selection Scheme and in -LaTeX

Introduction

This document has two goals: 1) To explain what changes you will need to use the NFSS version of LaTeX gif, and 2) To outline the main adaptations LaTeX users will have to make to use -LaTeX. We also give some examples illustrating why people would want to switch to -LaTeX for their mathematical typesetting. This is not an introduction to LaTeX. You will, in fact, need some knowledge of LaTeX for this document to be helpful.

The RCF's main mathematics typsetting program is TeX; you can typeset virtually anything in TeX, but it can be very tedious to use. In the early 1980's, LaTeX and -TeX were released. These are both packages of macros which run on top of TeX, making it much less taxing to use. Both packages have their advantages: -TeX is better suited for nasty multiline equations, matrices, commutative diagrams and the like; while LaTeX's referencing system is fundamental for organizing all but the shortest documents. In 1987, the AMS began supporting two projects aimed at combining the best features of the two programs. The results are -LaTeX, which includes some of the -TeX features into LaTeX, and LAMS-TeX, which puts some of LaTeX's advantages into -TeX. It appears that the more successful of these two efforts is the former, partly because LaTeX is much more widely used and has more supporting software. The RCF is not supporting LAMS-TeX at this time, but is looking into the possibility. In any case, people who use LaTeX have much to gain, with minimal effort, by learning -LaTeX. People who use -TeX also have much to gain by learning -LaTeX, but if you don't know LaTeX, you will have to invest the time to learn it. -LaTeX will afford people the benefits of LaTeX's referencing and bibliography abilities gif as well as many (but not all) of -TeX's superior mathematical typsetting commands. In addition, -LaTeX will provide document styles for submitting documents to the AMS electronically.

The rest of this document details how to use the NFSS and what new features -LaTeX offers (over LaTeX, that is). The sequel assumes you have a reasonable knowledge of chapters 1-4 of [2]. This manual is quite easy to read, and is available for short term loan from the RCF -- simply sign it out from room 1537.


How To Use The New Font Selection Scheme

The RCF machines now automatically call the NFSS version of LaTeX, so you don't have to do anything special to access it. Virtually all of the user-level changes involved in using the NFSS pertain to fonts and font changing. The AMS did not provide a list of non-font related changes, but some were found in the course of writing this document. They seem to be minor in nature; mn must now be used in math mode and some of our uses of mn did not work because the NFSS has some reserved words. We cannot predict what other minor differences will turn up, but be warned that there may be some. The information discussed below should be sufficient for most people to get started using the NFSS. For those interested in more detail, [3, pages 4-17,] contains a much more in-depth discussion of the font-related matters.


Basics

The NFSS classifies fonts on 4 attributes; shape, series, size, and family. Each attribute can be changed independently, which is one of the changes over the OFSS. The commands for changing attributes are mn, mn, mn, and mn. For example, in order to change the shape attribute to SMALL CAPS, the command would be mn\{sc\}mn. Note the use of mn; this allows you to detail changes in several attributes and then put those changes into effect. For example, in order to change to series sbxsemibold-expanded, family cmss computer modern sans serif, you would use the command

     \series\{sbx\}\family\{cmss\}\selectfont.
The resulting fonts looks like this: sbxcmssAre we having fun yet?

One of the OFSS faults was that changes in size always set the font back to roman. Thus, the command mnmn would give you large, roman letters while mnmn would give you large, boldface letters. Most of these oddities have been eliminated now that the attributes are changed independently. The commands that you're used to (e.g. mn, mn, mn, etc) now call the appropriate combination of attributes to print the fonts you're familiar with. In other words, the old font changing commands work the way you want them to.

The new commands give you much greater flexibility for changing font attributes, but you only need to worry about this if you want some combination of attributes not available using the old commands; see [3] for more details.


New Capabilities

The NFSS also provides several capabilities not previously available. There are now ways to change the various default fonts. For example, LaTeX uses roman as its default font and italic for emphasized text. If you need to submit a paper to a journal with annoying editors who require that the normal type be boldface and the emphasized text be 1012ptcmmss10 pt sans serif, the NFSS will allow you to do this.

Another new possibility is the use of resident fonts. The main idea here is that the NFSS (with the help of aspects of TeX3.14) allows you to access fonts that live on the postscript printer. This is useful, for instance, if you need to make camera-ready copies with special requirements.. People who need to use these more complicated features of the NFSS and TeX3.14 may consult the RCF staff for assistance.


Math Fonts

The RCF's old version of LaTeX was not standard; it had been tampered with to include some math fonts (e.g. Bbb) not normally available in LaTeX. These math fonts are now included in -LaTeX. So, strictly speaking, the changes explained in this subsection are not due to the implementation of the NFSS, but this seems like a good place to explain them.

The math mode fonts in -LaTeX work differently than they did in the previous version of LaTeX. The math fonts are really commands with a single argument. For example, in order to get a single bold letter in math mode, you will now type mn\{A\} rather than \{mn A\}. Two bold letters would be mn\{A\}mn\{B\}, not \{mn AB\}. The ``blackboard bold'' letters are accessed in a similiar way; mn\{R\} as opposed to \{mn R\}. The math fonts available in the amstex option are mn (the default), mn, mn (uppercase only), mn (Fraktur, German letters), mn (blackbard bold, uppercase only), and mn. The last option is used for individual bold symbols, Greek letters -- everything that isn't covered by the mn command. This is how they look.
Highlights Of Features In -LaTeX

As mentioned in [1], using the `amstex' documentstyle option in the new LaTeX will provide you with many new commands and environments. Using this documentstyle option is what we mean when we say `using -LaTeX'. For a complete set of instructions about what the new features are and how to use them, you should see [3] and [4]. These documents assume knowledge of LaTeX and are available from the RCF; extra copies are stocked in room 1537. These documents have lots of examples, but be warned that they are somewhat lengthy. Here, we will demonstrate a few of the more useful options. In what follows, we will use typewriter type to indicate what you need to type in order to produce the output shown. We will make use of the TeX commands mn and mn; these are simply horizontal spacing commands in TeX.


Multiple integral signs

Double, Triple, even n-fold integral signs, with the spacing between them nicely arranged, can be accomplished using the mn, mn, and mn commands:

displaymath407

\[ \iint\limits_A f(x,y)\,dx\,dy = \iiint\limits_B
g(x,y,z)\,dx\,dy\,dz = \idotsint\limits_C
f(x_1,\cdots,x_n)\,dx_1\cdots,dx_n \]


Fun with fractions

Using the amstex option, mn has an option to specify the thickness of the fraction bar. For example;

displaymath409

\[ f'(x) = \lim_\{h \rightarrow 0\}
\frac[1.5pt]\{f(x+h)-f(x)\}\{h\} \]
You can also put delimeters around your favorite fractions using the mn command;

displaymath410

\[ \fracwithdelims[]\{H(z+v)-H(z-v)\}\{\|z-v\|\} \]

The command mn is short for mn()[0pt]. You can use it like this;

displaymath411

\[ \binom\{n\}\{k\} = \frac\{n(n-1)\cdots(n-k+1)\}\{k!\} \]

Continued fractions are easy with the mn command;

displaymath412

\[ \cfrac\{1\}\{a_1+\cfrac\{1\}\{a_2+\cfrac\{1\}\{a_3+\cfrac\{1\}\{a_4+\cdots\}\}\}\} \]


The cases enviornment

Defining functions by cases is certainly common, but requires something like an array in LaTeX. In -LaTeX you can use \begin\{cases\} tex2html_wrap_inline419 \end\{cases\}. What k makes the following function continuous at x=0?

displaymath417

 \[ f(x) = \begin\{cases\}
                  x^2+3    & \text\{if $x \leq 0$\} \\
                  2x+k     & \text\{if $x > 0$\}
                 \end\{cases\} \]


Matrices

Matrices in -LaTeX are very similiar to LaTeX's array, but the various delimiters are automatically included. A matrix with no delimeters is produced using the matrix environment, while the pmatrix, bmatrix, vmatrix, and Vmatrix environments give other delimeters. For example,

displaymath429

\[ \begin\{matrix\}
    a & b \\
    c & d
   \end\{matrix\} = 
   \begin\{pmatrix\}
    a & b \\
    c & d
   \end\{pmatrix\} = 
   \begin\{bmatrix\}
    a & b \\
    c & d
   \end\{bmatrix\} = 
   \begin\{vmatrix\}
    a & b \\
    c & d
   \end\{vmatrix\} =
   \begin\{Vmatrix\}
    a & b \\
    c & d  
   \end\{Vmatrix\} \]
There is also an environment, smallmatrix, for producing matrices small enough for running text. My favorite small matrix is tex2html_wrap_inline433 because it is sufficiently general; as any linear algebra student knows, if you can show something for 2-by-2 matrices, then it must hold for general matrices, like this one;

displaymath430

\[ \begin\{pmatrix\}
    a_\{11\} & a_\{12\} & \hdots & a_\{1n\} \\
    a_\{21\} & a_\{22\} & \hdots & a_\{2n\} \\
    \vdots & \vdots & \ddots & \vdots \\
    a_\{m1\} & a_\{m2\} & \hdots & a_\{mn\}
   \end\{pmatrix\} \]

Information about more delicate aspects of matrices, such as having the individual columns left or right justified, can be found in [5].


The Sb and Sp environments

There is an easy way to put several lines above or below your favorite operators. -LaTeX makes nice work of this ugly beast;

displaymath435

\[ \sum_\{m\geq0\}\biggl(\sum
\begin\{Sb\} k_1,k_2,\ldots,k_m \geq0 \\
           k_1+2k_2+\cdots+mk_m=m
\end\{Sb\}
f(k_1+k_2+\cdots+k_m) \biggr) = 0 \]

The Sp environment would be used in a similiar manner to place multiple lines above some operator.


Commutative diagrams

-LaTeX has adopted -TeX's method for handling commutative diagrams. In order to save some memory, -LaTeX will not load up its commutative diagram abilities unless you tell it to by including amscd in the options of your documentstyle declaration (\documentstyle[amstex,amscd]\{...\}). -LaTeX uses @>>> and @<<< to make right and left arrows of appropriate length for these diagrams. You may print things above or below the elongated arrows easily by placing them in between the <'s or >'s, as shown.

displaymath437

\[ \begin\{CD\}
R\times S\times T   @>restriction>>    S\times T \\
@VprojVV                               @VVprojV \\
R\times S           @<<inclusion<         S 
\end\{CD\} \]
Notice how the direction of the arrows is controlled by @<<< vs @>>> (an up arrow would be made using @AAA in place of @VVV). Note also how the placement of text above/below or left/right of the arrows is controlled; the word ``restriction'' appearing above the arrow is typed between the first two >'s while the word inclusion was typed between the last two <'s to be printed below the arrow. Similiar syntax applies for the up and down arrows.

The main restriction with the CD environment is that it cannot draw diagonal arrows. However, you are not limited to the 2-by-2 structure above. For example, these two diagrams are easy:

displaymath438

displaymath439

\[ \begin\{CD\}
    0 @>>> A @>t>> B @>s>> C @>>> 0 
   \end\{CD\}  \]

\[ \begin\{CD\}
    \{\}   @.   A   @>>>   B    @>>>  C  \\
         @.   @VVV      @VVV        @. \\      
    D   @>>>  E   @>>>   F    @.    \{\}
   \end\{CD\} \]
Notice that the `missing corners' are typed as \{\}, which could have been left blank, but the `missing arrows' must be entered as `@.'. Finally, see that -LaTeX makes the arrows the appropriate length for you.


Messy, multiline equations

One of LaTeX's limitations is its difficulty in properly spacing equations that must be broken over more than one line. This is usually handled using LaTeX's eqnarray environment, but that often requires author supplied spaces to make things look right. -LaTeX gives you much more flexibility in these matters and careful use of the commands described below should free you from most visual formatting. -LaTeX splits the duties of LaTeX's equation and eqnarray environments into 7 separate environments; align, gather, split, alignat, multline, xalignat, and xxalignat. Each environment, except for split, has a starred form which omits the automatic numbering of the unstarred version (see [2, section 3.3.5,] for more information about starred vs unstarred commands). Briefly, this is how they are used.


Align

This is used when some type of vertical aligning is desired between two or more equations; for example,

align242

\begin\{align\}
x+y+z &=1 \\ 
a+b+c+d+e &=2+f+g \\ 
abcdefgxyz &\not=0
\end\{align\}

Notice that the equations were aligned by the `=' symbol. This is because the & was placed just before the `='. You may align the equations anywhere you like by adjusting the placement of the &'s in the source file.

align244

\begin\{align\}
x+y &+z=1 \\ 
a+b &+c+d+e=2+f+g \\ 
abcdefgxyz &\not=0
\end\{align\}

If you don't want the equations numbered, you would use mn instead;

align247

\begin\{align*\}
x+y+z &=1 \\ 
a+b+c+d+e &=2+f+g \\ 
abcdefgxyz &\not=0
\end\{align*\}


Gather

This environment simply centers each equation separately.

gather250

\begin\{gather\}
x+y+z=1 \\ a+b+c+d+e=2+f+g \\ abcdefgxyz\not=0
\end\{gather\}


Alignat

This environment is used when you want more than one column of aligned structures. This command requires a number argument, specifying the number of columns. A good example is

alignat253

\begin\{alignat*\}\{2\}
  a+b &= a'+b'  &  \qquad  c+d &= c'+d'  \\
  ac  &=  a'c'  &  \qquad  bd  &=  b'd'  \\
aa'bb' &\leq 0  &  \qquad  cc'dd' &\geq 0
\end\{alignat*\}

One must be careful with the &'s here because they have two meanings. The first one (on a given line) determines alignment within the first column, the second one separates the two columns, and the third one sets the alignment position in the second column. The mn commands are needed to ensure some space between the separate columns of aligned structures.

You can also use mn for left justified columns, as in the following example:

alignat258

\begin\{alignat*\}\{2\}
f(x) & = \lim_\{n\rightarrow\infty\}f_n(x) && \qquad \text\{by assumption\}\\
f_n(x) & \geq0 \, \forall \, x && \qquad \text\{for n $>N_0$\} \\
\int\limits_\{\Bbb\{R\}\}f\,d\mu & \leq
\liminf\int\limits_\{\Bbb\{R\}\}f_n\,d\mu && \qquad \text\{by Fatou's lemma\}
\end\{alignat*\}

mn and mn are variations on this theme which alter the spacing between the aligned figures and the margins (See [3] for more examples).


Multline

This command is used for long equations which do not fit on a single line. It will set the first line of the equation to the left margin and the last line to the right margin except for an indentation equal to mn. This variable can be set to your liking using LaTeX's mn or mn commands.

multline274

\begin\{multline\}
(a+b+c+d+e+f+g+h+i+j+k) = \\
\int_0^1(a+b+c+d+e+f+g+h+i+j+k)\,dx
\end\{multline\}


Split

This option is designed to split single equations that are too long for one line, but this provides alignment among the split lines. split is supposed to be used within another environment (like equation or gather) which has its own numbering; consequently, split does not provide numbers.

equation281

\begin\{equation\}\begin\{split\}
f_\{a,b\}(x) &= \int_a^\{\infty\}e^\{ibt\}g_a(t-ax)\,dt
              +\int_b^\{\infty\}e^\{iat\}g_b(t-bx)\,dt \\
           & \quad -\int_\{g(a)\}^\{g(b)\}g(t-abx)\,dt -g(a)g(b)-g(ab) \\
           & \leq \Hat\{g\}(a) + \Hat\{g\}(b) - g(a)g(b) - g(ab)
\end\{split\}\end\{equation\}


Intertext

One more handy feature is the mn command, which is used for putting a small piece of text in the middle of a display environment without disrupting the alignment structure.

align296

\begin\{align*\}
x_1 + x_2 +x_3 &= y_1 + y_2 +y_3, \\
a + b + c &\leq d + e + f,\\
\intertext\{and\}
a &\not= 0
\end\{align*\}


Submitting Articles and Books to the AMS

The AMS has provided two document styles for the NFSS version of LaTeX specifically for sumbitting materials to the AMS. These are amsart and amsbook. These are both modifications on LaTeX which will allow you to set up your documents exactly as the AMS wants them. For more specific information about these, see [3, sections 30-32,]. The AMS also has other style files for more specific AMS publications. Contact the RCF staff for information on these style files.


More Information

The examples above are not a complete list of new features, but only some of the more interesting ones. Below is a list of other features available in -LaTeX which, in an effort to keep this document short, were not detailed herein. Information about these can be found in [3] while examples of their use are in [4].

tabular310

Most of the commands discussed above were borrowed from -TeX. We have tried to briefly introduce them here, but we make no claim to perfection. You may well gain more insight by reading about these commands in [5]. The RCF has other documents available for further information about -LaTeX and other related programs; see the references below.


References

1
New TeX, LaTeX, and -LaTeX. RCF.

2
LaTeX User's Guide & Reference Manual. Leslie Lamport.

3
-LaTeX Version 1. 1 User's Guide. AMS.

4
Sample Paper for The `amstex' Option and The `amsart' Documentstyle. David Belar, Lenore Eifrig, and Shafi Näätänen (for the AMS).

5
The Joy Of TeX. A Gourmet Guide to Typesetting with the -TeX macro package. Micheal Spivak.

6
The TeXbook Donald Knuth.

7
User's Guide To AMSFonts Version 2. 1 AMS


Return to front