La Te X Introduction Quick Start Guide

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 5

DownloadLa Te X Introduction  Quick-start Guide
Open PDF In BrowserView PDF
2017/11/20

LaTeX introduction / Quick-start guide
https://www.latex-tutorial.com/tutorials/

Home (/)
Quick Start

»

LaTeX introduction / Quick-start guide
All basic features covered on a single page, no need
to install anything. Edit LaTeX code and compile the
pdf right in your browser.
Tweet

[Open document online] (https://www.writelatex.com/docs?snip_uri=http://www.latextutorial.com/media/downloads/latex-quick-start-tutorial.tex&splash=none)
This fast guide to LaTeX shows you how to create this document [pdf] (/media/filer_public/d3/85/d385cace-df8c4701-bbdd-d57028417a62/latex-quick-start-tutorial.pdf). You can download the pdf for offline reading or use the
interactive sandbox (/tools/sandbox/) to enhance your learning experience. I've also made the source code [tex]
(/media/filer_public/4a/04/4a042fda-8587-47f4-acf6-9c94cfd48980/latex-quick-start-tutorialtar.gz) available, so that
you can examine it in an editor of your choice. All features are only switfly explained here, for deeper insights, you
should use the regular tutorials (/tutorials/).

Structure of a LaTeX document.
The documents in LaTeX are structured slightly different from Word. A document consists of two parts, the preamble
and the main document. If you're familiar with programming, then you might want to compare the structure with that
of a C/C++ file.

Preamble
The purpose of the preamble is to tell LaTeX what kind of document you will set up and what packages you are
going to need. A package is a set of additional functions such as amsmath for additional math formatting. For this
document, the preamble looks like this:
% Preamble
% --\documentclass{article}
% Packages
% --\usepackage{amsmath} % Advanced math typesetting
\usepackage[utf8]{inputenc} % Unicode support (Umlauts etc.)
\usepackage[ngerman]{babel} % Change hyphenation rules
\usepackage{hyperref} % Add a link to your document
\usepackage{graphicx} % Add pictures to your document
\usepackage{listings} % Source code formatting and highlighting

You can set the class of the documentclass with the documentclass command and add packages with the
This websitecommand.
makes use Only
of cookies
to enhance browsing
experience
and provide
additional
usepackage
the documentclass
command
is mandatory,
you can
compilefunctionality.
a document Details
also without
packages, yet some functions may be missing in this case. The usepackage command must not be used in the
https://www.latex-tutorial.com/quick-start/

1/5

2017/11/20

LaTeX introduction / Quick-start guide

main document.

Main document
The main document is contained within the document environment like this:
\begin{document}
% ...
% ... Text goes here
% ...
\end{document}

Within those two statements, we can add the content of our document. But just adding the text is probably not
enough, since we also have to apply formatting to it.

Formatting in LaTeX
Formatting in LaTeX can be applied by the use of commands and environments. The topmost environment is the
document environment as described above. So there are obviously more environments, but how to find them? Well
the easiest way is to download a LaTeX cheat sheet which provides a list of the most useful commands and
environments. For most packages there is also a manual available, which can be found on Google.

Math typesetting
To introduce you to math typesetting and environments, I will demonstrate you how to format some simple
equations:
f (x) = x

2

′

f (x) = 2x

F (x) = ∫

f (x)dx

1
F (x) =

x

3

3

This can be done with the following code:
\begin{align}
f(x) &= x^2\\
f'(x) &= 2x\\
F(x) &= \int f(x)dx\\
F(x) &= \frac{1}{3}x^3
\end{align}

As you can see, we again have a begin and end statement, this is applying the align environment to our equations,
so that they will be aligned at the ampersand (&) sign. Naturally, the ampersands will be placed in front of the
equality sign. If you watched carefully, you will see that LaTeX magically added sequential numbers to all equations.
LaTeX does this for many other things in your paper too, so you will usually not have to waste time on this, but more
about that in the next chapter.

Document layout
Usually a document does not only consist of a bunch of equations, but needs some kind of structure too. We are
usually going to need at least:
Title/Titlepage
This website
use of cookies to enhance browsing experience and provide additional functionality. Details
Table ofmakes
contents
Headlines/Sections
https://www.latex-tutorial.com/quick-start/

2/5

2017/11/20

LaTeX introduction / Quick-start guide

Bibliography
LaTeX provides all the commands we need. The following commands will help us:
\section{Text goes here} % On top of document hierarchy; automatically numbered
\subsection{}
\subsubsection{}
\paragraph{} % Paragraphs have no numbering
\subparagraph{}
\author{Claudio Vellage} % The authors name
\title{A quick start to \LaTeX{}} % The title of the document
\date{\today{}} % Sets date you can remove \today{} and type a date manually
\maketitle{} % Generates title
\tableofcontents{} % Generates table of contents from sections and subsections
\\ % Linebreak
\newpage{} % Pagebreak

There are commands to create sections, the sections are numbered automatically and the tableofcontents
command will use them to generate the table of contents. You don't have to do it yourself, ever. LaTeX
alsocookies
provides
Allow
commands to generate the title using the maketitle command. This needs the author, title and date command to be
set. If you place the maketitle or tableofcontents command in your document, the Commands will be added at that
exact place, so you probably want them in the very beginning of your document. If you want the title to appear on a
single page, simply use the newpage command.

Adding a picture
Most documents will also need some kind of picture. Like this:

Adding them is fairly easy:
\begin{figure}
\includegraphics[width=\textwidth]{picture.png}
\caption{This figure shows the logo of my website.}
\end{figure}

You have to embed the picture within the figure environment, then use the includegraphics command to select the
image. Note that the picture file has to be in the same directory as your .tex file or you specify the path like this:
...
\includegraphics[width=\textwidth]{FOLDERNAME/picture.png}
...

It makes sense to manage all your pictures in subfolders if you have many of them.

Sourcecode formatting
Throughout the book I used the listings package to format the LaTeX code snippets. You can specify the language
for each lstlistings block, in this case i used LaTeX of course and added a caption as well as enabled line breaking:
\begin{lstlisting}[language={[LaTeX]TeX},caption=Adding pictures in \LaTeX{}.,breaklines=true,frame=
...
\end{lstlisting}
This website makes use of cookies to enhance browsing experience and provide additional functionality. Details

https://www.latex-tutorial.com/quick-start/

3/5

2017/11/20

LaTeX introduction / Quick-start guide

The language is specified as [DIALECT]LANGUAGE, here LaTeX is dialect of TeX. A list of all programming
languages can be obtained from the listings package manual, but you can also just try out if it works.

References and Bibliography
You can specify labels for all the things that are automatically numbered. If you want to refer to a section of your
document, you'd simply use the label and ref (reference) command. Where the label indicates what you want to
refer to and the reference will print the actual number of the element in your document.
\section{}\label{sec:YOURLABEL}
...
I've written text in section \ref{sec:YOURLABEL}.

Papers usually include a lot of references to the great works of other people. In order to properly cite them, we'd
want to use the biblatex package. For this purpose we'd simply add the following code to our preamble:
\usepackage[backend=bibtex,style=verbose-trad2]{biblatex} % Use biblatex package
\bibliography{FILENAME} % The name of the .bib file (name without .bib)

All bibliographic information will be stored in the bibliography (.bib) and must not be inside of the .tex file An
example could look like this:
@ARTICLE=
{
VELLAGE:1,
AUTHOR="Claudio Vellage",
TITLE="A quick start to \LaTeX{}",
YEAR="2013",
PUBLISHER="",
}

Now i could add a self reference using the cite command:
This feature works as I described in \cite{VELLAGE:1}.

The biblatex is very smart and will print autogenerate the bibliography if we want to. We'd usually do this in the end
of the document. Simply add
\printbibliography

to our document. More examples can be found in lesson 7 (/tutorials/bibtex/).

The end.

Top ↑ Oct. 7, 2017
design and content © 2017 Claudio Vellage (https://www.claudiovellage.com)

This website makes use of cookies to enhance browsing experience and provide additional functionality. Details

https://www.latex-tutorial.com/quick-start/

4/5

2017/11/20

https://www.latex-tutorial.com/quick-start/

LaTeX introduction / Quick-start guide

5/5



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Page Count                      : 5
Has XFA                         : No
Creator                         : Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Producer                        : Skia/PDF m62
Create Date                     : 2017:11:20 02:28:59+00:00
Modify Date                     : 2017:11:20 13:12:07+08:00
EXIF Metadata provided by EXIF.tools

Navigation menu