V Very S G L: ERY Hort Uide To Atex
V Very S G L: ERY Hort Uide To Atex
Typesetting
2012
Dr P. V. Johnson
Latex
Advantages...
Disadvantages...
The Basics
T HE BASIC I DEA
A word processor allows the user to design the document
on screen whilst the text they type appears inside it
In LATEX, when writing, you will not see the final document...
LATEXwill design the document for you.
You can help with the design by using LATEX commands.
You will see this idea everywhere:
Computer coding
html
xml
postscript
svg
Dr P. V. Johnson
Latex
Advantages...
Disadvantages...
The Basics
T HE BASIC I DEA
If not satisfactory
change settings
Dr P. V. Johnson
Latex
Document ready
for printing or viewing
file.dvi
Advantages...
Disadvantages...
The Basics
T HE GOOD POINTS
Professionally crafted layouts are available, which make a
document really look as if printed.
The typesetting of mathematical formulae is supported in a
convenient way.
Users only need to learn a few easy-to-understand
commands that specify the logical structure of a document.
They almost never need to tinker with the actual layout of
the document.
Even complex structures such as footnotes, references,
table of contents, and bibliographies can be generated
easily.
Dr P. V. Johnson
Latex
Advantages...
Disadvantages...
The Basics
T HE GOOD POINTS
Dr P. V. Johnson
Latex
Advantages...
Disadvantages...
The Basics
T HE BAD POINTS
LATEXdoes not work well for people who have sold their
souls. . .
Although some parameters can be adjusted within a
predefined document layout, the design of a whole new
layout is difficult and takes a lot of time
It is very hard to write unstructured and disorganized
documents.
Your hamster might, despite some encouraging first steps,
never be able to fully grasp the concept of Logical Markup.
Dr P. V. Johnson
Latex
Advantages...
Disadvantages...
The Basics
G ETTING STARTED
Dr P. V. Johnson
Latex
Advantages...
Disadvantages...
The Basics
Dr P. V. Johnson
Latex
Advantages...
Disadvantages...
The Basics
H ELLO W ORLD !
So the Hello World! tex file looks like
\documentclass{article}
\begin{document}
Hello World!!
\end{document}
On unix machines, if this file is called helloworld.tex
we can compile it with the command
latex helloworld.tex
Dr P. V. Johnson
Latex
Text
Maths
Dr P. V. Johnson
A line break
Another line break
A large space counts as
a single whilst an empty
line.
Makes a new
paragraph.
Latex
Text
Maths
Dr P. V. Johnson
Latex
Text
Maths
Dr P. V. Johnson
Latex
Text
Maths
C ROSS -R EFERENCING
One of the most powerful tools of LATEXis the cross
referencing
Write the label commmand after the equation, section,
figure or table we want to reference
Commands are:
\label{key}, \ref{key}, \pageref{key}
Dr P. V. Johnson
Latex
Text
Maths
C ROSS -R EFERENCING
One of the most powerful tools of LATEXis the cross
referencing
Write the label commmand after the equation, section,
figure or table we want to reference
Commands are:
\label{key}, \ref{key}, \pageref{key}
Use descriptive names for the key, for example
\begin{equation}
a^2 + b^2 = c^2
\label{eqn:pythags-rule}
\end{equation}
Dr P. V. Johnson
Latex
Text
Maths
E QUATIONS
Use the amsmath is the standard package to typeset
maths in LATEX
Put the following at the top of your document:
\usepackage{amsmath}
We can put mathematical expression within text:
Paul was running
at $5ms^{-1}$.
Latex
Text
Maths
i2
or
$$ \int_0^\infty
e^{x^2} dx $$
Dr P. V. Johnson
Z
0
Latex
ex dx
Text
Maths
S UMMARY
Dr P. V. Johnson
Latex