Maths Typesetting Using L TEX-A Short: 1 Getting Started
Maths Typesetting Using L TEX-A Short: 1 Getting Started
Introduction
J.D.
May 11, 2017
1 Getting Started
Maths is beautiful, so it demands a beautiful typesetting system. This is almost
single-handedly accomplished by Donald Knuth (mathematician, legendary pro-
grammer, and a Lutheran organist) with his TEX. Over the decades it has de-
veloped into a huge typesetting system called LATEX. At the core is TEX, whose
current version is 3.14159265 (yes you wonder why ,).
1.1 Installation
While you may wish to have a local installation of the software package (it’s Big),
you can also use online editors such as those at overleaf.com or sharelatex.
com.
I prefer to use a local installation with TeXShop on top of TeX Live. In-
stallation is usually straightforward. Occasionally you may need to add some
optional packages, later on.
% title etc.
\title{Maths Typesetting using \LaTeX - A Short Introduction}
\author{J.D.}
\date{\today}
%
\begin{document}
\maketitle
1
... Here the document starts. You can use \section, \subsection,
\subsubsection etc. to structure the document. E.g.,
\section{blah my first section}
\subsection{blah blah first subsection}
Here goes a paragraph.
A blank line (like above) will start a new paragraph. Yes you are
liberated from having to deal with numbering and formatting
trivialities.
You can include figures and tables (these will also be automatically
numbered). Footnotes and bibliography too. Use \label{thelabel} to define
a label, \ref{thelabel} to refer to sections/figures/tables.
\cite{...} to cite a book/article/webpage etc. -- see BibTeX.
...
Finally, remember to end the document - otherwise the document can’t
compile. Yes the document is a piece of code that’s to be compiled and
rendered into Postscript or PDF for viewing/printing.
\end{document}
z =x+y (1)
Note here a label is also given. You can refer to the labelled equation using the
\ref{eq:myeq} command citing the label anywhere in your document. E.g., z
is given in Eq.(1).
To get an unnumbered equation, you use the \[ ... \] or $$ ... $$ wrap-
per instead. Here’s an example. Using
$$e=mc^2,$$
we get
e = mc2 ,
Easy!
2
1.4 Display style
Sometimes maths notations are embedded in the main text, e.g., suppose there’s
a function f (x) = sinx x . If we add \displaystyle in front of the \frac operator,
sin x
the fraction can be better rendered, like this – f (x) = .
x
You’ll find the display style handy to typeset continued fractions, e.g. the
following one –
x
tanh(x) =
x2
1+
x2
3+
x2
5+
7 + ···
Display style also works for other operators. For instance, try adding \displaystyle
in front of the \sum operator used for the expression
1
PN ,
i=1 xi
2 Notation guidelines
Before getting into the gritty details about formatting, let’s start with some
notation conventions mathematicians tend to adopt:
1. Use plain alphabetics for variable names, e.g., x, y, z.
5. To represent space, use \mathbb, e.g. R3 gives our 3-D Euclidean space.
3 Misc.
Question . Where can I find a FAQ?
Answer. It’s better to go through a longer tutorial (than this one) and get to
learn more about the basic usage, among more tricks. Then you can use Google
to search out online answers to various LATEX related questions, many in high
quality notably on stackexchange.com.
There is a Wikibook on LATEX and it’s quite useful too. Check it out. Get
the mathematical symbols page printed – it will be quite handy.