LaTeX Lecture
LaTeX Lecture
Research Methodology
Mattias Nilsson
17 November
1 Introduction
2 Software
3 Getting started
4 Some basics
5 Mathematics
6 Tables
7 Pictures
8 References
9 Cross-reference
10 Error-handling
11 Help
The file where you are writing your document in should be named *.tex.
The document should have the following structure:
\documentclass[a4paper]{article}
%Load packages
\usepackage[T1]{fontenc}
\usepackage[swedish,english]{babel}
\usepackage[latin1]{inputenc}
\begin{document}
A short example of how to structure your document.
\end{document}
Some signs are reserved by LATEX. All of them are presented in the table
below
Here is an example of how to create a front page with title, date and
author:
\title{Name of the report}
\author{Student1 \and Student2}
\date{\today}
\maketitle
August 9, 2010
If you want to make your text bold, use the command \textbf{}
If you want to make your text italic, use the command \textit{}
If you want to underline your text, use the command \underline{}
Centered text
If you use the environment gather then will every row be centered.
\begin{gather}
x^2 = 4 \\
\sin^2 (x) + \cos^2(x) = 1
\end{gather}
x2 = 4 (5)
2 2
sin (x) + cos (x) = 1 (6)
gives
1 + cos 2x
= cos2 x.
2
To get parenthesis in the correct size, use \left and \right. Compare
√ √
x x
( ) with .
2 2
When you write mathematics note that the sentences has to be complete.
Formulas and symbols have to be a part of a sentence.
We will talk more about this later.
The code
\begin{tabular}{|c|cr|}
\hline
AB & CD & DE \\
\hline
12 & 34 & 56 \\
45 & 24 & 61 \\
\hline
\end{tabular}
a2 + b 2 = c 2 . (7)
We all know the meaning of equation (7).
Sometimes when you compile, you will note that the code does not work.
Then you have to search for errors.
Some common errors are
Misspelling
Forgot a right parenthesis.
Using wrong commands in wrong environment. For example
\frac{}{} when you write text.
Forgot to close an environment.