Vicente González Ruiz
March 4, 2015
Contents
Chapter 1
Introduction
1.1 What is TEX?
1.2 What is LATEX?
- LATEX is a collection of macros written in TEX by Leslie B. Lamport
that usually minimize the number of commands to write a new document.
1.3 LATEXalternatives
- XeTeX/XeLaTeX: a TEX/LATEXbranch specifically designed to support
non-English languages.
- LuaTeX/LuaLaTeX: adds Lua support to the TEX/LATEXengines, with the
objective of incrementing the posibilities of the typesetting system. For
example, in LuaTeX we can write:
$\pi = \directlua{tex.print(math.pi)}$
<--------------->
LUA code
to get the value of .
1.4 Installation
- On BSD and GNU/Linux, install Tex Live:
# Debian and derivatives:
sudo apt-get install texlive
# Arch Linux:
sudo pacman -S textlive-most
- On Mac OS X, install:
- MacTex: Download and install the package.
- Tex Live using MacPorts or Fink:
# MacPorts:
sudo port install texlive
# Fink:
fink install texlive
- In Microsoft Windows, install:
- MiKTeX: Download and install the package.
- Tex Live: Download and install the package.
1.5 A very basic test of TEX
# Run:
tex ’\empty Hello World!\bye’
# To get a file: "texput.dvi" that can be displayed with "xdvi".
1.6 An editor: Emacs + AUCTeX
- Provides auto-completion, spell-checking, a complete set of keyboard
shortcuts, table of contents view, document preview and many other
features.
# Debians:
sudo apt-get install auctex
# Arch:
sudo pacman -S auctex
1.7 Basic data flow
.tex + .eps
|
+------+
| v
| +-------+
| | latex |
| +-------+
| |.aux
| +----+
| | | |.bib
| | v v
| | +--------+
| | | bibtex |
| | +--------+
| +---+ |
+---+ | |.bbl
| | +---------+
| +-|-------+ |
+-|-|-----+ | |
| | | | | |
v v v v v v
+---------+ +-------+
| htlatex | | latex |
+---------+ +-------+
|.html |.dvi
v +-----+-----+
| |
v v
+--------+ +-------+
| dvipdf | | dvips |
+--------+ +-------+
|.pdf |.ps
v v
1.8 Basic syntax
Chapter 2
Structures
2.1 Minimal
2.2 Letter
2.3 Article
2.4 Report/Book
2.5 Slides
- Allows to inputs characters other than A-Za-z0-9 and English punctuation
marks (for example, the character ‘á’). Notice that your source document
must use an appropiate encoding system (such as UTF-8).
\usepackage[utf8]{inputenc} % Enought for most latin languages.
- The default LaTeX font encoding is OT1, the encoding of the original
Computer Modern TeX text fonts. It contains only 128 glyphs. For
example, using OT1, letters with accents such as the ‘á’ are generated
by two glyphs: the letter itself and the character ‘ ́’, which produce that
it is imposible to find the ‘á’ in our compiled document because this
character, in fact, does not exist!
- T1 encoding allows up to 256 glyphs and it is essential for compiling
non-English documents.
\usepackage[T1]{fontenc} % Necessary, for example, for creating Spanish documents.
% We specify on Spanish in this example!
\usepackage[spanish]{babel} % Extra info at: "http://www.ctan.org/pkg/babel".
Chapter 4
Commenting the Source Code
Chapter 5
Tables
Chapter 6
List of Items
6.1 The itemize environment
6.2 The enumerate environment
6.3 The description environment
Chapter 7
Formating
7.1 Sizing
7.2 Moving Horizontally
7.3 The verbatim Environment
- The font defines the aspect of the glyphs.
- The most common fonts in LATEX are:
Font | Name |
|
|
pag | Avant Garde |
fvs | Bitstream Vera Sans |
pbk | Bookman |
bch | Charter |
ccr | Computer Concrete |
cmr | Computer Modern |
pcr | Courier |
mdugm | Garamond |
phv | Helvetica |
fi4 | Inconsolata |
lmr | Latin Modern |
LinuxBiolinumT-OsF | Linux Biolinum (formerly ’fxb’ in older package versions) |
LinuxLibertineT-OsF | Linux Libertine (formerly ’fxl’ in older package versions) |
pnc | New Century Schoolbook |
ppl | Palatino |
ptm | Times |
uncl | Uncial |
put | Utopia |
pzc | Zapf Chancery |
- The default font for LaTeX is Computer Modern.
- In LATEX, each font has three families (also named styles) which are: (1)
roman (\textnormal{...} or \textnormal{...}), (2) serif (\textsf{...})
and (3) monospace or teletype (\texttt{...}).
8.1 Series
- Controls the thickness of the font.
8.2 Shape
- Controls shape of the font.
8.3 Changing the Font for the Entire Document
8.4 Changing the Font for a Part of the Document
Chapter 9
Mathematics
Chapter 10
Creating Macros
10.1 (Re)Defining a new command
10.2 (Re)Defining a new environment
Chapter 11
Drawing
11.1 The picture environment
11.2 Inserting (vectorial) drawings
- For using pdflatex (with latex is also possible but you must create .eps
files instead of .pdf files for the figures).
- Steps:
- Create a .fig figure using Xfig.
- Convert it to a .pdf file with:
- Include in the document the figure with:
\includegraphics[width=200pt]{figure}
Chapter 12
Arithmetic
Chapter 13
Producing HTML5 Documents
- Write your document in LATEX using any standard document class
package (for example, article works great).
- Create your raster images in PNG or JPEG format and your vectorial
figures in SVG. In order to have both the .pdf and the .html version of
your document, include them in the text with:
where your-figure is the filename of your figure without the extension,
and extension is .png, .jpg or .svg, accordingly. All these figures must
be in the same directory that the LATEX source.
- Create the .pdf version of your document by running:
- Create the .html version of your document by running:
An example is available at https://github.com/vicente-gonzalez-ruiz/LaTeX-to-HTML5-example.