Online version: http://dust.ess.uci.edu/doc/abb Feb 2, 2004
LATEX Cheat Sheet
by Charlie Zender
University of California at Irvine
Department of Earth System Science zender@uci.edu
University of California Voice: (949) 824-2987
Irvine, CA 92697-3100 Fax: (949) 824-3256
Copyright © 2000-2003, Charles S. Zender
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts.
The license is available online at
http://www.gnu.ai.mit.edu/copyleft/fdl.html.
Contents
1 Introduction
2 LATEX Installation
2.0.1 Personal packages
2.1 ps2pdf
2.2 ps2epsi
2.3 Posters
2.4 dvips
2.5 PDFTEX
2.5.1 Viewing
2.5.2 pdfscreen
2.5.3 thumbpdf
2.5.4 pdfthumb
2.6 Tables
2.6.1 epstopdf
2.6.2 Upgrading
3 Using LATEX
3.1 NFSS
3.1.1 usefont
3.1.2 suffixes
3.2 Dependencies
3.3 Citations
3.4 Indicating Definitions, Commands, Files
3.5 TEX Info
3.5.1 Inserting TEX into TEX Info
3.5.2 Texi2html
3.5.3 Tth
3.5.4 Tex4ht
3.6 HTML/SGML
3.7 Indexing
3.8 Line Numbering
3.9 Vertical Spacing
3.10 Horizontal Spacing
3.11 Verbatim
3.12 CVS
3.13 Watermarks
3.14 Symbols
3.15 Graphics
3.16 Trademarks
3.17 Currencies
3.18 Acronyms and Abbreviation
3.19 Text Samples with math a
4 Text Typography
4.1 Gothic
4.2 Text Fonts
5 Math
5.1 Math Conventions
5.2 Math Equations
5.3 Math Fonts
5.4 Math Samples
Index
List of Figures
1 Shortwave Cloud Forcing
2 R2D2
List of Tables
1 Font Attributes
2 Filename Suffixes
3 Text Object Types
4 HTML/SGML Special Characters
5 TEX Family Symbols
6 Typesetting Text
7 Text Series and Styles
8 Text Fonts
9 Math Fonts
10 Typesetting Math
1 Introduction
omeone once said that the best way to learn
a language was to speak it.
This is my attempt to learn LATEX, one of the most challenging
and useful languages ever devised.
This section is devoted to introductory material and matters
generic to typography.
Section 2 describes LATEX installation and maintenance,
Section 3 contains hints on using LATEX,
Section 4 is devoted to text typography,
Section 5 covers formatting mathematics.
is undefined
Incidentally, the first letter of the preceding paragraph was
"dropped" by calling the macro defined by the
package:
....
Another package capable of handling large first letters of paragraphs
is the package.
Most of the documentation for lettrine appears to be in
French, however.
2 LATEX Installation
This section describes LATEX installation, maintenance, and
upgrades.
Thanks to Thomas Esser for producing the TEX distribution that I
use, .
Many Olympian TEX and LATEX gurus do not like the RedHat
GNU/Linux installation.
Apparently RedHat does not change the tetex defaults from their
European settings.
This may cause vertical margins to change in weird ways, e.g., in
printouts but not in , or in but
not in .
When this occurs the solution is to reconfigure TEX by running
as root:
sudo texconfig dvips paper letter
sudo texconfig xdvi us
2.0.1 Personal Packages
The and environmental variables
determine the TEX search path.
These should be set in startup files, e.g., :
export TEXINPUTS=".:${HOME}/tex//:${HOME}/crr//:${DATA}/ps//: \
${TEXMFDIR}/pdftex//:${TEXMFDIR}/tex//::"
export BIBINPUTS=".:${HOME}/tex//:${TEXMFDIR}/bibtex//::"
If these variables are not set then packages must be in the current
directory or the default system search paths.
The :: activates the default system search paths.
The // indicates that directories beneath the specified
directory should be searched recursively.
These symbolic links should not be necessary when TEXINPUTS
contains ${HOME}/tex//:
sudo ln -s ${HOME}/tex/ncarletter.cls ${HOME}/tex/cls/ncarletter.cls
sudo ln -s ${HOME}/tex/zenletter.cls ${HOME}/tex/cls/zenletter.cls
sudo ln -s ${HOME}/tex/bib.bib ${HOME}/tex/cls/bib.bib
sudo ln -s ${HOME}/tex/csz.sty ${HOME}/tex/cls/csz.sty
sudo ln -s ${HOME}/tex/jgr_abb.tex ${HOME}/tex/cls/jgr_abb.tex
sudo ln -s ${HOME}/tex/cls ${TEXMFDIR}/tex/latex/csz
sudo ln -s ${HOME}/tex/bst ${TEXMFDIR}/bibtex/bst/csz
sudo texhash
Using LATEX to produce PDF files is lots of fun.
There is an entire website devoted to this topic.
2.1 ps2pdf
The program converts complex files
into files.
is the replacement for
.
A distiller killer, you might say.
It is highly configurable; full details are available
here.
ps2pdf -dMaxSubsetPct=100 -dCompatibilityLevel=1.2 -dSubsetFonts=true \
-dEmbedAllFonts=true -sAutoRotatePages=PageByPage \
-sColorConversionStrategy=LeaveColorUnchanged in.ps out.pdf
The and
switches are important when converting slide presentations.
2.2 ps2epsi
The program recomputes the minimal possible bounding
box of and files.
ps2epsi foo.eps foo.eps
2.3 Posters
Creating conference using LATEX is not well documented.
The package is designed to hold conference posters.
can break up a poster into letter (or A4) sized
pieces, which you can then put back together like a big jigsaw puzzle.
First, though, you may need to turn your poster into an
file using , :
gs -q -sDEVICE=epswrite -sOutputFile=${DATA}/ps/pst_ZNT03.eps -r600 -q - < ${DATA}/ps/pst_ZNT03.ps
epssplit -o ${DATA}/ps/pst_ZNT03_mlt.ps -mar 2.5mm ${DATA}/ps/pst_ZNT03.eps
Use to resize the poster to fit onto a single page.
Default units are points, but either cm or in may be
specified for centimeters or inches, respectively.
psresize -W1106 -H905 -w2728.575 -h3334.59 ${DATA}/ps/pst_ZNT03.ps ${DATA}/ps/pst_ZNT03_ltr.ps
psresize -Wwdt_in -Hhgt_in -wwdt_out -hhgt_out ${DATA}/ps/pst_ZNT03.ps ${DATA}/ps/pst_ZNT03_ltr.ps
psresize -W60.0in -H40.0in -w11.00in -h8.5in ${DATA}/ps/pst_ZNT03.ps ${DATA}/ps/pst_ZNT03_ltr.ps
Poster sizes should take advantage of common large format printer
sizes.
The most common printer widths are 36 and 42 inches.
The UCI ImageWorks print shop ((949) 824-6414, Natural Sciences I,
Room 2112) charges about
$10 + $12 for 36 inch-wide posters, and
$15 + $15 for 42 inch-wide posters.
The program converts files to
files.
It also helps generate other formats such as PDF.
dvips -o nco.ps nco.dvi # Convert DVI to Postscript
One very important feature of is that it may be used to
generate beautiful PDF files without having to invoke
.
This is accomplished by setting the output pipe to PDF
dvips -Ppdf -G0 -o nco.ps nco.dvi # Convert to Postscript intermediate, then PDF
ps2pdf -Ppdf -G0 nco.ps nco.pdf # Convert Postscript to PDF
The resulting PDF file does not preserve the helpful PDF features,
such as hyperlinks, but it does appear as intended in PDF readers such
as .
This procedure is very useful when does not work,
e.g., for complicated files, or when the source is in some other
format, e.g., .
Unfortunately, the -Ppdf switch may typeset ligatures such as
"fi" or "ff" incorrectly.
The solution is to add the -G0 switch, or to upgrade to more
recent versions of .
It is also recommend to add -Pcmz and -amz switches.
This is explained in the
TEX FAQ.
Another feature of is its ability to produce
(Encapsulated Postscript) files from all or parts of a
document.
dvips -Ppdf -G0 -E -i -o rt.ps rt.dvi # Convert to Postscript intermediate, then PDF
2.5 PDFTEX
PDFTEX tends to give inscrutable error messages.
For more informative diagnostics, invoke with pdflatex -k 255 foo.tex.
There are two distinct commands that de-LATEX files,
and .
These converters are really LATEX-strippers-they only do a good
job of preserving unformatted text.
A good alternative for formatted text is convert the PDF file, rather
than the LATEX file, to text.
accomplishes this.
Foiltex requires the dvips option in order to produce landscape
mode foils.
The hyperref package interferes with Foiltex and breaks the
rotating capability.
The three free readers , , and
all display PDFTEX files.
The
Adobe-supplied
was intentiaionally crippled to not refresh
documents on the fly.
To circumvent this, keep another document open, then use C-w
to close the document and C-o to open the file again.
However, does have the nice ability to convert PDF to
using, e.g.,
acroread -help # Print acroread options
acroread -toPostScript -level2 -size letter -pairs -shrink fl_nm.pdf fl_nm.ps
for fl in `ls *.pdf` ; do
acroread -toPostScript -level2 -size letter -pairs -shrink ${fl} ${fl/pdf/ps}
done
for fl in `ls *.ps` ; do lpr ${fl}; done
Another useful package is pdfscreen.
pdfscreen relies heavily on hyperref and a number of
other packages.
I have installed the entirety of pdfscreen in
${TEXMFDIR}/tex/latex/pdfscreen.
However, only and a few other files in the
directory are strictly required for the installation to work.
This should be fixed so the TEX directory does not cruft up.
Printing pdfscreen presentations is sometimes useful.
To do this, set
pdfpagemode={FullScreen}, % Starts in full screen mode, hit 'Esc' to escape
pdfmenubar=true % Allow access to reader's menubar
in the \hypersetup portion of the preamble.
This will start the presentation in full screen mode and make the
reader (e.g., ) menubar available once the
presentation is "escaped" using, e.g., Esc.
PDF files have the capability to show ,
reduced-size images of each page.
The various TEX engines do not generate thumbnails automatically
(since they are), so that some intervention is required to insert them
in the final PDF document.
The two freely available methods are the package, by
, and , a
part of the (P4)
project.
The typical usage of is
pdflatex ltx.tex;thumbpdf ltx;pdflatex ltx.tex
The package may also be used in Postscript processing
This is accomplished by setting the output pipe to PDF
dvips -Ppdf -G0 -o ${DATA}/ps/ltx.ps ltx.dvi
thumbpdf --modes=dvips --level2 --useps ${DATA}/ps/ltx.ps
dvips -Ppdf -G0 -o ${DATA}/ps/ltx.ps ltx.dvi
ps2pdf ${DATA}/ps/ltx.ps ${DATA}/ps/ltx.pdf
pdf2ps ${DATA}/ps/ltx.pdf ${DATA}/ps/ltx.ps
The P4
http://www-sp.iti.informatik.tu-darmstadt.de/software/ppower4project
created the PDF Presentation Post Processor.
Install this package in generic directories then create thumbnail
additions to any PDF file.
sudo mkdir ${TEXMFDIR}/tex/generic/ppower4
sudo mv *.sty ${TEXMFDIR}/tex/generic/ppower4
sudo mv ppower4 pdfthumb /usr/local/bin
pdfthumb in.pdf out.pdf
2.6 Tables
Tables are perhaps the most difficult-to-master aspect of LATEX.
Use the package to
.
\begin{sidewaystable}
\end{sidewaystable}
When large portions of text (many pages) are to be printed sideways,
then mode is called for.
Footnotes in tables are also tricky.
PDFTEX does not recognize files directly.
Instead these must be converted to PDF-format with .
The package by Heiko Oberdiek is very useful when
using PDFLATEX.
for fl in `ls *.eps` ; do
epstopdf ${fl}
done
However, a much simpler solution is to include the package
which does this automatically.
It will convert Postscript () and encapsulated Postscript
() files to files () automatically
(using ) if the files do not already exist.
However, this capability is intrinsically somewhat insecure since it
involves allowing LATEX to run shell commands.
Hence, is not installed by default and special
permissions must be set to activate it.
To enable this feature at run-time use, e.g.,
pdflatex -shell-escape test.tex.
To permanently enable this feature for the whole distribution set
shell_escape = 1 in configuration file texmf.cnf.
Upgrading PDFTEX:
cd ${DATA}/tmp;mkdir pdftex;cd pdftex
ftp://ftp.muni.cz/pub/tex/local/cstug/thanh/pdftex/snapshots
gunzip pdftex-20010806-linux.zip
./configure --prefix=/usr --datadir=/usr/share
make
sudo mv /usr/bin/pdfetex /usr/bin/pdftex /usr/bin/ttf2afm /data/zender/bck
sudo mv ${TEXMFDIR}/web2c/pdftex.pool ${TEXMFDIR}/web2c/pdfetex.pool /data/zender/bck
sudo cp pdfetex pdftex ttf2afm pdftosrc /usr/bin
sudo cp pdfetex.pool pdftex.pool ${TEXMFDIR}/web2c
sudo texhash
cd ${DATA}/tmp;mkdir pdftex;cd pdftex
sudo mv pdftex-20010806.tgz ${DATA}/tmp/pdftex
tar xvzf pdftex-20010806.tgz
cd src
./configure --prefix=/usr/share
cd texk/web2c
make pdftexbin
cd ${DATA}/tmp/pdftex/src/texk/web2c
sudo cp pdfetex pdftex ttf2afm pdftosrc /usr/bin
sudo cp pdfetex.pool pdftex.pool ${TEXMFDIR}/web2c
Binaries and pool files are located in the directory
${DATA}/tmp/pdftex/src/texk/web2c.
You must regenerate .fmt files pdftex.fmt and
pdflatex.fmt after installing a new version
of the PDFTEX binary and pdftex.pool files.
pdftex -ini -fmt=pdftex plain \\dump
pdftex -ini -fmt=pdflatex latex.ltx
or
sudo fmtutil --byfmt pdftex
sudo fmtutil --byfmt pdflatex
Apparently, texconfig init may do both in one fell swoop.
Then update the graphics .def file to the newest version at
http://www.ctan.org/tex-archive/macros/pdftex/graphics/pdftex.def
find /usr/share/ -name pdftex.def
cd ${TEXMFDIR}/tex/latex/graphics/
sudo mv pdftex.def pdftex.def.orig
sudo cp ~/pdftex.def .
3 Using LATEX
The font scheme used in LATEX is known as the ().
recognizes five distinct font attributes: ,
, , , and
which may be set individually with the commands
fontencoding{encode},
fontfamily{fam},
fontseries{wt_wth},
fontshape{form}, and
fontsize{line_sp}.
The font series consists of two values, weight and width,
concatenated sequentially into one argument, wt_wth of
between one and four characters, e.g., ebsc.
The font size takes two separate arguments, the point size of
the font and the value of .
Table 1 shows sample values for each font attribute.
| |
Table 1: Font Attributes1
| Attribute | Value |
| Encoding | OT1 OT2 T1 OML OMS OMX U |
| Family | cmr cmss cmtt |
| Computer modern roman, Computer modern sans serif, Computer modern
typewriter |
| Series (weight) | ul el l sl m sb b eb ub |
| Ultralight, Extralight, Light, Semilight, Medium, Semibold, Bold,
Extrabold, Ultrabold |
| Series (width) | uc ec c sc m sx x ex ux |
| Ultracondensed, Extracondensed, Condensed, Semicondensed, Medium,
Semiexpanded, Expanded, Extraexpanded, Ultraexpanded |
| Shape | n it sl sc u |
| Normal, Italic, Slanted, Small caps |
| Size | |
|
| |
LATEX comes with an interactive document which prints font tables
on demand.
latex ${TEXMFDIR}/tex/latex/base/nfssfont.tex
Name of the font to test = ygoth
\help
\sample
\bye
Fonts may be swiftly changed with the macro.
This macro takes four arguments: .
Table 2 shows the conventional meaning of some of the
filename suffixes in the LATEX universe.
| |
Table 2: Filename Suffixes2
| Suffix | Example | Meaning |
| .tfm | pplr.tfm | |
|
| |
Some characters such as are hard to access.
For this purpose, use the command .
For example, \symbol{126} produces ~, the tilde symbol.
3.2 Dependencies
Building and maintaining complex LATEX files is non-trivial and
requires effort similar to maintaining a complex model.
There are two ways to keep track of the dependencies of a source
file.
The first is to add the command somewhere in the
document preamble.
This causes LATEX to print the file dependencies to screen during
processing.
The second is to add the command \RequirePackage{snapshot}
before the command.
This will generate a dependency file (*.dep) file.
3.3 Citations
Here we try some typical LATEX bibliographic citations
- Recommended format for citing is demonstrated by
invoking
\cite{Zen01b}: Zender , [2001]
3.4 Indicating
Definitions, Commands, Files
It is helpful to indicate what type of object text refers to.
For example, the TEXInfo documentation system discriminates between
15 types of text object.
Not all those types are relevent here since, e.g., LATEX has superb
citation handling ability already.
Table 3 list the types of text objects that appear in
this documentation, and the commands necessary to indicate that type
of text.
| |
Table 3: Text Object Types3
| Command | Meaning |
| | Indicating program code |
| | Showing keyboard input |
| | Specifying keys |
| | Showing a literal sequence of characters |
| | Indicating metasyntactic variables |
| | Indicating environment variables |
| | Indicating file names |
| | Indicating command names |
| | Indicating option names |
| | Specifying definitions |
| | Referring to books |
| | Indicating acronyms |
| | Indicating a World Wide Web reference |
| | Indicating an electronic mail address |
|
| |
For consistency, most object types are defined exactly as in
TEXInfo.
A large suite of tools is available for manipulating LATEX and
documents.
3.5.1 Inserting TEX into
@tex
% Define TeX macros to roughly correspond to LaTeX style files
\def\dfr{d} % [frc] Math differential
@end tex
The command converts -format manuals into
format.
The sources are available from the server
cvs -d :pserver:t2h-anon@urmel.mathematik.uni-kl.de:/usr/local/Singular/cvsroot login
cvs -d :pserver:t2h-anon@urmel.mathematik.uni-kl.de:/usr/local/Singular/cvsroot co Texi2html
with the password texi2html.
The (TEX-to-HTML) command converts LATEX-format
documents into format.
tth -a -Lltx -p${TEXINPUTS}:${BIBINPUTS} < ltx.tex > ltx.html
The -a switch tells to automatically run
commands like , , etc., to generate any
necessary auxiliary files.
Tell the root word for the auxiliary files with the -L switch.
searches for files on the path specified by the -p switch.
Full documentation is available at
.
According to the manual,
TTH does not recognize the command by default
because the LATEX macros that are input by this command almost
always contain catcode changes or other usages incompatible with TTH.
oTTH requires that personal packages use instead of
.
This usually imposes non-generic, and thus unacceptable, constraints
on the source LATEX document.
is both a package and a program that converts
LATEX-format documents into .
It is best to invoke the suite of programs using the
script.
htlatex ltx.tex
This produces HTML files of the form ,
, , ,
, , ,
If interested in displaying pages with , in
particular, use the script:
mzlatex ltx.tex
This produces XML files of the form .
3.6 HTML/SGML
() is used to encode
documents displayed by most Web browsers.
Table 4 summarizes the most common ways to implement of
in HTML, and their LATEX equivalents.
| |
Table 4: HTML/SGML Special Characters4
| Mnemonic HTML | Numeric HTML | LATEX | Result |
| <foo@bar> | <foo@bar> | $<$foo@bar$>$ | < foo@bar > |
| è | è | \`{e} | è |
| é | é | \'{e} | é |
| ý | ý | \'{y} | ý |
| |   | non-breakable space | non-breakable space |
| C. S. Zender | C. S. Zender | C.~S. Zender | C. S. Zender |
| Α | Α | $\Alpha$ | a (Greek capital letter alpha) |
| α | α | $\alpha$ | a (Greek small letter alpha) |
| − | − | $-$ | - (Minus sign) |
| € | € | \euro | (euro sign) |
| © | © | \copyright | © |
|   |   | foo\;bar | foo bar (em space) |
|   |   | foo\:bar | foo bar (en space) |
|   |   | foo\,bar | foo bar (thin space) |
| — | — | --- | - (em dash) |
| – | – | -- | - (en dash |
| ‘ | ‘ | `foo` | `foo` (left single quotation mark) |
| ’ | ’ | 'foo' | 'foo' (right single quotation mark) |
| “ | “ | ``foo`` | "foo" (left double quotation mark) |
| ” | ” | ''foo'' | "foo" (right double quotation mark) |
|
| |
3.7 Indexing
Here we show some typical LATEX indexing and cross-indexing
which make use of the command and derivations
thereof.
- The following instance of the word "quark" is indexed using
\trmdfn{quark}: .
When processed with the \usepackage[hyperindex]{hyperref}
package, the index should point back to this instance (as long as
backref=true).
- The following instance of the word "quark" is indexed using
\trmidx{quark}: .
- The following index of the author "Homer Simpson" uses
\trmdfn[Simpson, Homer]{Homer Simpson} so that "Homer
Simpson" appears verbatim in the text but is indexed by the optional
argument "Simpson, Homer": .
Compare this to \trmidx[Simpson, Homer]{Homer Simpson}:
and to
\trmidx{Homer Simpson}: .
- Related concepts may be cross-indexed and sub-sorted as well.
For example
\index{Frodo|see{Baggins}} places
'Frodo, see Baggins' in the index.
Nesting related item is accomplished by, e.g.,
\index{Baggins!Frodo},
\index{Baggins!Bilbo},
\index{Baggins!Bilbo!adventures},
\index{Baggins!Bilbo!rings}.
- The index requires some help to determine where to place
non-standard symbols.
For example, should be indexed alphbetically
as "Metafont", not as "
Metafont", while should be
indexed alphabetically as "MF".
This is accomplished by the command \index{Metafont@\MF}.
The argument before the @ is the lexicographical value of the
entry used for alphabetization, and the argument after the @
is the value actually written to the index.
By the same token, the command \index{index@\verb+\index+}
places the word \index under the
letter "i".
Note that this method is tedious and prone to error since it involves
typing the word "index" three times.
Heiko Oberdiek has provided me with the command,
which prints \cmdltxidx in the text and in the index at the
correct alphabetical location.
3.8 Line Numbering
To number each line in a document, use the package
.
The command turns on line-numbering,
and the turns it off.
To demonstrate, the next few sections have line-numbering turned on.
The package is very flexible and supports options like
, ,
etc.
even supports labeling lines and refering to
specific lines with the standard reference commands, e.g.,
.
Unfortunately, line-numbering is expensive in terms of processing time
and contents of the auxiliary file, so expect LATEX to slow down
when large amounts of material are numbered.
When printing source code, it may be desirable to nicely format
certain keywords in the language.
The LATEX command prints "" instead of the
unformatted "".
3.9 Vertical Spacing
To change the vertical spacing in a document, use the package
.
3.10 Horizontal Spacing
Spacing between numbers and dimensions is a complicated issue.
The issue is most often ignored by novices, and, for those who care,
there are no universal solutions.
A related question is the spacing between multiple physical dimensions
in a single unit, so-called .
The J. Fluid. Mech. convention appears to be a
space between the value and dimension, and then a
space for interdimensional spacing, e.g.,
5\;cm\,s$^{-1}$ produces 5 cm s-1.
journals appear to use \, in both positions, e.g.,
5\,cm\,s$^{-1}$ produces 5 cm s-1.
3.11 Verbatim
The package contains extensive options to nicely
format input code.
First one must define the current language environment with the
command, e.g.,
Once \lstset has been initialized, the
command is used to format code inline, and the
environment is available to place longer code fragments in display
style.
The srcltx package enables to display LATEX code
synchronized with the display:
Also consider the package by
.
Using CVS in LATEX documents is not straightforward.
Norman Gray recommended the following on comp.text.tex
\def\CVS$#1: #2 ${\expandafter\def\csname CVS#1\endcsname{#2}}
\CVS$Revision$
\CVS$Date$
and use it like \date{\CVSDate, version \CVSRevision}.
This recipe only works when CVS versioning is turned on, i.e.,
when the -kk option is not specified.
The above definition must appear in the document being
tracked, i.e., the .tex file, rather than a style file.
Otherwise the version information will reflect the evolution of the
style file and not the document being tracked.
Unfortunately this contributes to preamble bloat.
3.13 Watermarks
Printing a message on each page is useful to watermark draft work,
so it is a .
To do this in LATEX, use the package by Juergen
Vollmer.
The word "DRAFT" (assuming an English document) will be blazed
across the specified pages.
ghostview has troubles showing DRAFT
watermark in the on-screen window.
Ghostscript (gs) works fine with watermarks.
Watermarking -generated files requires a more sophisticated
package called eso-pic which is contained in Martin
Schroëder's ms bundle.
For , try the following:
\usepackage[pdftex]{graphics,color} %
\usepackage{eso-pic} % Required for Draft (\AddToShipoutPicture)
\AddToShipoutPicture{\resizebox{0.9\pdfpagewidth}{0.9\pdfpageheight}%
{\rotatebox{60}{\color[gray]{0.8}\hspace*{5mm}\textsc{Sample Paper}}}}
The variety of symbols LATEX can produce is astounding.
The definitive source of these symbols is the Symbols document by
M. Scott Pakin, available from
ftp://cam.ctan.org/tex-archive/info/symbols/comprehensive/.
Some of the more frequently used TEX-related symbols are listed
in Table 5.
The \usepackage{texnames} makes the proper logos available,
but, according to Robin Fairbairns, it is an out-of-date, poorly coded
package which should be avoided if possible (i.e., use mflogo
instead for ).
| |
Table 5: TEX Family Symbols5
| Symbol | Command | Package |
| TEX | | none |
| | \TeX{}Info, | csz |
| LATEX | , \LATEX | none, texnames |
| | | none |
| | | mflogo |
| | \METAFONT | texnames |
| | \AMSTEX, \AmSTeX, | texnames |
| | \BIBTEX, \BIBTeX, | texnames |
|
| |
According to the UK TEX FAQ, "For those who don't wish to acquire
the 'proper' logos, the canonical thing to do is to say AMS-\TeX for
AMS-TEX, Pic\TeX for PicTEX, Bib\TeX for BibTEX, and
so on."
Extending this advice to
More recent packages have their own styles.
A few of the more useful are \textsc{pdf}\TeX
for PDFTEX, and \textsc{pdf}\LaTeX for
PDFLATEX.
Often a font is named after its creator, whether a person or a
company.
Thus learning the names of font creators is a good mnemonic for the
package names.
The marvosym fonts are named for "Martin Vogel's Symbols".
3.15 Graphics
Inclusion of graphics images is controlled by the graphix
package.
The macro imports Postscript (*.ps) and
encapsulated Postscript (*.eps) files automatically.
Normally graphics in documents, i.e., their
position varies so as to flow well with the surrounding text.
These floats are usually placed within the figure environment,
so that a caption may be easily added.
With sizing and caption, the skeleton code to include a graphical
figure looks like
\begin{figure*}
\centering
\includegraphics[width=0.5\hsize]{SWCF_x_01}\vfill
\includegraphics[width=0.5\hsize]{SWCF_x_07}%
\caption[Shortwave Cloud Forcing]{SWCF for (a) January and (b) July.
\label{fgr:SWCF_x1}}
\end{figure*}
Figure
Figure
Figure 1: SWCF for (a) January and (b) July.
Similar commands produced Figure .
The figure environment only spans a single text column.
The figure* environment spans all columns in a multi-column
document.
The location of the float is an optional argument to the figure
environment, e.g., \begin{figure*}[b] to place the float at the
bottom of the current or the next page.
It is not straightforward to import other graphics types.
Raster graphics such as and must first be converted
to Postscript.
LATEX will do this automatically if it knows the conversion rules.
This may be accomplished with the command.
The prerequisite is that a shell-executable exist which can produce
Postscript.
The command gif2eps used to exist and could handle images.
Here is how a figure might be indicated
\DeclareGraphicsRule{.gif}{eps}{}{`gif2eps #1 -} % Convert GIF files to eps
\begin{figure*}
\centering
\includegraphics[width=0.5in,height=0.5in]{/data/zender/fgr/dmr/r2d2.gif}
\caption[R2D2]{R2D2.\label{fgr:r2d2}}
\end{figure*}
Figure
Figure 2: R2D2.
These commands produced Figure 2.
Note the use of the width and height options to size the
figure.
If only one dimension were given, then graphicx would
automatically maintain the natural aspect ratio of the figure.
3.16 Trademarks
Identifying intellectual property correctly requires some knowledge of
copyrights and trademarks.
What distinguishes a trademark from a registered trademark or a
service mark is not clear.
LATEX automatically makes available the symbols ,
, and to denote these
marks .
For example, this work is Copyright © 2000-2003 by me.
Linux\textregistered produces Linux.
Linux\texttrademark produces Linux (where the
superscript is automatic).
However, the text companion package textcomp provides nicer
versions of \texttrademark and \textregistered than the
defaults, so remember to load it for important documents.
textcomp also provides some symbols that are unique, such as
(e.g., Linux),
(),
(), and ().
3.17 Currencies
The , the official currency of the European Union,
may be typeset with ().
Other currency symbols include...
3.18 Acronyms and Abbreviation
Abbreviations are contractions of phrases into a sequence of letters
each usually representing the first letter of a word.
Abbreviations are not intended to be pronounced as a single word.
For example, USA is an abbreviation.
Acronyms are abbreviations which are pronounceable without spelling
the abbreviation letter-by-letter.
Thus IBM is not an acronym, but NATO is.
Typographical conventions set acronyms in a "smallcaps" font, i.e.,
a font where capital letters are smaller than the regular text font.
In TEX, smallcaps is one of the font shapes (§3.1).
Periodicals which follow this convention include The
Economist.
Thus acronyms may be correctly typeset "on the fly" using the
macro.
For example, \textsc{nco} produces NCO,
while \textsc{Unix} produces UNIX.
There is also a homebrew macro, , which is currently
just a wrapper for \textsc.
For example, \acr{nco} produces .
After raising the question "When to use smallcaps for acronyms?"
on the comp.text.tex USENET list, a variety of
answers and rationales were proposed.
Robin Fairbairns noted that Barbara Beeton specified a not-quite-small
caps variant for use in Tugboat.
His code for that is
\usepackage{relsize}
\def\acro#1{\textsmaller{#1}\@}
\acro{TUG} conferences aren't much like \acro{SOSP}s.
Others simply use a small text font
\newcommand{\cap}[1]{{\small{#1}}}
\newcommand{\capRB}[1]{\raisebox{1pt}{\small{(}}\small{#1}\raisebox{1pt}{\small{)}}}
\TeX\ User Group \capRB{TUG} conferences aren't much like \cap{SOSP}s.
3.19 Text Samples
Here we try some typical LATEX text formatting.
- Here we use the custom (degree) macro, first in text
mode, then in math mode.
\dgr uses so there should be no discernible
difference:
10\dgr S--10\dgr N gives "10 S-10 N".
10$\dgr$S--10$\dgr$N gives "10\dgrS-10\dgrN".
- will automatically scale a graphic to
fit within a given box while maintaining aspect ratio with this
argument width=xxx,height=yyy,keepaspectratio
Two commands useful for typesetting and
are and .
Table 6 show the results of various typesetting techniques
on URLs, including problematic long URLs.
Unfortunately, the driver is unable to automatically
break URLs across lines.
On the other hand, intelligently breaks URLs
whenever necessary.
A thread initiated on Oct. 24, 2001 by Olive
Moeller discusses the reasons for this.
Thus, as demonstrated in Table 6, documents may be
formatted differently depending on whether they are produced with
or .
4 Text Typography
4.1 Gothic
othic fonts occupy a special place in the
history of typography since they appear in the oldest typeset texts
in Western civilization.
Yannis Haralambous used to design four interesting Old German
fonts.
The Gothic letter initiating this paragraph if from the
"Yannis initial" font called yinit.
As mentioned above, the initial letter of paragraphs is "dropped"
with the dropcaps package, in this case
\bigdrop{0pt}{3}{yinit}{G}othic....
Unfortunately, accessing non-default fonts in LATEX generally
involves manipulating a very detailed and complex specification
scheme, (§3.1).
- Yannis Fraktur: \usefont{U}{yfrak}{m}{n}
Hello, World.
- Yannis Gothic: \usefont{U}{ygoth}{m}{n}
Hello, World.
- Yannis Schwabacher: \usefont{U}{yswab}{m}{n}
Hello, World.
- Yannis Initial: \usefont{U}{yinit}{m}{n}
Hello, World.
4.2 Text Fonts
Table 7 shows different series and styles of the
default text font.
| |
|
Table 8: Text Series and Styles7
|
|
|
| LATEX Font | Result |
|
|
Table 9: (continued) |
|
| LATEX Font | Result |
|
|
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
| | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 |
|
Table 8 shows different families of text fonts.
| |
|
Table 10: Text Fonts8
|
|
|
| LATEX Font | Result |
|
|
Table 11: (continued) |
|
| LATEX Font | Result |
|
|
| | |
| | |
| | |
|
5 Math Typography
5.1 Math Conventions
The ISO has established conventions regarding symbols appearing in
mathematical documents .
The most often violated convention, which is also easy avoided with
LATEX, concerns the use of upright fonts for symbols denoting fixed,
constant values.
So, for example, the base of the should be
denoted \me rather than simply e.
This is accomplished by using $\me$ rather than $e$.
Likewise the imaginary number is \mi () rather than
i ($i$); is \mpi () rather than
p (), and the symbol for a
element is, e.g., \dfr x ($\dfr x$), rather than dx
($dx$).
Uppercase upright Greek symbols may be obtained from the
symbols font or from the txfonts package.
is a bold upright mathematical font, and contains
only Latin and uppercase Greek letters.
The package supplies upright Greek letters when
the normal letter command is prefixed with "up", e.g., \uppi
produces \uppi whereas \pi produces p.
Unfortunately, the letters produced by appear to
be boldface.
The package boldfaces Greek letters (as does the
or "Poor man's bold" from ).
The packages and create
full, bold-italic, alphabets in the and
fonts, respectively.
Whether this convention applies to Greek numerical prefixes is
unclear.
For example, a , 10-6 , is often written
"mm" ($\mu$m).
The m in mm, however, has a fixed value (10-6).
It is, in essence, a universal constant much like \mpi.
Therefore microns should be written with an upright mu,
i.e., \upmum.
Most journals, including journals, adhere to this
format.
According to Kopka and Daly , [1999], p. 142:
- Simple variables are represented by italic letters, a b c x y z.
- Vectors are written in bold face italic, as B v w.
- Tensors of 2nd order and matrices may appear in a sans serif
font, as M D I
- The special numbers \me, \mi, \mpi, as well as the
differential operator \dfr, are to be written in an
upright font to emphasize that they are not variables.
- A measurement consisting of a number plus a dimension is an
indivisible unit, with a smaller than normal space between them, as
5.3 and 62 .
The dimension is set in an upright font.
Kopka and Daly , [1999] recommend using
5.2 Math Equations
Lengthy derivations may require breaking the derivation across a page
boundary.
It is generally considered smarter to diallow page breaks between
equation lines by default, and to require the author to specifically
enable them where necessary.
Thus normal display environments, e.g., the eqnarray
environment, do not, by default, allow breaking across pages.
The command causes a break in a particular
equation on a particular page.
The optimal position for the \displaybreak is just before the
\\ where it should take effect.
\displaybreak takes an optional integer argument valued 0
to 4 to indicate the degree of penalty associated with breaking a
display environment, with 0 merely allowing a break to take place,
and 4 requiring that the page break, e.g., \displaybreak[4].
also supplies the macro which
changes the default to permit displayed equations to flow smoothly
from one page to the next.
This macro should be placed in the document preamble.
\allowdisplaybreaks takes an optional integer argument valued 1
to 4 to indicate the degree of penalty associated with breaking a
display environment, with 4 being the most permissive, e.g.,
\allowdisplaybreaks[4].
5.3 Math Fonts
Table 9 shows the different mathematical fonts.
The command is defined by multiple packages.
When \usepackage[mathscr]{eucal} is employed, \mathscr
prints a vertical script font, but when \usepackage{mathrsfs}
is in effect \mathscr prints an ornate and very curvy script
font reminiscent of wedding invitations.
| |
|
Table 12: Math Fonts9
|
|
|
| LATEX Command | Result |
|
|
Table 13: (continued) |
|
| LATEX Command | Result |
|
|
| |
o
|
| | |
| |
o
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| fxm 20030224: Began producing "Too many math alphabets used in "version normal" error here after upgreek added, thus some fonts are not being printed |
|
5.4 Math Samples
LATEX contains many useful, but hard-to-remember, commands and
symbols for formatting mathematics.
It is easy to forget when to use uncommon symbols like
, , and .
Table 10 shows results of different mathematical
typesetting techniques.
| |
|
Table 14: Typesetting Math10
|
|
|
| LATEX Command | Result |
|
|
Table 15: (continued) |
|
| LATEX Command | Result |
|
|
| \frac{\partial \prs}{\partial \tpt}|_{\vlm} | - _ |
| \frac{\partial \prs}{\partial \tpt}\big|_{\vlm} | - _ |
| \frac{\partial \prs}{\partial \tpt}\Big|_{\vlm} | - _ |
| \frac{\partial \prs}{\partial \tpt}\bigg|_{\vlm} | - _ |
| \frac{\partial \prs}{\partial \tpt}\Bigg|_{\vlm} | - _ |
| 10\dgr \times 10\dgr | 10 10 |
| \tilde{\dmt}_{\nbrsbs} | _ |
| \tilde{\dmt_{\nbrsbs}} | |
| \tilde{\dmt}_{\nbrsbs}^{2} | _^2 |
| \tilde{\dmt_{\nbrsbs}^{2}} | |
| \bar{\dmt}_{\nbrsbs} | _ |
| \bar{\dmt_{\nbrsbs}} | |
| \bar{\dmt}_{\nbrsbs}^{2} | _^2 |
| \bar{\dmt_{\nbrsbs}^{2}} | |
| \hat{\dmt}_{\nbrsbs} | _ |
| \hat{\dmt_{\nbrsbs}} | |
| \hat{\dmt}_{\nbrsbs}^{2} | _^2 |
| \hat{\dmt_{\nbrsbs}^{2}} | |
| \overline{\dmt}_{\nbrsbs} | _ |
| \overline{\dmt_{\nbrsbs}} | |
| \overline{\dmt}_{\nbrsbs}^{2} | _^2 |
| \overline{\dmt_{\nbrsbs}^{2}} | |
| \underline{\dmt}_{\nbrsbs} | _ |
| \underline{\dmt_{\nbrsbs}} | _ |
| \underline{\dmt}_{\nbrsbs}^{2} | _^2 |
| \underline{\dmt_{\nbrsbs}^{2}} | _^2 |
| \dot{\dmt}_{\nbrsbs} | _ |
| \dot{\dmt_{\nbrsbs}} | |
| \dot{\dmt}_{\nbrsbs}^{2} | _^2 |
| \dot{\dmt_{\nbrsbs}^{2}} | |
| \ddot{\dmt}_{\nbrsbs} | _ |
| \ddot{\dmt_{\nbrsbs}} | |
| \ddot{\dmt}_{\nbrsbs}^{2} | _^2 |
| \ddot{\dmt_{\nbrsbs}^{2}} | |
| \vec{\dmt}_{\nbrsbs} | _ |
| \vec{\dmt_{\nbrsbs}} | |
| \vec{\dmt}_{\nbrsbs}^{2} | _^2 |
| \vec{\dmt_{\nbrsbs}^{2}} | |
| \imath | |
| \vec{\imath} | |
| \hat{\imath} | |
| \mathbf{\vec{\iii}} | |
| \mathbf{\iii} | |
| \mathbf{\hat{i}} | |
| \mbox{\boldmath$\hat{\imath}$} | [^(i)] |
| \mbox{\boldmath$\hat{\iii}$} | [^\iii] |
| \jmath | |
| \vec{\jmath} | |
| \hat{\jmath} | |
| \mathbf{\hat{j}} | |
| \mbox{\boldmath$\hat{\jmath}$} | [^j] |
| \vec{k} | |
| \hat{k} | |
| \mathbf{\hat{k}} | |
| \mbox{\boldmath$\hat{k}$} | [^(k)] |
| \int_{0}^{\infty} \dstnbrrds \; \dfr\rds | _0^ |
| \int_{0}^{\infty} \dstnbrrds \: \dfr\rds | _0^ |
| \int_{0}^{\infty} \dstnbrrds \, \dfr\rds | _0^ |
| \int_{0}^{\infty} \dstnbrrds \dfr\rds | _0^ |
| \int_{0}^{\infty} \dstnbrrds \! \dfr\rds | _0^ |
| \dstfnc_{\nbrsbs}(\dmt) | _() |
| \dstfnc^{\mathrm{o}}_{\nbrsbs}(\dmt) | ^_() |
| \dstfnc^{o}_{\nbrsbs}(\dmt) | ^o_() |
| \dstfnc^{e}_{\nbrsbs}(\dmt) | ^e_() |
| \tilde{\gsd}^{2} | ^2 |
| \tilde{\gsd}^{\!\!2} | ^2 |
| \tilde{\gsd^{2}} | |
| \tilde{\gsd^{\!\!2}} | |
| \dmtnaa | |
| \dmtnar | |
| \dmtnma | |
| \dmtnmr | |
| \dmtnwa | |
| \dmtnwr | |
| \mbox{\textonehalf}, \mbox{\textonequarter} | |
| \frac{1}{2} \frac{2}{3} | 1 2 |
| 1 / 2 \ 2 / 3 | 1 / 2 2 / 3 |
| x^{1/2} | x^1/2 |
| x^\frac{1}{2} | x^1 |
| a \lesssim b | a b |
| a \lessapprox b | a b |
| a \gtrsim b | a b |
| a \gtrapprox b | a b |
| \pi \Pi | |
| \mpi | |
| \mathbf{\pi \Pi} | |
| \bm{\pi \Pi} | |
| \hm{\pi \Pi} | |
| \uppi | |
| \pmb{\pi} | |
|
References
- [Kopka and Daly 1995]
-
Kopka, H., and P. W. Daly, A Guide to LATEX2e , 2nd ed.,
Addison-Wesley, Reading, Mass, 1995.
- [Kopka and Daly 1999]
-
Kopka, H., and P. W. Daly, A Guide to LATEX2e , 3rd ed.,
Addison-Wesley, Reading, Mass, 1999.
- [Zender 2001]
-
Zender, C. S., Radiative transfer in the Earth system,
"http://dust.ess.uci.edu/facts/rt/rt.pdf", 2001.
Index (showing section)
- Baggins
- Bilbo, 3.7
- adventures, 3.7
- rings, 3.7
- Frodo, 3.7
- Frodo, see Baggins
- \index, 3.7
- , 3.7
- \MF, 3.14
- , 2.4, 3.5
|
Footnotes:
1Sources: Kopka and Daly , [1999]
2Sources: Kopka and Daly , [1999]
3Sources: TEXInfo manual
4Source: http://www.w3.org/TR/html401/sgml/entities.html
5Sources: Kopka and Daly , [1999]
6Source: Kopka and Daly , [1995,Kopka and Daly , [1999]
7Source: Kopka and Daly , [1999]
8Source: Kopka and Daly , [1999]
9Source: Kopka and Daly , [1999]
10Source: Kopka and Daly , [1995]
File translated from
TEX
by
TTH,
version 3.57.
On 2 Feb 2004, 22:31.