The Document Preparation System Called LATEX · LATEX is a document markup language and document...

23
The Document Preparation System Called L A T E X The Document Preparation System Called L A T E X Joel Reyes Noche [email protected] University Research Council Ateneo de Naga University October 22, 2010 1/23

Transcript of The Document Preparation System Called LATEX · LATEX is a document markup language and document...

Page 1: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

The Document Preparation System Called LATEX

Joel Reyes Noche

[email protected]

University Research CouncilAteneo de Naga University

October 22, 2010

1/23

Page 2: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Outline

Creating Documents Using LATEXA Brief IntroductionModesEnvironmentsDocument Classes and Sectioning

Creating Presentations Using the slides and beamer Classesslidesbeamer

Using Packages Such as GraphTEX and Software Such as BibTEXGraphTEXBibTEX

2/23

Page 3: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

A Brief Introduction

A Brief Introduction

TEX is a typesetting system designed and mostly written by DonaldKnuth starting in the late 1970s.

LATEX is a document markup language and document preparationsystem for the TEX typesetting program originally written in theearly 1980s by Leslie Lamport. It essentially comprises a collectionof TEX macros and a program to process LATEX documents.

MiKTEX is an implementation of TEX and related programs forMicrosoft Windows.

TEXnicCenter is an integrated environment for creating LATEXdocuments on the Windows platform.

TEX, LATEX, MiKTEX, and TEXnicCenter are free software.

3/23

Page 4: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

A Brief Introduction

An Example of TEX Code

The equation $ax^2+bx+c=0$ has the solutions$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$.\bye

4/23

Page 5: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

A Brief Introduction

An Example of LATEX Code

\documentclass{article}

\title{The Quadratic Formula}

\author{Joel Reyes Noche}

\date{}

\begin{document}

\maketitle

The equation $ax^2+bx+c=0$ has the solutions $x=\frac{-b\pm\sqrt{b^2-4ac

}}{2a}$.

\end{document}

5/23

Page 6: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Modes

Paragraph ModeSpecial Characters

\# \$ \% \& \verb|~| \_ \verb|^| $\backslash$ \{ \}

All the text between a % symbol and the end of the line is ignored.

% accented charactersPaul Erd\H{o}s, Gib\’{o}n, Pe\~{n}afrancia, na\"{i}ve

6/23

Page 7: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Modes

Paragraph ModeFonts

{\em Emphasized} {\sl Slanted} {\it Italics}{\bf Bold} {\sc Small Caps} \underline{Underlined}

{\tt Typewriter} {\sf Sans Serif} {\rm Roman}

{\tiny Size} {\scriptsize Size} {\footnotesize Size}{\small Size} {\normalsize Size} {\large Size}{\Large Size} {\LARGE Size} {\huge Size} {\Huge Size}

7/23

Page 8: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Modes

Math ModeMathematical expressions in text

\begin{math}a_0=\frac{1}{2\pi}\int_{-\pi}^\pi f(t)dt\end{math}

\(c_{ij}=\sum_{i=1}^k a_{il}b_{lj}\)

$b^{\log_b x}=x$

8/23

Page 9: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Modes

Math ModeMathematical expressions separate from text

\begin{displaymath}a_0=\frac{1}{2\pi}\int_{-\pi}^\pi f(t)dt\end{displaymath}

\[c_{ij}=\sum_{i=1}^k a_{il}b_{lj}\]

9/23

Page 10: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Modes

Math ModeNumbered mathematical expressions separate from text

\begin{equation}

