How to use laTex in our days
Fabian Morteo Flores
7th June 2017
1 Introduction
2 Installation
2.1 Under windows
2.2 Under Linux
2.3 Under Mac OS X
3 First steps
3.1 Interface summary
4 Environments
4.1 Lists
4.1.1 Itemized Lists
- First Item
Second Item
Third Item
This is a nested list
and we can go even deeper . . .
4.1.2 Enumerated Lists
1. First Item
2. Second Item
(a) first subitem
(b) second subitem
(c) Third Item
i. deeper item
1
ii. another item
4.1.3 Descriptive Lists
This First item
That Second item
Other Third item
4.2 Figures
Figure ?? can be resized or rotated amongst
other things
Figure 1: the figure caption goes here
2
Table 1: Table caption
cell 1 cell 2 cell 3
cell 4 cell 5 cell 6
4.3 Tables
4.3.1 Basic Tables
4.4 Mathematics
ei + 1 = 0 and displayed maths using:
X
Q= U AT.
1
QV = N V T.
3
N
X
QC = U AT
i=1
4.5 Bibliographies
Using these notes
Instructions have been given as commented out text, which does not appear in the final document.
The final output will serve as a user guide, mostly based on the TEXworks manual.
Introduction
The goal of TEX was to have a system which would always produce the same documents independently
of the actual machine they were processed on.
TEX provides basic tools (commands/instructions/primitives) to define typesetting; almost every
detail has to be defined, but the language allows the creation of macros for repeatedly used constructs.
So collections of macros are loaded through format files (i.e., pre-compiled large macro collections).
The most widely used format is LaTEX (Leslie Lamport, 1985), which provides more global commands
and structures for documents (article, book,...) allowing easier and faster work, but sometimes with
loss of flexibility due to the more or less rigid framework.
Many engines and programmes have been created around TEX, including pdflatex for direct conver-
sion to PDF format.
To use TEX and the systems of its family, one has to create a source document as TEX is only a
system to transform a source document into a (beautifully) typeset document. This source is a simple
text with typesetting instructions and one needs a programme to create it: the editor. There are many
editors able to create a TEX source; some are general editors, others are specifically designed for TEX:
here TEXworks comes in.
TEXworks is a project to create a text editor for use with the TEX family of tools; we will refer to
these as (La)TEX. Instead of creating a new sophisticated program, equipped with multiple tool-bars
to meet any need, TEXworks provides a simple editor, offering at first sight only a limited set of tools
for text editing as well as a single button and a menu to typeset a (La)TEX text.
TEXworks currently runs on Linux, Mac OS X and Windows. The interface is always the same and the
program offers the same functionality on all three platforms.
3
Installation
TEXworks is only a text editor; to be able to create documents with (La)TEX and to typeset them to
PDF, we also need what is called a TEX distribution. This is a collection of programs and other files
which will be automatically called by TEXworks during its work. Thus, you need to install a distribution:
we will do that before starting TEXworks for the first time, as this way, TEXworks will automatically
find what it needs.
For Linux: most Linux distributions include a TEX distribution, but it may not be installed by default
and you will have to use the Linux package management tools to do that.
For the Mac: MacTeX is available; see http://www.tug.org/mactex/.
For Windows: a very popular distribution is MiKTeX (http://www. miktex.org/) using editors such as
http://www.xm1math.net/texmaker/download.html Texmaker or TEXnicCenter http://www.texniccenter.org/
Under Windows
Most of the larger TEX distributions already contain TEXworks as a package. Sometimes, these versions
even have some distribution-specific enhancements.
When you start TEXworks for the first time, it creates a folder named TeXworks in your home folder.
This folder will contain some sub-folders for auto-completion, configuration, dictionaries, templates,
and interface translation/localisation files the TEXworks manual covers these in more detail.
Under Linux
Several common Linux distributions already have packages for TEXworks. They are adequate for most
users and facilitate installing TEXworks consider- ably.
Under Mac OS X
MacTeX 2010 already contains TEXworks as a package. So, the preferred way of installing TEXworks
on the Mac is to use the package manager of your distribution.
First steps
Interface summary
When one opens the editor, it shows a very sparse interface: a title bar, a menu bar, two small toolbars,
a large typing zone (white) and, at the bottom, a status bar. We are in the source/editor window. If
you have already typeset the document previously, the resulting .pdf will be shown on the right hand
side in the preview window.
The first toolbar has a button to typeset and an drop-down menu to choose the format for typesetting
(well choose pdfLaTeX).
The second toolbar provides the standard functions: New document, Open, Save Undo, Redo
Cut, Copy, Paste Search, Replace.
Environments
An environment is similar to a group, but has wider influence and is enclosed in \begin{} and \end{}
statements, as in the document environment.
Lists
Itemized lists
First item Second item Third item Fourth item
You can choose the type of marker:
Enumerated Lists
1. First item 2. Second item 1. first subitem, 2. second subitem. 1. deeper subitem, 2. another
subitem.
4
Descriptive Lists
This First item That Second item Other Third item
Figures To include graphics the following package needs loading in the preamble (before the begin-
document).
The size can be changed by providing an option:
Other options allow the figure to be resized or rotated amongst other things. The figure environment
The [h] option means put the figure [h]ere and can be a choice of [htbf!] for here, top, bottom, float
and DO WHAT I SAY! Latex will mostly put the figure where it fits best for typographic rules, rather
than where you want it exactly.
Figure ?? can be resized or rotated amongst other things.
The [h] option means put the figure [h]ere and can be a choice of [htbf!] for here, top, bottom, float
and DO WHAT I SAY! Latex will mostly put the figure where it fits best for typographic rules, rather
than where you want it exactly.
Tables
Basic Tables
Dividers can be specified using the pipe key: and hline is a horizontal lineThe cc option specifies
two centred columns. Left is l and r is right. Specifying column width
Day Summary Tuesday
Cloudy with rain, across many northern regions. Clear spells across most of Scotland and Northern
Ireland, but rain reaching the far northwest.
Using the tabu package
Mathematics
Inline maths can be entered using escaped parenthesesei + 1 = 0 or dollars y = mx + c and displayed
maths using escaped square brackets:
X
Q= U AV
or double dollars:
Zb
I= dx.
a
\begin{equation} ... \end{equation} can be used for single equations, but the align environment
is also invaluable:
Notice the and symbol is used where you want the alignment on each line and double-backslash is used
for a new line, as in tables. You can also label and refer to equations using refNAME and eqrefNAME,
like Equation (??). Go to http://en.wikibooks.org/wiki/LaTeX/Mathematics and typeset your
favourite equations!
Bibliographies (I) Its easy to cite a book (cite using: [?]) using inline bibliographies. However, its much
more convenient to use an automatic bibliography management tool like bibtex (covered in Session 2).