Sei sulla pagina 1di 21

Introduction

Basics of LATEX
Summary
References

Introduction to LATEX

Adarsh J

Department of Computer Science


IIT Kanpur

2nd March 2013

Adarsh J Introduction to LATEX


Introduction
Basics of LATEX
Summary
References

Outline

1 Introduction
What is LATEX?
Why use LATEX?

2 Basics of LATEX
Understanding Document Structure
Text Formatting
Lists and Tables
Images and Equations
Footnote, Citation and References

Adarsh J Introduction to LATEX


Introduction
Basics of LATEX What is LATEX?
Summary Why use LATEX?
References

Outline

1 Introduction
What is LATEX?
Why use LATEX?

2 Basics of LATEX
Understanding Document Structure
Text Formatting
Lists and Tables
Images and Equations
Footnote, Citation and References

Adarsh J Introduction to LATEX


Introduction
Basics of LATEX What is LATEX?
Summary Why use LATEX?
References

LATEX A typesetting tool

A macro collection package on top of TEX A tool by


Donald Knuth.
Originally Put together by Leslie Lamport.
A tool built over 30 years ago.

Adarsh J Introduction to LATEX


Introduction
Basics of LATEX What is LATEX?
Summary Why use LATEX?
References

Outline

1 Introduction
What is LATEX?
Why use LATEX?

2 Basics of LATEX
Understanding Document Structure
Text Formatting
Lists and Tables
Images and Equations
Footnote, Citation and References

Adarsh J Introduction to LATEX


Introduction
Basics of LATEX What is LATEX?
Summary Why use LATEX?
References

Why use LATEX?

Primarily because of following reasons:


Produces stunningly beautiful documents!
Uses plaintext format for creating documents.
Keeps content and presentation separate.
Provides logical structure for documents.

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Outline

1 Introduction
What is LATEX?
Why use LATEX?

2 Basics of LATEX
Understanding Document Structure
Text Formatting
Lists and Tables
Images and Equations
Footnote, Citation and References

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Understanding Document Structure

\documentclass{...}
\usepackage{...}
\title{...}
\author{...}

\begin{document}
\tableofcontents
\listoffigures
\listoftables
...
\end{document}

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Outline

1 Introduction
What is LATEX?
Why use LATEX?

2 Basics of LATEX
Understanding Document Structure
Text Formatting
Lists and Tables
Images and Equations
Footnote, Citation and References

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Styling the text

\textit{} Italics Text


\textbf{} Boldface Text
\texttt{} Typewriter Text
\underline{} Underlined Text

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Outline

1 Introduction
What is LATEX?
Why use LATEX?

2 Basics of LATEX
Understanding Document Structure
Text Formatting
Lists and Tables
Images and Equations
Footnote, Citation and References

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Various Listing Environments

itemize for bulleted listing


enumerate for numbered listing
Example:

\begin{enumerate}
\item The first item
\item The second item
\item The third\ldots
\end{enumerate}

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Creating Tables via Tabular


Example:
\begin{table}
\begin{tabular}{ l | c | r }
\hline
1 & 2 & 3 \\ \hline
4 & 5 & 6 \\ \hline
7 & 8 & 9 \\
\hline
\end{tabular}
\end{table}

1 2 3
4 5 6
7 8 9
Adarsh J Introduction to LATEX
Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Outline

1 Introduction
What is LATEX?
Why use LATEX?

2 Basics of LATEX
Understanding Document Structure
Text Formatting
Lists and Tables
Images and Equations
Footnote, Citation and References

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Including Graphics

Make sure to include graphicx package

\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{image}
\caption{Description of the image}
\label{img:image}
\end{figure}

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Writing Equations

Make sure to include amsmath package


$\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x$
R
0 ex dx
${n! \over k!(n-k)!} = {n \choose k}$

n! n

k !(nk )! = k

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

More Examples of equations

\begin{equation}
A_{m,n} =
\begin{pmatrix}
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m,1} & a_{m,2} & \cdots & a_{m,n}
\end{pmatrix}
\end{equation}

a1,1 a1,2 a1,n
a2,1 a2,2 a2,n
Am,n = . (1)

.. .. ..
.. . . .
am,1 am,2 am,n
Adarsh J Introduction to LATEX
Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Outline

1 Introduction
What is LATEX?
Why use LATEX?

2 Basics of LATEX
Understanding Document Structure
Text Formatting
Lists and Tables
Images and Equations
Footnote, Citation and References

Adarsh J Introduction to LATEX


Understanding Document Structure
Introduction
Text Formatting
Basics of LATEX
Lists and Tables
Summary
Images and Equations
References
Footnote, Citation and References

Cross referencing and Citations

Referencing Individual table/figure/section. ex.


Figure~\ref{img:image} says so.
Footnote 1
\footnote{This shows how to use it}
Citation from Bibliography
\cite{citation01,citation02,citation03}

1
This shows how to use it
Adarsh J Introduction to LATEX
Introduction
Basics of LATEX
Summary
References

Summary

LATEX is a typesetting system used widely for publishing


structured documents.
Document and styling are separate, styling is inferred from
document structure.
Large documents should be spilt up into chapters for easy
handling.

Adarsh J Introduction to LATEX


Introduction
Basics of LATEX
Summary
References

References

The Not So Short Introduction to Latex2e by Tobias Oetiker


et al.
Latex Tutorials a Primer by Indian TeX Users Group

Adarsh J Introduction to LATEX

Potrebbero piacerti anche