LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance...

Click here to load reader

download 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

of 21

  • date post

    05-Jan-2016
  • Category

    Documents

  • view

    215
  • download

    0

Embed Size (px)

Transcript of LaTex By Wen Ying Gao. What is LaTeX? LaTeX is a typesetting system with the features that enhance...

  • LaTexBy 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 using on publication of books or articles.It can save users time by automatically formatting the sections, equations, and pictures of the documents.

  • 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}

  • Sample of PDF formatted of the article:

  • Syntax of the LaTeXUsing 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.

  • 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}

  • Result:

  • LaTeX for Simple DocumentBy 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.

  • Text Format Control SequencesTo change the font of the text, we can use the control sequences to edit particular word or a group of words.

    Control SequencesText Format\textrmRoman font\textsfSans serif font\textttTypewriter font\textupUpright shape\textitItalic shape\textslSlanted shape\textscSmall caps shape\textmdMedium font\textbfBold face\emphEmphasized

  • 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}

  • Result:

  • Mathematical Formulae Control SequencesTo indicate the mathematical formulae in the text, LaTeX provides many control sequences to organize the mathematical formulae and print its mathematical symbols.

  • Display Mathematical Formulae in LaTeXThere 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.

  • ExampleThe 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}

  • Result

  • Mathematical Symbol in LaTeXMany of the mathematical symbol are indicated by a backslash that follow by the name of the symbol.For example:Mathematical SymbolLaTeX Syntax\cong\Pi \supseteq

  • Mathematical Operation in LaTeXThe 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.

    OperationsLaTeX control sequencesMultiplication ()\timesDivision ()\divFraction \frac{numerator}{denominator}Square Root \sqrt{expression}

  • ExampleThis 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}

  • Result

  • ConclusionThere 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.

  • ReferenceObtaining LaTeX. 16 Jan. 2006. 31 Jan. 2006 Wilkins, David R. Getting Started with LaTeX. 9 March 1998. School of Mathematics. 2 Feb. 2006