Title: An introduction to TeX
1An introduction to TeX
- And other options for producing documents
containing mathematics
2Robbie Robinson
- Department of Mathematics
- GWU
- Washington DC 20052
- robinson_at_gwu.edu
31. What is TeX?
4Tex is
- A typesetting system for professional quality
scientific documents. - ...especially those containing a lot of
mathematical symbols. - Runs on multiple platforms.
- Comes in PlainTeX, LaTex, AMS-LaTeX, etc.
5Origin
- Stanford University computer scientist Donald
Knuth. - was as unhappy about how publishers typeset his
papers - studied traditional typesetting and printing
- built a lot of expert knowledge into TeX
6Pronunciation
- Name comes from Greek tec.
- Means both art and technology.
- Rhymes with belch
- Does not rhyme with sex
- However LaTeX is sometimes prounounced lay-tex
(as in a type of rubber).
7What does TeX consist of?
- A language and software.
- Knuths part, plus packages (like LaTex)
- Knuths ultimate version of the TeX program was
released in 1983. - Knuth There will be no more changes.
- The TeX Book (1986) ultimate TeX language
reference - other Knuth books on the program, fonts, etc.
82. LaTeX and other packages
9Programming in TeX
- TeX is a primitive typesetting engine that allows
additional programming. - Programs can be put together into packages.
- These define dialects and styles.
- With the final version of the TeX program, Knuth
released PlainTex and the Vanilla style.
10AMS-TeX
- Released in early 1980's by AMS.
- Based on Knuths Vanilla style.
- Several improvements
- handling very complex math formulas.
- additional fonts.
- Developed by Michael Spivak.
- The Joy of TeX (1982)
11LaTeX
- Released in mid 1980s
- written by Leslie Lamport, of Digital Equipment
Co. - LaTeX A documant preparation system (1986)
- Upgrade of Knuths basic TeX language,
independent of AMS-TeX.
12Innovations in LaTeX
- Automatic numbering of theorems and equations.
- A better mark-up system (e.g., environments).
- A Pascal-like style.
- A greater variety of document types article,book,
etc.) - still more fonts.
13Situation in the 1990s
- LaTeX 2.09 de-facto standard in most fields
(Economics, Computer Science) - Mathematicians split (some use LaTeX, others
cling to AMS-TeX or PlainTeX). - AMS (officially) refuses to accept LaTeX for its
journals (!!) - c 1990, TeX users wish list
- LaTeX version 3, and
- a combination of LaTeX and AMS-TeX.
14Current State of the Art
- LaTeX-2e released in 1994.
- i.e., still not LaTeX 3
- improvements in internal operation of LaTeX.
- Author(s) Frank Mittelbach (et al)
- AMS simultaneously releases AMS-LaTeX
- runs as a package within LaTeX-2e.
15What TeX version should I use?
- Definitely AMS-LaTeX or LaTeX-2e
- PlainTeX can also still sometimes useful.
- Some other useful TeX programs are
- epsfig.sty used to import postscript drawings
into TeX files. - bibtex used to automatically create a
bibliography from a bibliographic database.
16Implementation.
- TeX and LaTeX are public domain, but complicated
to install from scratch. - Best to have precompiled binaries and an
installation utility. - TeX is a standard part of most Linux
distributions (e.g., Red Hat). - Mac TeXShop, iTeXMac, etc.
17PC Implementations
- MikTeX
- freeware port of standard Unix version.
- fully featured includes installer.
- Can be combined with emacs (AUC-TeX) or
Winedit. - PC-TeX (commercial). Includes TrueType fonts.
- Scientific Workplace (commercial WYSIWYG version)
includes Maple.
183. Using TeX
19Mark-up
- TeX is a markup language, like HTML.
- You type an ascii file with the extension ".tex".
- As in HTML, you do not worry about formatting.
- In HTML leave formatting to the browser.
- In TeX leave formatting to TeX.
- TeX formats according to the style you are using.
20Ideology
- Logical Document Design
- Common to TeX and HTML
- User describes logical role of each part of the
document. - ... not how to place items on the page!
- i.e., definitely not WYSIWYG!!!
21Comparison with HTML
- HTML markup accomplished by surrounding items
by tags.
This is emphasized.
This is emphasized.
Your web browser decides how to emphasize (!)
22What if you insist on italics?
But I wanted italics!
But I wanted italics!
Works, but violates logical document design (!!)
23Logical design
- A great idea in theory
- ... can be a pain in practice.
- HTML has been moving away from a strictly logical
design for years. - dot.coms want complete control of what you
see!
24Logical Document Design in TeX
- To emphasize text, you type
\em Emphasize this!
- What you will (probably) get
Emphasize this!
25How do you demand italics?
\it Italicize this!
Italicize this!
26Font control in La-TeX.
- \bf for boldface,
- \rm for Roman (not italics or bold)
- \tt for teletype.
- \sc for small caps.
274. Typing Mathematics.
28More TeX v.s. HTML
- In HTML the big thing is hyperlinks
- naturally there is an elaborate code for them.
- In TeX the big thing is mathematics.
- Inside your document, all formulas are typeset in
math mode. - In contrast, text is set in text mode.
29Plain TeX example
- Inline math (mode) equations between s
An inline equation x2-x-10 appears in this
line.
- You will get (approximately)
An inline equation x2x1 0 appears in this
line.
30Displayed Equations (Plain TeX)
- Put display math between (double) s
A displayed equation x2-x-10 sits by
itself, centered on its own line.
A displayed equation x2x1 0 sits by
itself, centered on its own line.
31Knuths poor choice of delimiters
- TeX violates a common custom of mathematical
notation - Delimiters or tags should come in left and
right pairs. - x2-x-10 violates this.
32LaTeX corrects Knuths faux pas
- Uses \( x2-x-10 \) for inline
- Uses \ x2-x-10 \ for display.
Yucko!
- I don't use either of these!
- I still use x2-x-10 for inline.
- For equations, I use a LaTeX feature called
environments
33Display equation environment in LaTeX
Here is a displayed equation \beginequation
\labeleqfibx2-x-10, \endequation and it
has a number.
Here is a displayed equation (1.1) x2x1
0, and it has a number!
34Greek letters
Spelled out as control sequences.
For all \epsilon0 there exists \delta so
that if x-y.
For all ? 0 there exists ? 0 so that if x -
y
35Subscripts and superscripts
These use and _. Nesting is allowed with
Given a bounded sequence x_1,x_2,\dots, there
exists a convergent subsequence
x_i_1,x_i_2,\dots.
36Integrals, and sums
If f is in L20,1 and \beginequation f_n
\frac12\pi \int_02\pi f(x)ei n
x\,dx \endequation then f2_2\Sum_0\inf
ty f_n2.
37Theorem-like environments
\beginthm\labelthfw The equation
AnBnCn has no integer solutions for
n2. \endthm \beginproof See the
margins.\endproof
Theorem 1.1. The equation AnBnCn has no integer
solutions for n2. Proof. See the margins.
?
38Starting and finishing
- LaTeX requires (at least a few) special lines at
the beginning and end of a document.
\documentclassarticle \begindocument Put
your text here... \enddocument
395. How to operate LaTeX.
40(No Transcript)
41Example Basic MikTeX on a PC
- Use any text editor to create an ascii LaTeX file
called file.tex - Get a command prompt (Windows XP) or DOS
prompt.
42(No Transcript)
43comment run LaTex twice!
44(No Transcript)
45(No Transcript)
46(No Transcript)
47(No Transcript)
48Additional Useful Software
- Yap yet another previewer comes with MikTeX.
- Ghostview is a freeware PS viewer.
- Emacs Windows version of standard Unix text
editor. - Ispell Windows version of Unix spelling program
can be attached to Emacs. - AUC-TeX Emacs package that integrates TeX,
Ispell, Yap, and Ghostview into emacs. - PDF-TeX produces PDF files directly from TeX.
Comes with MikTeX. - Adobe Acrobat or Viewer (freeware) for PDF.
49File formats
- Postscript is a page definition language.
- It is essentially a printer program.
- Preferred form for camera-ready publishing.
- Encapsulated postscript (eps) is a stricter
standard of postscript, mostly used for pictures. - PDF is a simplified and compressed version of
postscript - Most e-publishers want a TeX file plus eps
figures. - EPS pictures not appropriate for web (unsupported
by browsers). - Usual .jpeg and .gif pictures not appropriate for
e-publishing.
50EPS Graphics
- X-Fig (Unix, Linux and Windows with Cygwin).
- Win-Fig approximately X-fig for windows
- Adobe Illustrator (commercial) steep learning
curve - Mathematica, Maple and Matlab all export eps
graphics.
51(No Transcript)
52Bibtex
- Supports bib format for bibliographic citations.
- Downloadable from MathSciNet
- References automatically labeled
- Can make master bibliography which can be reused.
53(No Transcript)
546. Alternatives
55Typing formulas in MS Office
- Microsoft Equation 3.0
- Comes with Office products.
- Surprisingly not bad! (students can use it).
- MathType
- Commercial upgrade of Equation 3.0. Now in
Version 5.2. Design Science Inc. - 30 day free trial. About 100. Well worth it!!
56MS Office continued
- TeXPoint for PowerPoint (freeware).
- Builds a limited TeX interpreter into PowerPoint.
- Type TeX expressions (without s) into a slide.
Select TeX-ify from the TeXPoint menu. Converts
to formula. - Works well in combination with MathType
57Still more MS Office TeX
- New (commercial) product TeX2Word and Word2TeX.
- Converts between LaTeX and MS Word with MathType
formulas. - End result similar to Scientific Workplace (?)
- Academic price 4545. (30 day trial available)
- I have not tried it yet.
58The future?