Presentation is loading. Please wait.

Presentation is loading. Please wait.

Rolando V. RaqueñoMonday, June 15, 2015 1 Quick LaTeX Tutorial.

Similar presentations


Presentation on theme: "Rolando V. RaqueñoMonday, June 15, 2015 1 Quick LaTeX Tutorial."— Presentation transcript:

1 Rolando V. RaqueñoMonday, June 15, 2015 1 Quick LaTeX Tutorial

2 Rolando V. RaqueñoMonday, June 15, 2015 2 LaTeX Tutorial Why do you want to learn LaTeX? Nuts and Bolts of LaTex Examples

3 Rolando V. RaqueñoMonday, June 15, 2015 3 Why 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

4 Rolando V. RaqueñoMonday, June 15, 2015 4 LaTeX Platforms Scientific Workplace –(Commercial Package) UNIX Systems (LyX) –(Free) MikTex and WinEdt –PC Shareware

5 Rolando V. RaqueñoMonday, June 15, 2015 5 LaTeX Resources http://www.ctan.orgwww.ctan.org http://www.colorado.edu/ITS/docs/latex/ Ref/http://www.colorado.edu/ITS/docs/latex/ Ref/ The Not So Short Introduction to LaTeX 2e (Tobias Oetiker) Math Into LaTeX (George Gratzer)

6 Rolando V. RaqueñoMonday, June 15, 2015 6 The LaTeX Process 1.Create a text file (with your favorite text editor) with LaTeX commands 2.“Compile” or “Build” your document using the LaTeX program 3.Display resulting Document 4.Continue writing and go to 1 until finished 5.Convert Document to Postscript or PDF

7 Rolando V. RaqueñoMonday, June 15, 2015 7 Flow of LaTeX Process

8 Rolando V. RaqueñoMonday, June 15, 2015 8 Source code of your first LaTeX document (fish.tex) \documentclass{article} \begin{document} My mother is a fish. \end{document}

9 Rolando V. RaqueñoMonday, June 15, 2015 9 Commands 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 Rolando V. RaqueñoMonday, June 15, 2015 10

11 Rolando V. RaqueñoMonday, June 15, 2015 11 Emphasizing words (fish.tex) \documentclass{article} \begin{document} \emph{My mother} is a fish. \end{document}

12 Rolando V. RaqueñoMonday, June 15, 2015 12

13 Rolando V. RaqueñoMonday, June 15, 2015 13 Underlining words (fish.tex) \documentclass{article} \begin{document} \emph{My mother} is a \underline{fish}. \end{document}

14 Rolando V. RaqueñoMonday, June 15, 2015 14

15 Rolando V. RaqueñoMonday, June 15, 2015 15 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}

16 Rolando V. RaqueñoMonday, June 15, 2015 16 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

17 Rolando V. RaqueñoMonday, June 15, 2015 17

18 Rolando V. RaqueñoMonday, June 15, 2015 18 Sum Equation Example (sum.tex) \documentclass{article} \begin{document} \begin{equation} \label{E:sum} s = \sum_{i=1}^{n}x_{i} \end{equation} \end{document}

19 Rolando V. RaqueñoMonday, June 15, 2015 19

20 Rolando V. RaqueñoMonday, June 15, 2015 20 Sum of Squares Equation Example (sum_squares.tex) \documentclass{article} \begin{document} \begin{equation} \label{E:sum_squares} s2 = \sum_{i=1}^{n}x_{i}^{2} \end{equation} \end{document}

21 Rolando V. RaqueñoMonday, June 15, 2015 21

22 Rolando V. RaqueñoMonday, June 15, 2015 22 Mean Equation Example (mean.tex) \documentclass{article} \begin{document} \begin{equation} \label{E:mean} \bar{x} = \frac{\sum_{i=1}^{n}x_{i}} {n} \end{equation} \end{document}

23 Rolando V. RaqueñoMonday, June 15, 2015 23

24 Rolando V. RaqueñoMonday, June 15, 2015 24 Mean Equation Example with limits (mean_limits.tex) \documentclass{article} \begin{document} \begin{equation} \label{E:mean} \bar{x} = \frac{\sum\limits_{i=1}^{n} x_{i}} {n} \end{equation} \end{document}

25 Rolando V. RaqueñoMonday, June 15, 2015 25

26 Rolando V. RaqueñoMonday, June 15, 2015 26 Variance Equation Example (variance.tex) \documentclass{article} \begin{document} \begin{equation} \label{E:variance} \sigma^{2} = \frac{\sum\limits_{i=1}^{n} \left(x_{i} - \bar{x}\right)^{2}} {n-1} \end{equation} \end{document}

27 Rolando V. RaqueñoMonday, June 15, 2015 27

28 Rolando V. RaqueñoMonday, June 15, 2015 28 Standard Deviation Equation Example (sd.tex) \documentclass{report} \begin{document} \chapter{Standard Deviation} \begin{equation} \label{E:sd} \sigma = \sqrt{\frac{\sum\limits_{i=1}^{n} \left(x_{i} - \bar{x}\right)^{2}} {n-1}} \end{equation} \end{document}

29 Rolando V. RaqueñoMonday, June 15, 2015 29

30 Rolando V. RaqueñoMonday, June 15, 2015 30 Changing the document styles \documentclass{article} \documentclass{book} \documentclass{letter} \documentclass{report}

31 Rolando V. RaqueñoMonday, June 15, 2015 31 Report document style (main.tex) \documentclass{report} \title{Assignment 2 for SIMG726} \author{Rolando V. Raque\~no} \begin{document} \maketitle \tableofcontents \end{document}

32 Rolando V. RaqueñoMonday, June 15, 2015 32

33 Rolando V. RaqueñoMonday, June 15, 2015 33 Create the following chapters chapter_sum.tex chapter_mean.tex chapter_sd.tex

34 Rolando V. RaqueñoMonday, June 15, 2015 34 chapter_mean.tex \chapter{Mean} \label{C:Mean} \begin{equation} \label{E:mean} \bar{x} = \frac{\sum_{i=1}^{n}x_{i}} {n} \end{equation}

35 Rolando V. RaqueñoMonday, June 15, 2015 35 chapter_sum.tex \chapter{Sum} \label{C:Sum} \begin{equation} \label{E:sum} s = \sum_{i=1}^{n}x_{i} \end{equation}

36 Rolando V. RaqueñoMonday, June 15, 2015 36 chapter_sd.tex \chapter{Standard Deviation} \label{C:SD} \begin{equation} \label{E:sd} \sigma = \sqrt{\frac{\sum\limits_{i=1}^{n} \left(x_{i} - \bar{x}\right)^{2}} {n-1}} \end{equation}

37 Rolando V. RaqueñoMonday, June 15, 2015 37 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}

38 Rolando V. RaqueñoMonday, June 15, 2015 38

39 Rolando V. RaqueñoMonday, June 15, 2015 39 Modify chapter_sd.tex \chapter{Standard Deviation} \label{C:SD} … \end{equation} 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

40 Rolando V. RaqueñoMonday, June 15, 2015 40

41 Rolando V. RaqueñoMonday, June 15, 2015 41 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}

42 Rolando V. RaqueñoMonday, June 15, 2015 42

43 Rolando V. RaqueñoMonday, June 15, 2015 43 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

44 Rolando V. RaqueñoMonday, June 15, 2015 44 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}


Download ppt "Rolando V. RaqueñoMonday, June 15, 2015 1 Quick LaTeX Tutorial."

Similar presentations


Ads by Google