21
LaTex By Wen Ying Gao

LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Embed Size (px)

Citation preview

Page 1: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

LaTex

By Wen Ying Gao

Page 2: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

What is LaTeX?

LaTeX is a typesetting system with the features that enhance the formatting of the documents.

It is efficient for using on publication of books or articles.

It can save user’s time by automatically formatting the sections, equations, and pictures of the documents.

Page 3: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Example of LaTeX:

Here is a sample of LaTeX syntax:\documentclass{article}\ttfamily\title{Wonderful Town}\author{Wendy Gao}\date{February 2006}\begin{document} \maketitle \itshape There is a \bfseries{Wonderful Town} \

mdseries{located at the end of the country. This town full of happy people….}

\end{document}

Page 4: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Sample of PDF formatted of the article:

Page 5: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Syntax of the LaTeX

Using LaTeX to produce a document:\documentclass\begin{document} (The text is typed here)

…\end{document}

LaTeX will automatically indent and put in paragraph for the text by simply double line the text. For no indent paragraph, we can use the \noindent control sequence at the beginning of the paragraph.

Page 6: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Example for creating paragraphs in LaTeX:

\documentclass{article}\begin{document}During the 1960s, many large software development efforts

encountered severe difficulties. Software schedules were typically late, costs greatly exceeded budgets and the finished products were unreliable.

\vspace{10 mm}\noindentPeople began to realize that software development was a far

more complex activity than they had imagined.\end{document}

Page 7: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Result:

Page 8: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

LaTeX for Simple Document

By using LaTeX, all the document formats are typed within the text.

LaTeX using control sequences, which consist of a backslash follow by a string of letters, to indicate the format of the text.

Page 9: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Text Format Control Sequences

To change the font of the text, we can use the control sequences to edit particular word or a group of words.

Control Sequences Text Format

\textrm Roman font

\textsf Sans serif font

\texttt Typewriter font

\textup Upright shape

\textit Italic shape

\textsl Slanted shape

\textsc Small caps shape

\textmd Medium font

\textbf Bold face

\emph Emphasized

Page 10: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Example:

\documentclass{article}\begin{document}\textrm{PERL How To Program}

\texttt{by Deitel, Nieto, and McPhie}

\textsl{1.8 Object-Oriented Programming}

\textsc{\textbf{One} of the key problems with procedural programming is that the program units programmers create do not easily mirror \emph{real-world} entities effectively.}

\end{document}

Page 11: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Result:

Page 12: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Mathematical Formulae Control Sequences

To indicate the mathematical formulae in the text, LaTeX provides many control sequences to organize the mathematical formulae and print its mathematical symbols.

Page 13: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Display Mathematical Formulae in LaTeX

There are four ways that LaTeX will display the mathematical formulae:Use ‘$’ at the beginning and ending of the formula to indicate the formula within the document.Use ‘\(‘ at the beginning of the formula and ‘\)’ at the end of the formula to indicate the formula within the document.Use ‘\[‘ at the beginning of the formula and ‘\]’ at the end of the formula. This will display the formula on a line by itself.Use \begin{equation} at the beginning of the formula and \end{equation} at the end of the formula will display the formula on a line by itself.

Page 14: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Example

The following LaTeX will display the definition of sample mean:\documentclass{book}\begin{document}\noindentDefinition:

\noindentThe \textbf{sample mean} $\bar{x}$ of observations $x_1$,$x_2$,...,$x_n$ is given by \[\bar{x} = \frac{x_1 + x_2 + ... + x_n}{n} = \frac{\sum_{i=1}^n x_i}{n}\]

\noindentThe numerator of $\bar{x}$ can be written more informally as $\sum x_i$, where the

summation is over all sample observations.\end{document}

Page 15: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Result

Page 16: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Mathematical Symbol in LaTeX

Many of the mathematical symbol are indicated by a backslash that follow by the name of the symbol.

For example:Mathematical Symbol LaTeX Syntax \cong \Pi \supseteq

Page 17: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Mathematical Operation in LaTeX

The mathematical operation such as addition and subtraction will be using the keyboard symbol ‘+’ and ‘-’. However, the operation for multiplication, division, fraction, and square root will need to apply other LaTeX control sequences.

Operations LaTeX control sequences

Multiplication () \times

Division () \div

Fraction \frac{numerator}{denominator}

Square Root \sqrt{expression}

Page 18: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Example

This example prints the definition of variance and standard deviation.

\documentclass{article}\begin{document}\noindentThe \textbf{variance} of a continuous random variable $X$ with

pdf $f(x)$ and mean value $\mu$ is \[\sigma_X^2 = V(X) = \int_{-\infty}^\infty (x - \mu)^2 \bullet

f(x)dx = E[(X - \mu)^2]\]The \textbf{standard deviation} (SD) of $X$ is $\sigma_X = \

sqrt{V(X)}$.\end{document}

Page 19: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Result

Page 20: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Conclusion

There are a lot of features in the LaTeX that are not able to demonstrate all at one time. However, there are many tutorials on the web which contain the usage and syntax of LaTeX. The preferable LaTeX tutorial websites from my research are in the reference page.

Also, LaTeX is a free system that we can download it from the site, which is in the reference page.

Page 21: LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance the formatting of the documents. It is efficient for

Reference

Obtaining LaTeX. 16 Jan. 2006. 31 Jan. 2006 <http://www.latex-project.org/ftp.html>

Wilkins, David R. Getting Started with LaTeX. 9 March 1998. School of Mathematics. 2 Feb. 2006 <http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/>