Title: Quick LaTeX Tutorial
1Quick LaTeX Tutorial
2LaTeX Tutorial
- Why do you want to learn LaTeX?
- Nuts and Bolts of LaTex
- Examples
3Why you want to learn LaTeX
- Very powerful control of document generation,
particularly large technical documents - Minimizes the drudgery of formatting, numbering,
and referencing - Disadvantage
- Steep Learning Curve
4LaTeX Platforms
- Scientific Workplace
- (Commercial Package)
- UNIX Systems (LyX)
- (Free)
- MikTex and WinEdt
- PC Shareware
5LaTeX Resources
- http//www.ctan.org
- http//www.colorado.edu/ITS/docs/latex/Ref/
- The Not So Short Introduction to LaTeX 2e (Tobias
Oetiker) - Math Into LaTeX (George Gratzer)
6The 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
7Flow of LaTeX Process
8Source code of your first LaTeX
document(fish.tex)
- \documentclassarticle
- \begindocument
- My mother is a fish.
- \enddocument
9Commands to Build and View Document
- To use xdvi viewer
- latex fish.tex
-
- xdvi fish.dvi
- To use acroread
- pdflatex fish.tex
-
- acroread fish.pdf
10(No Transcript)
11Emphasizing words(fish.tex)
- \documentclassarticle
- \begindocument
- \emphMy mother is a fish.
- \enddocument
12(No Transcript)
13Underlining words(fish.tex)
- \documentclassarticle
- \begindocument
- \emphMy mother is a
- \underlinefish.
- \enddocument
14(No Transcript)
15Making references in LaTeX(fish.tex)
- \documentclassarticle
- \begindocument
- \emphMy mother is a \underlinefish \citeWF.
- \beginthebibliography99
- \bibitemWF
- William Falkner, \emphAs I Lay Dying
- \endthebibliography
- \enddocument
16Need to compile the document twice
- Because we are using symbolic references, e.g.,
\citeWF, a second pass is necessary - The second pass will resolve references
17(No Transcript)
18Sum Equation Example(sum.tex)
- \documentclassarticle
- \begindocument
- \beginequation \labelEsum
- s \sum_i1nx_i
- \endequation
- \enddocument
19(No Transcript)
20Sum of Squares Equation Example (sum_squares.tex)
- \documentclassarticle
- \begindocument
- \beginequation
- \labelEsum_squares
- s2 \sum_i1nx_i2
- \endequation
- \enddocument
21(No Transcript)
22Mean Equation Example(mean.tex)
- \documentclassarticle
- \begindocument
- \beginequation \labelEmean
- \barx \frac\sum_i1nx_i n
- \endequation
- \enddocument
23(No Transcript)
24Mean Equation Examplewith limits
(mean_limits.tex)
- \documentclassarticle
- \begindocument
- \beginequation \labelEmean
- \barx \frac\sum\limits_i1n x_i n
- \endequation
- \enddocument
25(No Transcript)
26Variance Equation Example (variance.tex)
- \documentclassarticle
- \begindocument
- \beginequation \labelEvariance
- \sigma2 \frac\sum\limits_i1n
- \left(x_i - \barx\right)2
- n-1
- \endequation
- \enddocument
27(No Transcript)
28Standard Deviation Equation Example (sd.tex)
- \documentclassreport
- \begindocument
- \chapterStandard Deviation
- \beginequation \labelEsd
- \sigma \sqrt\frac\sum\limits_i1n
- \left(x_i - \barx\right)2
- n-1
- \endequation
- \enddocument
29(No Transcript)
30Changing the document styles
- \documentclassarticle
- \documentclassbook
- \documentclassletter
- \documentclassreport
31Report document style(main.tex)
- \documentclassreport
- \titleAssignment 2 for SIMG726
- \authorRolando V. Raque\no
- \begindocument
- \maketitle
- \tableofcontents
- \enddocument
32(No Transcript)
33Create the following chapters
- chapter_sum.tex
- chapter_mean.tex
- chapter_sd.tex
34chapter_mean.tex
- \chapterMean \labelCMean
- \beginequation \labelEmean
- \barx \frac\sum_i1nx_i n
- \endequation
35chapter_sum.tex
- \chapterSum \labelCSum
- \beginequation \labelEsum
- s \sum_i1nx_i
- \endequation
36chapter_sd.tex
- \chapterStandard Deviation \labelCSD
- \beginequation \labelEsd
- \sigma \sqrt\frac\sum\limits_i1n
- \left(x_i - \barx\right)2
- n-1
- \endequation
37Modify main.tex to include chapters
- \documentclassreport
- \titleAssignment 2 for SIMG726
- \authorRolando V. Raque\no
- \begindocument
- \maketitle
- \tableofcontents
- \includechapter_sum
- \includechapter_mean
- \includechapter_sd
- \enddocument
38(No Transcript)
39Modify chapter_sd.tex
- \chapterStandard Deviation \labelCSD
-
- \endequation
- We can see that equation \refEsd uses equation
- \refEmean to compute the mean and that the
\emphMean - function uses equation \refEsum both of which
are defined - in Chapter \refCSum and \refCMean,
respectively
40(No Transcript)
41Modify main.tex to include chapters
- \documentclassreport
- \titleAssignment 2 for SIMG726
- \authorRolando V. Raque\no
- \begindocument
- \maketitle
- \tableofcontents
- \includechapter_mean
- \includechapter_sum
- \includechapter_sd
- \enddocument
42(No Transcript)
43Including 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 - \usepackagegraphics
- N.B. In CIS systems, following example works for
latex but not for pdflatex
44Image Graphics Example(image.tex)
- \documentclassarticle
- \usepackagegraphics
- \begindocument
- \beginfigure
- \includegraphicsMyCat.ps
- \captionThis is My Cat \labelFMyCat
- \endfigure
- \enddocument