Learning Latex
before it´s too late!
Andrew Roberts
1 History of Latex
1 What does it do?
1 How does it work?
1 Benefits of using Latex
1 And problems
1 Getting set up
1 Hello World!
History of Latex (1)
1 ~ 19// Donald Knuth began writing
2 Designed to be a powerful and flexible
typesetting utility.
2 Output equal to professional printers.
(Especially good for maths)
2 Focussed on physical presentation -
needed to learn lots of intricate
History of Latex (2)
1 Beginning of 80s, Leslie Lamport
created Latex.
2 Adds layer of abstraction over
standard Tex.
2 Allows author to focus on content
rather than presentation.
2 Added many useful tools for
automating tedious tasks (indices,
bibliographies, cross-references etc.)
What does Latex do?
1 Takes input from a source file (text)
1 Processes the contents and decides
how best to typeset the document
1 Outputs device-independent (Dv!)
1 NøI ¡nIera¿I¡ve I¡Ke wørø prø¿ess¡ng.
How does Latex work? (1)
1 Essentially, everything is put into a box and
glued together.
1 Accuracy is very high - s¿aIeø øø¡nI is 100
of the wavelength of natural light!
1 Waits until it sees everything you want to
put into the document, and Inen determines
the most aesthetic presentation (or, least
bad is more accurate).
How does Latex work? (2)
1 Source text is marked-up with logical
1 Document classes tell Latex how to
format these elements.
1 This is the spirit of Latex!
Latex Architecture
Tex output (.dvi)
User input (.tex)
Document classes (.cls)
Packages (.sty)
Postscript (.ps) Acrobat (.pdf) Screen Printer
Working files
(.aux) (.idx)
(.toc) (.lof)
Bibliography (.bbl)
1 Think HTML!
1 Presentation markup
2 Give explicit instruction on how to
display data.
1 Logical markup
2 To provide semantics and structure.
Narkup Advantages
1 Separation of content and form
1 Facilitates consistent presentation
1 Can easily change document styles
2 Remember! Typography is a creative
skill - leave it to the experts!
1 Allows easier conversion between
markup formats, e.g, Latex ² HTNL.
Narkup Disadvantages
1 Need to learn markup before being
able to produce basic documents.
1 Narkup can be easily misused, e.g.,
using tables as a tool for layouts (a
big issue in web pages).
1 Narking up more complex data, such
as tables 123 take more time than a
visual approach as employed by WP.
Output - DvI
1 Device Independent files (.dvi).
1 Designed so that output could be
printed/viewed on any device:
2 > 1000dpi commercial printers
2 Dot matrix printers
2 Screen viewers (high resolution to
text-only terminals)
1 Can be converted easily to PS or PDF.
Benefits of Latex
1 Separation of style and content (it's a
good thing, honest!)
1 Portability - x-platform; small files.
1 Flexibility - can do anything!
1 Control - do it how you want it done.
1 Output - Superior to WP.
1 Scalability - Big documents
1 Stability - never crash and corrupt
1 Cost - free!
The basics - Commands
1 Command format:
1 Arguments are manditory
1 Options are optional!
1 E.g.,
The basics - Source file
Front matter
Back matter
\f1f]e|An Lxamp]e}
Hello World!
1 Not just for programming languages!
x he]]o.1ex - Ou¡ f1¡s1 La1ex examp]e!
he]]o Wo¡]d!
Hello World! (2)
1 Comments begin with ¾ - ignored by
1 Document classes defines the format
of the document (standards included:
article, book, report, letter and slides.
1 Document environment encapsulates
the contents. Text in-between is
printed by Latex.
Special Characters
Nore lingo
1 Environments:
2 Commonly for specifying different
special paragraph styles, e.g,.
abstract, quote. Also for more general
formatting, e.g, center.
Nore lingo (2)
1 Packages:
(Always in the declared in the preamble)
2 Extends the core Latex functionality
(or simplifies complex tasks).
2 Provide new commands and/or
2 Nany already come bundled with
Latex - hundreds more available from
CTAN (WWW.cfan.o¡g)
Nore info.
1 First stop:
1 Beware when using search engines!

Sign up to vote on this title
UsefulNot useful