f(x)=\left\{\begin{array}{ll}1, & x>0\\0, & x<0\end{array}\right.

\end{equation}

\begin{eqnarray}

ax+b & = & c\\ax & = & c-b\\x & = & c-b\over a

\end{eqnarray}

10/23

Page 11: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Modes

Left-to-Right Mode

$\overbrace{\alpha\ldots\omega}^{\mbox{Greek}}\underbrace{a\ldots z}_{\mbox{English}}$

11/23

Page 12: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Environments

Listsitemize, enumerate, description

\begin{itemize}

\item filled dot

\item[$\circ$] empty dot

\end{itemize}

\begin{enumerate}

\item first level, first item

\begin{enumerate}

\item second level, first item

\end{enumerate}

\item first level, second item

\end{enumerate}

\begin{description}

\item[one] a single unit or thing

\item[two] one more than one

\end{description}

12/23

Page 13: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Environments

Alignmentflushleft, flushright, center

\begin{flushleft}

This is text that is flush left.

\end{flushleft}

\begin{flushright}

This is text that is flush right.

\end{flushright}

\begin{center}

This is text that is centered.

\end{center}

13/23

Page 14: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Environments

tabular

\begin{tabular}{|l|c|c|}\cline{2-3}

\multicolumn{1}{c}{} & \multicolumn{2}{|c|}{Exam 1}\\\hline

Section & $\overline{x}$ & $s_x$\\\hline\hline

A & 60.0 & 10.0\\\hline

B & 70.0 & 8.0\\\hline

\end{tabular}

14/23

Page 15: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Environments

Exercise

\documentclass{article}\begin{document}

\end{document}

Complete the LATEX code above to create the object below.

15/23

Page 16: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Environments

picture

\setlength{\unitlength}{1mm}

\begin{picture}(45,24)

\put(16.5,1){\line(1,6){3}}

\put(25.5,1){\line(-1,6){3}}

\put(21,20.5){\circle{4.2}}

\put(13.5,0){\framebox(15,1)}

\put(0,8){\framebox(12,1)}

\put(0,8.8){\line(1,2){6}}

\put(6,20.8){\line(1,-2){6}}

\put(30,8){\framebox(12,1)}

\put(30,8.8){\line(1,2){6}}

\put(36,20.8){\line(1,-2){6}}

\put(4,9){\framebox(4,5){$Y$}}

\put(34,9){\framebox(4,5){$Z$}}

\put(6,20.75){\line(1,0){30}}

\put(6,20.25){\line(0,1){0.5}}

\put(6,20.25){\line(1,0){30}}

\put(36,20.75){\line(0,-1){0.5}}

\end{picture}

16/23

Page 17: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Document Classes and Sectioning

Document Classes

\documentclass[options]{class}

Examples of document classes

I articleI reportI letterI bookI slides

Examples of options

I 10pt, 11pt, 12ptI a4paper, a5paper, b5paper, letterpaper, legalpaper, executivepaperI landscapeI onecolumn, twocolumn

17/23

Page 18: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Documents Using LATEX

Document Classes and Sectioning

Sectioning

\section[optional alternate title]{numbered title}

\section*{unnumbered title}

Sectioning units

I part

I chapter

I section

I subsection

I subsubsection

I paragraph

I subparagraph

18/23

Page 19: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Presentations Using the slides and beamer Classes

slides

An Example of LATEX Code Using the slides Class

\documentclass{slides}\title{A Sample Presentation}\author{Joel Reyes Noche}\date{October 22, 2010}\begin{document}\maketitle\begin{slide}Some text\end{slide}\end{document}

19/23

Page 20: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Creating Presentations Using the slides and beamer Classes

beamer

An Example of LATEX Code Using the beamer Class

\documentclass{beamer}\begin{document}\title{A Sample Presentation}\author{Joel Reyes Noche}\institute{Ateneo de Naga University}\date{October 22, 2010}\frame{\titlepage}\begin{frame}\frametitle{Frame Title}\framesubtitle{Frame Subtitle}Some text%Remove the percent symbol at the start of the next line%\end{frame}\end{document}

20/23

Page 21: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Using Packages Such as GraphTEX and Software Such as BibTEX

GraphTEX

\usepackage{graphtex}

\pic

\xunit=3mm \yunit=3mm

\VertexRadius 7mm

\Vertex (5,5) (5,15) (15,5) (15,15)

\Arc (5,5) (15,15) (15,5) (5,15) (5,15)

(5,5) (15,5) (15,15) (15,15) (5,15)

\Align[c] ($r_0$) (2.5,10) \Align[c] ($r_c$) (6,10)

\Align[c] ($r_1$) (14,10) \Align[c] ($r_c$) (17.5,10)

\Align[c] ($r_1$) (10,17.5) \Align[c] ($r_0$) (10,14)

\Align[c] ($r_1$) (8.5,7) \Align[c] ($r_0$) (11.5,7)

\Align[c] ($q_{r_c,\mathtt{0}}/\mathtt{0}$) (5,5)

\Align[c] ($q_{r_c,\mathtt{1}}/\mathtt{1}$) (15,5)

\Align[c] ($q_{r_0,\mathtt{0}}/\mathtt{0}$) (5,15)

\Align[c] ($q_{r_1,\mathtt{1}}/\mathtt{1}$) (15,15)

\Align[c] ($r_c$) (2.1,2.1) \Align[c] ($r_c$) (17.9,2.1)

\Align[c] ($r_1$) (17.9,17.9) \Align[c] ($r_0$) (2.1,17.9)

\VertexRadius 1.5mm

\PutDLoop[225] (3.6,3.6) \PutDLoop[135] (3.6,16.4)

\PutDLoop[45] (16.4,16.4) \PutDLoop[315] (16.4,3.6)

\Arc (3.6,6.4) (3.6,13.6) \Arc (16.4,13.6) (16.4,6.4)

\Arc (6.4,16.4) (13.6,16.4)

\cip

21/23

Page 22: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Using Packages Such as GraphTEX and Software Such as BibTEX

BibTEX

BibTEXjoel.bib

@article{Noc08,

author={J. Noche},

title={Generalized Choral Sequences},

journal={Matimy\’as Matematika},

year=2008,

volume=31,

number={1--3},

pages={25--28}

}

@inproceedings{Noc09,

author={J. Noche},

title={Systematic Errors in Arithmetic of Some College Students},

year=2009,

pages={37--44},

booktitle={Proceedings of the 2009 Bicol Mathematics Conference}

}

22/23

Page 23: The Document Preparation System Called LATEX · LATEX is a document markup language and document preparation system for the TEX typesetting program originally written in the early

The Document Preparation System Called LATEX

Using Packages Such as GraphTEX and Software Such as BibTEX

BibTEX

BibTEXjoel.tex

Noche has worked on combinatorics on words \cite{Noc08} and on systematic errors in arithmetic

\cite{Noc09}.

\bibliographystyle{alpha}

\bibliography{joel}

23/23