Quick LaTeX Tutorial

1 / 44

# Quick LaTeX Tutorial - PowerPoint PPT Presentation

Quick LaTeX Tutorial. LaTeX Tutorial. Why do you want to learn LaTeX? Nuts and Bolts of LaTex Examples. Why you want to learn LaTeX. Very powerful control of document generation, particularly large technical documents Minimizes the drudgery of formatting, numbering, and referencing

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Quick LaTeX Tutorial' - holt

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Quick LaTeX Tutorial

LaTeX Tutorial
• Why do you want to learn LaTeX?
• Nuts and Bolts of LaTex
• Examples
Why you want to learn LaTeX
• Very powerful control of document generation, particularly large technical documents
• Minimizes the drudgery of formatting, numbering, and referencing
• Steep Learning Curve
LaTeX Platforms
• Scientific Workplace
• (Commercial Package)
• UNIX Systems (LyX)
• (Free)
• MikTex and WinEdt
• PC Shareware
LaTeX Resources
• http://www.ctan.org
• The Not So Short Introduction to LaTeX 2e (Tobias Oetiker)
• Math Into LaTeX (George Gratzer)
The LaTeX Process
• Create a text file (with your favorite text editor) with LaTeX commands
• “Compile” or “Build” your document using the LaTeX program
• Display resulting Document
• Continue writing and go to 1 until finished
• Convert Document to Postscript or PDF
Source code of your first LaTeX document(fish.tex)

\documentclass{article}

\begin{document}

My mother is a fish.

\end{document}

To use xdvi viewer

% latex fish.tex

% xdvi fish.dvi

% pdflatex fish.tex

Commands to Build and View Document
Emphasizing words(fish.tex)

\documentclass{article}

\begin{document}

\emph{My mother} is a fish.

\end{document}

Underlining words(fish.tex)

\documentclass{article}

\begin{document}

\emph{My mother} is a

\underline{fish}.

\end{document}

Making references in LaTeX(fish.tex)

\documentclass{article}

\begin{document}

\emph{My mother} is a \underline{fish} \cite{WF}.

\begin{thebibliography}{99}

\bibitem{WF}

William Falkner, \emph{As I Lay Dying}

\end{thebibliography}

\end{document}

Need to compile the document twice
• Because we are using symbolic references, e.g., \cite{WF}, a second pass is necessary
• The second pass will resolve references
Sum Equation Example(sum.tex)

\documentclass{article}

\begin{document}

\label{E:sum}

s = \sum_{i=1}^{n}x_{i}

\end{document}

Sum of Squares Equation Example (sum_squares.tex)

\documentclass{article}

\begin{document}

\label{E:sum_squares}

s2 = \sum_{i=1}^{n}x_{i}^{2}

\end{document}

Mean Equation Example(mean.tex)

\documentclass{article}

\begin{document}

\label{E:mean}

\bar{x} = \frac{\sum_{i=1}^{n}x_{i}} {n}

\end{document}

Mean Equation Examplewith limits (mean_limits.tex)

\documentclass{article}

\begin{document}

\label{E:mean}

\bar{x} = \frac{\sum\limits_{i=1}^{n} x_{i}} {n}

\end{document}

Variance Equation Example (variance.tex)

\documentclass{article}

\begin{document}

\label{E:variance}

\sigma^{2} = \frac{\sum\limits_{i=1}^{n}

\left(x_{i} - \bar{x}\right)^{2}}

{n-1}

\end{document}

Standard Deviation Equation Example (sd.tex)

\documentclass{report}

\begin{document}

\chapter{Standard Deviation}

\label{E:sd}

\sigma = \sqrt{\frac{\sum\limits_{i=1}^{n}

\left(x_{i} - \bar{x}\right)^{2}}

{n-1}}

\end{document}

Changing the document styles

\documentclass{article}

\documentclass{book}

\documentclass{letter}

\documentclass{report}

Report document style(main.tex)

\documentclass{report}

\title{Assignment 2 for SIMG726}

\author{Rolando V. Raque\~no}

\begin{document}

\maketitle

\tableofcontents

\end{document}

Create the following chapters

chapter_sum.tex

chapter_mean.tex

chapter_sd.tex

chapter_mean.tex

\chapter{Mean} \label{C:Mean}

\label{E:mean}

\bar{x} = \frac{\sum_{i=1}^{n}x_{i}} {n}

chapter_sum.tex

\chapter{Sum} \label{C:Sum}

\label{E:sum}

s = \sum_{i=1}^{n}x_{i}

chapter_sd.tex

\chapter{Standard Deviation} \label{C:SD}

\label{E:sd}

\sigma = \sqrt{\frac{\sum\limits_{i=1}^{n}

\left(x_{i} - \bar{x}\right)^{2}}

{n-1}}

Modify main.tex to include chapters

\documentclass{report}

\title{Assignment 2 for SIMG726}

\author{Rolando V. Raque\~no}

\begin{document}

\maketitle

\tableofcontents

\include{chapter_sum}

\include{chapter_mean}

\include{chapter_sd}

\end{document}

Modify chapter_sd.tex

\chapter{Standard Deviation} \label{C:SD}

We can see that equation \ref{E:sd} uses equation

\ref{E:mean} to compute the mean and that the \emph{Mean}

function uses equation \ref{E:sum} both of which are defined

in Chapter \ref{C:Sum} and \ref{C:Mean}, respectively

Modify main.tex to include chapters

\documentclass{report}

\title{Assignment 2 for SIMG726}

\author{Rolando V. Raque\~no}

\begin{document}

\maketitle

\tableofcontents

\include{chapter_mean}

\include{chapter_sum}

\include{chapter_sd}

\end{document}

Including image graphics into you LaTeX document
• Need to convert your image graphics into EPS (encapsulated postscript).
• For images, use pnmtops, e.g.

% pnmtops MyCat.pgm > MyCat.ps

• Need to include an extension package to LaTeX called “graphics” using command

\usepackage{graphics}

• N.B. In CIS systems, following example works for latex but not for pdflatex
Image Graphics Example(image.tex)

\documentclass{article}

\usepackage{graphics}

\begin{document}

\begin{figure}

\includegraphics{MyCat.ps}

\caption{This is My Cat} \label{F:MyCat}

\end{figure}

\end{document}