1
Introduction
1.1 Introduction
It would be a great disservice to say LaTeX is just a system for typesetting mathematics. Its applications span writing business and personal letters, newsletters, articles, and books covering the whole range of the sciences and humanities, right up to full-scale volumes and encyclopaedias and reference works on all topics [2].
Nowadays, distributions of LaTeX exist for practically every type of computer and Operating System (OS) . This chapter hopes to provide a strong justification of its use along with a wealth of information about its many present-day uses. First, however, let’s look at some background information.
1.2 A Historical Overview
1.2.1 Inception
In
May
1977,
Donald
Knuth
TeX a new typesetting system intended for the creation of beautiful books–and especially for books that contain a lot of mathematics. By preparing a manuscript in TeX format, you will be telling a computer exactly how the manuscript is to be transformed into pages whose typographic: quality is comparable to that of the world’s finest printers”
In 1979, Gordon Bell wrote in a foreword to an earlier book, TeX
and
METAFONT
,
Donald Knuth’s Tau Epsilon Chi (TeX) is potentially the most significant invention in typesetting in this century. It introduces a standard language in computer cryptography and in terms of importance could rather be introduction of the Gutenberg press”
In
the
early
1990s,
Donald
Knuth
officially
announced
TeX
would
NOT
undergo
any
further
development [8]
in
the
interest
of
stability.
The
development
of
TeX
from
its
birth
as
one
of
Donald
Knuth’s
“personal
productivity
tools”
Information : The Art of Computer Programming
Donald Knuth is known for working on the Art of Computer Programming rather than LaTeX and therefore it is worth taking a slight detour here and look at it.
It is a comprehensive, multi-volume monograph presenting programming algorithms and their analysis. As of 2025 it consists of published volumes 1, 2, 3, 4A, and 4B, with more expected to be released in the future. The Volumes 1-5 are intended to represent the central core of computer programming for sequential machines with the subjects of Volumes 6 and 7 are important but more specialised. The books are known to be hard to read but contain a detailed and scientific look at the performance of algorithms.
1.2.2 Adding Macros: LaTeX
While
Knuth
was
developing
TeX,
in
the
early
1980s,
Leslie
Lamport
The details of the layout can be left for the document designer to specify elsewhere.
The edition of LaTeX: A Document Preparation System [10] begins with:
LaTeX is a system for typesetting documents. Its first widely available version, mysteriously numbered 2.09, appeared in 1985.”
This release of a stable and well-documented LaTeX led directly to the rapid spread of LaTeX-based document processing beyond the mathematical community.
LaTeX was the first widely used language for describing the logical structure of a large range of documents and hence introducing the philosophy of logical design.
The essence of “logical design” is that the author should be concerned only with the logical content of his or her work and not its visual appearance.
Back then, LaTeX was described variously as TeX for the common men. Its use spread very rapidly during the next decade. By 1994 Leslie could write,
LaTeX is now extremely popular in the scientific and academic communities, and it is used extensively in industry [2]
The
worldwide
availability
of
LaTeX
allowed
fast
adoption
in
TeX
and
in
its
use
for
typesetting
a
range
of
languages.
LaTeX
2.09
came
with
documentation
worth
translating
because
of
its
In
context
of
typography,
the
word
For typography, “language” covers a lot more than just the choice of “characters that make up words”, as many important distinctions derive from other cultural differences that affect traditions of written communication. Therefore, important typographic differences are NOT necessarily in line with national groupings but rather arise from different types of documents and distinct publishing communities.
1.2.3 Reworking Fonts and the LaTeX Project
Another
important
contribution
to
the
reach
of
LaTeX
was
the
pioneering
work
of
Frank
Mittelbach.
As
a
reward
for
all
their
efforts,
which
included
a
steady
stream
of
bug
reports,
and
fixes
for
Lamport,
by
1991
Mittelbach
and
Schopf
had
Very soon Version 2.09 was formally frozen and, although the change-log entries continue for a few months into 1992, plans for its demise as a supported system were already far advanced as something new was badly needed. The worldwide success of LaTeX by the early 1990s led in a sense to too much development activity to improve and add functionality by numerous developer. This finally culminated with the announcement in 1994 of the new standard LaTeX, christened LaTeX2e. However this was not enough and another unification effort went underway to unify the branching dialects of LaTeX under one branch.
The
development
of
this
“New
Standard
LaTeX”
and
its
maintenance
system
was
started
in
1993
by
the
LaTeX3
Project
Team [13].
Although
the
major
changes
to
the
basic
LaTeX
kernel
and
the
standard
document
classes
(systems
in
2.09)
were
completed
by
1994,
substantial
extra
support
for
coloured
topography,
generic
graphics,
and
fine
positioning
control
were
added
later,
largely
by
David
Carlisle.
Although the original goal for this new version was consolidation of the wide range of models carrying the LaTeX nature, what emerged was a substantially more powerful system with both a robust mechanism (via LaTeX packages) for extension and, importantly, a solid technical support and maintenance system. This provides robustness via standardisation and maintainability of both the code base and the support systems.
This system remains the current standard LaTeX system.
1.3 Current State
Before
diving
into
how
to
program
and
type
wonderful
documents,
let’s
have
an
overview
of
the
vast
array
of
files
used
by
a
typical
LaTeX
system
with
its
many
components.
This
overview
will
also
involve
some
descriptions
of
how
the
various
components
interact
with
each
other
and
of
course
with
the
LaTeX
compiler.
Most
users
The following description assumes familiarity with a standard computer file system in which a
.doc
extension would tell it is a Word file, or .txt
file would imply it is a text file.
When
processing
a
document,
LaTeX
reads
and
writes
.glo
would
be
generated
during
its
compilation.
These
files,
in
a
non-exhaustive
list,
are
listed
in
Table
1.1
.
The
most
obviously
important
files
in
any
LaTeX
documentation
project
are
the
.tex
,
which
are
known
as
Often, several graphical images are included in the typeset document utilizing the graphicx
which we will talk later.
For LaTeX to operate, it also needs several files containing structure and layout definitions:
-
class files with the extension.cls
; -
package files with the extension.sty
Many of these aforementioned files are provided by the basic system set-up, but others may be supplied by
individual users as customisation. LaTeX
is distributed with five
article
, report
, book
, slides
, and letter
.
These document classes can further be customised by the contents of other files specified either by class options (.cls
) or by
loading additional packages (.sty
). In addition, many LaTeX
documents will implicitly input language definition files of the babel
system with the extension .ldf
and
inputenc/fontent
packages with the extension .def
.
The
information
LaTeX
needs
about
the
glyphs
.tfm
).
This does NOT include information about the shapes of glyphs, only about their dimensions.
Information
about
which
font
files
are
needed
by
LaTeX
is
stored
in
The output from LaTeX
itself is a collection of
1.3.1 Files During Compilation
TeX’s
own
particular
representation
of
the
formatted
document
is
that
of
a
.dvi
).
TeX
positions
glyphs
and
rules
with
a
precision
far
better
than
0.01
μ
m
.
Some
variants
of
the
TeX
program,
such
as
pdfTeX,
can
produce
device-independent
file
formats
including
the
Portable
Document
Format
(PDF)
(.pdf
),
which
is
the
native
file
format
of
Adobe
Acrobat.
.dvi
specifies
ONLY
the
names/locations
of
fonts
and
their
glyphs.
It
does
NOT
contain
any
rendering
information
for
those
glyphs
whereas .pdf
file
format
can
contain
such
rendering
information.
File Type | Common File Extension(s) | |
---|---|---|
Document Input | text | .tex .dtx .ltx
|
Bibliography | .bbl
|
|
Index/Glossary | .ind .glo
|
|
Graphics | Internal | .tex
|
External | .ps .eps .tif .png .jpg .gif .pdf
|
|
Other Input | Layout and Structure | .cls .sty
|
Internal | Auxiliary | .aux
|
Tables of Content | .toc
|
|
List of figures/tables | .lof .lot
|
|
Output | Results | .pdf .dvi
|
Transcript | .log
|
|
Bibliography | Input and Ouput | .aux .bib
|
Database, Style, Transcript | .bib .bst .blg
|
Some
of
the
.toc
),
the
lists
of
figures (.lof
),
and
of
tables (.lot
).
There can be others which can be specific to particular packages or to other parts of the system.
Finally, LaTeX
generates a transcript file of its activities with the extension .log
. This file contains a lot of information, such as:
-
the names of the files read,
-
numbers of the pages processed,
-
warning
anderror
messages,
and
other
pertinent
data
that
is
especially
useful
when
debugging
errors.
Information
about
citations
in
document
is
written
by
LaTeX
to
a .aux
file.
This
information
is
used
first
to
extract
the
information
from
a
.bib
)
and
then
sort
it
which
is
then
written
to
a
.bbl
) [2].
Because
of
the
limitations
of
TeX,
especially
its
failure
to
handle
graphics,
it
is
often
necessary
to
complete
the
formatting
of
some
elements
of
the
typeset
document
.dvi
file.
This
is
normally
done
by
TeX’s \special
primitive
which
simply
puts
this
information
at
the
correct
place
in
the .dvi
file.
This information may be simply the name of a graphs file to be input; or it may be instructions in a graphics language.
Once the document has been successfully processed by TeX, we will probably want to take a look at the format. This is commonly done
on screen, but detailed inspection of printed output should always be performed via printing on paper at the highest available resolution.
A current favorite approach is to use a .pdf
file, especially when electronic distribution of the formatted document is required [2].
Occasionally you will find that some applications will produce much better quality screen output than others; this is due to limitations of the different technologies and the availability of suitable font resources.
1.3.2 A Hello, World!
LaTeX
is
a
Hello, World!
programme.
Below you can see the LaTeX version of it.
\documentclass[a4paper,12pt]{article} \begin{document} If one merely wishes to type in ordinary text, without complicated mathematical formulae or special effects such as font changes, then one merely has to type it in as it is, leaving a completely blank line between successive paragraphs. You do not have to worry about paragraph indentation: all paragraphs will be indented with the exception of the first paragraph of a new section. One must take care to distinguish between the `left quote' and the `right quote' on the computer terminal. Also, one should use two `single quote' characters in succession if one requires ``double quotes''. One should never use the (undirected) `double quote' character on the computer terminal, since the computer is unable to tell whether it is a `left quote' or a `right quote'. One also has to take care with dashes: a single dash is used for hyphenation, whereas three dashes in succession are required to produce a dash of the sort used for punctuation---such as the one used in this sentence. \end{document}
For anyone curious, this is a passage from a semi-famous document about LaTeX [17]. While the language may look unwieldy, please don’t worry as by the end of this course you will learn how to craft well typed and designed documents.
1.4 Installation
As with most software which is free and open-source, there are many ways in which we can install LaTeX on our computers [18].
The
There are a various programs available to compile your document depending on your OS .
The LaTeX Project provides information about how to install LaTeX on Windows, macOS, and Linux, as well as online (Overleaf) services.
We will look at the instruction on how to install the most common LaTeX programs for Windows and macOS in the next section.
Aside
from
the
back
end
software
required
to
run
LaTeX It
is
highly
recommend
to
use
a
text
editor.
A
text
editor,
to
put
it
simply,
is
a
front-end
software
which
can
be
used
to
create .tex
file
used
by
the
compiler
and
provides
numerous
benefits
such
as:
-
Syntax-highlighting,
-
Auto-completion,
-
Auto-reference inserting,
-
Easy navigation between files.
Text editor programs such as TeXwork , TexStudio , TexMaker , and TexShop provide a friendly interface for users and are usable out of the box with minimal configuration.
Often these front end programs include help menus, wizards for creating LaTeX objects, drop down menus for inserting symbols or altering text, and many other features that will support both new and experienced LaTeX users. You will find more information about these frontend programs in the "LaTeX Interfaces" box below.
Information : Advanced Editors
Of course, these are NOT the only editors capable of working with LaTeX. As it is written in plain text , any editor can technically work with it. For anyone who has a pre-defined work-flow or have an affinity to working with a specific editor they are welcome to use their own editors.
For this course, we will look at TeXStudio , a well-crafted and supported editor.
1.4.1 Windows
For a Windows computer it is
strongly recommend
to use the common MiKTeX distribution. The MiKTeX/about page contains
several links including how to install, deploy, and update MiKTeX.
-
Download MiKTeX by clicking Download .
-
Run the installer. During the installation process, you will be prompted to select the
paper size . It is recommend that you choice A4 . This can be changed later if needed. In additon, it is recommended to choose Yes to the option, Install missing packages on-the-fly. -
Once the installation is complete it is recommend that you check for any updates. The update wizard can be found through the Windows start menu under the name MiKTeX . Once the window opens up, click on Updates on the left side. If not clicked, please click on Check for updates . It may take a few seconds but once done, please then click on Update now .
We should have a working LaTeX distribution on our computer. Next we need to install a nice editor and as mentioned we shall install TexStudio .
-
Download TeXStudio by clicking Download .
-
Run the installer.
The installation should be very straightforward. Once the installation is finished. Please click on the icon to start the application which you will be greeted with the following window
On the left we have the side panel which is currently showing an empty structure view. On the lower right you see the messages panel which can be switched to the log panel, the preview panel, or the search results panel. The toolbar allows easy access to some often needed functions, three of them are marked as we will use them soon. The central toolbar offers access to some common latex commands as we will see [19].
1.4.2 Creating a Document
To start easy, lets use their “Quick start” option. Inside the TeXStudio, please click on the
menu File/New From Template
. You will be greeted with the following menu in
Fig.
1.4a
:
Here we choose the article
class. Once chosen, we can see some boilerplate code being entered into our editor.
As a final part of this chapter, to see if everything is working, please click on the green triangle button to run the LaTeX compiler and then click on the document with the magnifier to see your output.