Professional Documents
Culture Documents
Latex Tutorial
Latex Tutorial
Contents
1 Lesson 1
1.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.1 Latex Commands For Beginners . . . . . . . . . . . . .
1.1.2 Commands For Numbering Format . . . . . . . . . . .
2
2
2
2
2 Lesson 2
2.1 Useful Commands for Hierarchy . . . . . . . . . . . . . . . . .
3
3
3 Lesson 3
3.1 Equations and Packages . . . . . . . . . . . . . . . . . . . . .
4
4
4 Lesson 4
4.1 Some
4.2 Some
4.2.1
4.2.2
4.2.3
4.2.4
.
.
.
.
.
.
5
5
5
5
5
6
7
5 Lesson 5
5.1 Adding Image in LaTex . . . . . . . . . . . . . . . . . . . . .
5.2 Commands Used for Figure . . . . . . . . . . . . . . . . . . .
5.3 Summary of Commands . . . . . . . . . . . . . . . . . . . . .
8
8
8
8
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
6 Lesson 6
10
6.1 Adding Table of Content . . . . . . . . . . . . . . . . . . . . . 10
6.2 Adding List of Figures and Tables . . . . . . . . . . . . . . . . 10
7 Lesson 7
7.1 Bibliography . . . . . . . . . . . .
7.2 Reference . . . . . . . . . . . . .
7.2.1 Entry Types . . . . . . . .
7.2.2 Sequence of Commands for
7.2.3 Summary of Commands .
.
.
.
.
.
11
11
11
11
12
12
8 Lesson 8
8.1 Tabular Environment . . . . . . . . . . . . . . . . . . . . . . .
8.2 Another Table . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.3 Summary of Table Commands . . . . . . . . . . . . . . . . . .
14
14
14
14
. . . . . . . .
. . . . . . . .
. . . . . . . .
Bibliography
. . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
List of Figures
1
List of Tables
1
2
3
Introduction
This is just a quick latex tutorial.
Summary of LaTeX Commands
Commands
Description
\documentclass{Option} Define Type of Document
\title{Document Name}
Name of Document
\maketitle
Title Page
\huge
Font size
\begin {center}
Formatting text to Center
Lesson 1
1.1
Preamble
The main command for selecting a particular type of numbering format is:
\pagenumbering{Option}
Options for pagenumbering Commands are:
1. gobble - no numbers
2. arabic - arabic numbers
3. roman - roman numbers
2
2.1
Lesson 2
Useful Commands for Hierarchy
3
3.1
Lesson 3
Equations and Packages
Lesson 4
4.1
LaTeX also uses inline command for equations and symbols by using $ sign
before and after math symbols.
Example This formula f (x) = x2 is an example.
4.2
F (x) =
b
1 3
x
3
1
G(x) =
x
4.2.3
Matrices
x
Note: Matrices only work within math environments, so use
\begin{align} command before defining matrix or using \frac{num}{den}
command otherwise LaTex compiler will give error.
4.2.4
Summary of Lesson 4
Lesson 5
5.1
LaTeX index all pictures automatically and tag them with successive numbers
when using the figure environment and the graphicx package.
5.2
Main command for adding figure is \begin{figure}[Options]. For Figure Environment, different options Include:
h (here) - same location
t (top) - top of page
b (bottom) - bottom of page
p (page) - on an extra page
! (override) - will force the specified location
The float package \usepackage{float} allows to set the option to [H],
which is even stricter than [h!].
5.3
Summary of Commands
6
6.1
Lesson 6
Adding Table of Content
6.2
Create lists of your figures and tables with \listoffigures and \listoftables.
Table 1: Caption for the table.
1 2 3
a b c
10
Lesson 7
7.1
Bibliography
A .bib file will contain the bibliographic information of our document. Use
any standard bibtex generator to create .bib file. Lets begin on how to add
a single book in the bibliography.
Use \cite {reference} command to cite the reference embedded in text.
Use \bibliography{filename} and \bibliographystyle{stylename} for selecting a particular style of reference
Example: Random Citation [1] embedded in text
7.2
Reference
Make a separate .bib file using the reference details such as author, title,
publisher and year of publishing.
The format of a typical .bib file is as follows:
Entry type{unique name of reference ,
AUTHOR = Author Name,
TITLE = Title of Book,
PUBLISHER = Name of Publisher,
YEAR = Year of Publishing,
}
Note: entry type tells BibTeX that the information stored here is about a
particular entry type.
7.2.1
Entry Types
Besides the entry types shown in the example (i.e book) there are a lot more
such as
article - Article from a magazine or journal
book - A published book
booklet - A work that is printed but have no publisher or sponsoring
institution.
conference - An article in a conference proceedings
11
For inserting bibliography using BibTex file, use the following sequence of
commands
PdfLaTeX
Bibtex
PdfLaTeX
PdfLaTeX
Pdf Viewer
7.2.3
Summary of Commands
13
Lesson 8
8.1
Tabular Environment
Table 2: Caption for the table.
1 2 3
a b c
8.2
Another Table
Table 3: Caption for the table.
Some
actual
content
prettifies
as
using
8.3
the
well
the
content
as
booktabs package
LaTeX offers the table and tabular environment for table creation
The table environment acts like a wrapper for the tabular similar to
the figure environment.
Alignment and vertical separators are passed as an argument to the
tabular environment (e.g. \begin{tabular}{l|c||r})
Its possible to align the content left (l), centered (c) and right (r),
where the number of alignment operators has to match the desired
number of columns
The columns can be separated by adding |in between the alignment
operators
Rows can be separated using the \hline command and columns using
the ampersand & symbol
The newline \\operator indicates the end of a row
Its possible to refer to tables using \ref and \label
14
References
[1] H. A. Mir, LaTex Tutorial. Hamza & Co., 2016.
15