an introduction to latex - colorado state universitybetten/talks/talk_latex_intro.pdf · an...

75
An Introduction to Latex Anton Betten Department of Mathematics Colorado State University August 2008

Upload: others

Post on 18-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

An Introduction to Latex

Anton Betten

Department of MathematicsColorado State University

August 2008

Page 2: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

What is Latex?

Latex is a text processing system for scientists.

It was started as Tex by Donald Knuth. Latex is a derivative ofTex produced by Leslie Lamport.

Why Latex?

It is very good for mathematical formulas, it supports citations,people can work together on one document by sharing piecesof it (this is impossible in Word, for instance).

As opposed to Word, say, we have to program the text in a newlanguage, the laguage is Latex.

We can use it for presentations (like this one!), for papers, fortheses etc. We can even write books.

Page 3: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Hello World

Here is a very simple example:

Suppose we wish to write a document that says ‘hello world’:

Page 4: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Hello World

Page 5: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Hello World

This is what we have to write:\documentclass[12pt]{article}

\begin{document}

hello world!

\end{document}

Page 6: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Hello World

We also have to “compile” the file.

This is done by using the pdflatex command (in an unixenvironment).

The pdflatex command applied to our input file <name>.texproduces a file <name>.pdf which can be viewed.

In Windows, there are latex environments where we simplypush buttons.

Page 7: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Hello World, biggerWe can make the text larger (and smaller)

\documentclass[12pt]{article}

\begin{document}

hello world!{\large hello world!}{\Large hello world!}{\LARGE hello world!}{\huge hello world!}{\Huge hello world!}{\small hello world!}{\scriptsize hello world!}{\tiny hello world!}

\end{document}

And we get:

Page 8: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Hello World

Page 9: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Hello World, again

Notice that the text does not come aligned in a column, as wemight have expected.

The formatting of our text does not imply anything about theformatting of the output.

We need to use a command to break a line. That command isthe double backslash.

Page 10: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Hello World, again

\documentclass[12pt]{article}

\begin{document}

hello world! \\{\large hello world!} \\{\Large hello world!}\\{\LARGE hello world!}\\{\huge hello world!}\\{\Huge hello world!}\\{\small hello world!} \\{\scriptsize hello world!} \\{\tiny hello world!} \\

\end{document}

And we get:

Page 11: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Hello World

Page 12: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

FormulaeLet’s try something fancy: formulae.

Here we go:

Page 13: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Formulae

We have typed:

\documentclass[12pt]{article}

\begin{document}

Today we will prove the important formula$$1+1=2$$(that is to say, unless thecharacteristic is 2, in which case$1+1=0$, but let«s omitthis case for now).

\end{document}

Page 14: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

FormulaeCompare:

\documentclass[12pt]{article}

\begin{document}

$$1+1=2$$

\[1+1=2\]

\begin{equation}1+1=2\end{equation}

\end{document}

Page 15: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Formulae

Page 16: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Formulae with Reference

The last form had one advantage: it gave a number to theequation.

The idea is to refer to previous equations as needed.

We use the label and commands as in the following example.

Note: We have to run latex twice on this file. This is to allowlatex to handle the references.

Page 17: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Formulae

Page 18: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Formulae with Reference

\documentclass[12pt]{article}\begin{document}Assume that\begin{equation}\label{assumption1}1+1=2\end{equation}and that\begin{equation}\label{assumption2}2+1=3\end{equation}Then using (\ref{assumption1})and (\ref{assumption2})it follows that\begin{equation}1+1+1=(1+1)+1=2+1=3.\end{equation}\end{document}

Page 19: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Page-Numbering

In fact, the output shown was not the whole truth.

In all cases, there was an additional page number at thebottom.

Like this (can you see the little one down at the bottom of thepage?):

Page 20: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University
Page 21: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Page-NumberingSince page numbers make no sense on single pagedocuments, let’s get rid of them altogether, using the pagestylecommand.

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}Assume that\begin{equation}\label{assumption1}1+1=2\end{equation}and that\begin{equation}\label{assumption2}2+1=3\end{equation}Then using (\ref{assumption1})and (\ref{assumption2})it follows that\begin{equation}1+1+1=(1+1)+1=2+1=3.\end{equation}\end{document}

Page 22: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Formulae

Page 23: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

The Preamble

Notice the unusual place for putting the pagestyle command:before the “begin document”.

This is called the preamble.

Other stuff that could go in there is the title and author of thedocument, using title and author commands.

We will also use the date command. The date command usedwith today fills in the current date.

Here we go...

Page 24: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University
Page 25: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

The Preamble

\documentclass[12pt]{article}\pagestyle{empty}\title{My great thesis}\author{Myself}\date{\today}\begin{document}\maketitleIn this thesis, we will prove theimportant theorem ....\end{document}

Page 26: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

The Documentclass

So far, we have used the documentclass article.

This is for articles that are submitted.

An article also has an abstract.

An article can have several sections, using the sectioncommand.

Page 27: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University
Page 28: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

The Documentclass

\documentclass[12pt]{article}\pagestyle{empty}\title{My great thesis}\author{Myself}\date{\today}\begin{document}\maketitle\begin{abstract}In this paper, we will prove that ...\end{abstract}\section{Introduction}A group is affine if its socle iselementary abelian.

\section{Acknowledgement}The author thanks ...

\end{document}

Page 29: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

More Math

Lets do greek:

Page 30: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

More Math

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}$$\alpha,\beta,\gamma,\delta,\epsilon,\zeta,\eta,\theta,\iota,\kappa,\lambda,\mu,\nu,\xi,\pi,\rho,\sigma,\tau,\upsilon,\phi,\chi,\psi,\omega$$and$$\varepsilon,\vartheta,\varsigma,\varphi,\varrho,\varpi$$and capitals$$\Gamma, \Delta, \Theta, \Lambda, \Xi, \Pi,\Sigma, \Upsilon, \Phi, \Psi$$\end{document}

Page 31: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

More Math

Lets do symbols:

Page 32: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

More Math

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}symbols:$$\pm,\mp,\times,\cap,\cup,\vee,\wedge,\setminus,\wr,\diamond,\ast,\div,\star,\circ,\bullet,\cdot,\ldots,\cdots,\oplus,\ominus,\otimes,\oslash,\odot,$$relational symbols:$$\le,\ge,\equiv,\models,\prec,\succ,\sim,\simeq,\prec,\preceq,\succeq,\mid,\ll,\gg,\parallel,\subset,\supset,\subseteq,\supseteq,\cong,\approx,=,\neq,\in,\ni,\vdash,\dashv,<,>$$\end{document}

Page 33: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices

Lets do a matrix:

Page 34: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices\documentclass[12pt]{article}\pagestyle{empty}\begin{document}Lets make a matrix:

$$\begin{array}{cc}a & b \\c & d\\\end{array}$$

\end{document}

OK, one by one: the cc tells him that there are two columns,both centered(left-aligned would be l, right-aligned would be r).The entries are separated by a &, lines are terminated by adouble backslash.

Page 35: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices

If we want to make it look like a matrix, we need to putparenthesis around, like this:

Page 36: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}Lets make a matrix:$$\left(\begin{array}{cc}a & b \\c & d\\\end{array}\right)$$

\end{document}

Page 37: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices

The left - right commands must always be matched.

If you don’t want the matching one, put an empty match like“right.”

The benefit of the left..right commands is that they adjust thesize of the parenthesis to the object which is in-between.

There are several versions (the “\;” is for adding space)

Page 38: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices

Page 39: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices\documentclass[12pt]{article}\pagestyle{empty}\begin{document}$$\left|\begin{array}{cc}a & b \\c & d\\\end{array}\right|,\;\left[\begin{array}{cc}a & b \\c & d\\\end{array}\right],\;\left(\begin{array}{cc}a & b \\c & d\\\end{array}\right)$$\end{document}

Page 40: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices

Lets make a big and fancy matrix (this one is from my ownthesis).

Page 41: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices\documentclass[12pt]{article}\pagestyle{empty}\begin{document}The Stirling numbers of the second kind are\[\begin{array}{r|*{7}{r}|r}& \multicolumn{7}{l}{S_2(n,r), r=} \\n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & B(n) \\\hline0 & 1& 0& 0& 0& 0& 0& 0& 1\\1 & 0& 1& 0& 0& 0& 0& 0& 1\\2 & 0& 1& 1& 0& 0& 0& 0& 2\\3 & 0& 1& 3& 1& 0& 0& 0& 5\\4 & 0& 1& 7& 6& 1& 0& 0& 15 \\5 & 0& 1& 15& 25& 10& 1& 0& 52 \\6 & 0& 1& 31& 90& 65& 15& 1& 203 \\\end{array}\]The last column are the Bell numbers.

\end{document}

Page 42: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices

Sometimes people make fancy tables by using double bars likethis:

Page 43: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Matrices

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}$$\begin{array}{|c||c|c|c|}\hline+ & 0 & 1 & 2 \\\hline\hline0 & 0 & 1 & 2\\\hline1 & 1 & 2 & 0\\\hline2 & 2 & 0 & 1\\\hline\end{array}$$Did you notice, this was a group table...\end{document}

Page 44: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Tables

Strictly speaking, everything so far was an array and not a table.

The difference is that an array is within math-mode.

A table can be done using the tabular command.

Page 45: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Tables

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}Our current sale prices after discountare as follows:\\\begin{tabular}{c|c|c}Price & Discount & Sales price \\\hline100 & 10\% & 90\\200 & 5\% & 190\\\end{tabular}\end{document}

Page 46: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Tables

To make this more fancy, you should put it centered using thebegin center command

You did not need to do that in math-mode.

Page 47: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Tables

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}Our current sale prices after discountare as follows:\begin{center}\begin{tabular}{c|c|c}Price & Discount & Sales price \\\hline100 & 10\% & 90\\200 & 5\% & 190\\\end{tabular}\end{center}\end{document}

Page 48: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Lists

Often one needs lists.

There are essentially two kinds: bulleted items or numbereditems.

They are made using the itemize and enumerate commands

The items are indicated using the item command.

Page 49: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Lists

Page 50: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Lists

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}\begin{itemize}\itembullet item no 1\itembullet item no 2\itembullet item no 3\end{itemize}\begin{enumerate}\itemitem no 1\itemitem no 2\itemitem no 3\end{enumerate}\end{document}

Page 51: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Lists

Lists can be nested:

Page 52: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Lists

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}\begin{enumerate}\item item no 1\begin{enumerate}\item subitem no a\item subitem no b\item\begin{enumerate}\item subsubitem no a\item subsubitem no b\item subsubitem no c\end{enumerate}\end{enumerate}\item item no 2\item item no 3\end{enumerate}\end{document}

Page 53: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

The AMS-Package

The AMS provides an add-on package that can be used tomake more fancy formulas.

We need to load the two packages in the preamble.

Now, equations can be stacked and aligned:

Page 54: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

More Math

\documentclass[12pt]{article}\usepackage{amsmath}\usepackage{amssymb}\pagestyle{empty}\begin{document}\begin{align*}\sum_{j=i}^m \binom{j}{i} \alpha_j&= \binom{m}{i} \lambda_i \\\Rightarrow \quad\alpha_t&=\binom{m}{t} \lambda_t -\sum_{h=0}^{m-t-1} \binom{t+h-t}{h}\binom{t+h+1}{t} \alpha_{t+h+1},\end{align*}\end{document}

Page 55: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Floating Objects

In real typesetting, tables and figures are not placed where theyare used.

They are moved to the top or bottom of the page (or a nearbypage, when space is tight).

Float objects exist in latex, too. We use table for floating tablesand figure for figures.

Page 56: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University
Page 57: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Floating Objects

\documentclass[12pt]{article}\pagestyle{empty}\begin{document}Allright, lets see an example. InTab.~\ref{tableC3}, we display theCayley table of the group $C_3$.\begin{table}$$\begin{array}{|c||c|c|c|}\hline+ & 0 & 1 & 2 \\\hline\hline0 & 0 & 1 & 2\\\hline1 & 1 & 2 & 0\\\hline2 & 2 & 0 & 1\\\hline\end{array}$$\caption{\label{tableC3}TheGroup Table of $C_3$}\end{table}\end{document}

Page 58: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Including Pictures

Here is how we include pictures using the figure environment.

Page 59: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University
Page 60: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Including PicturesThe following commands need a file entropy.png in the currentdirectory:

\documentclass[12pt]{article}\usepackage{graphicx}\pagestyle{empty}\begin{document}The entropy is defined as$$H(x) = -x \log(x) - (1-x) \log(1-x) ,\quad 0 \le x \le 1.$$Fig.~\ref{entropy} shows a plot of the function.\begin{figure}\begin{center}\includegraphics[width=70mm]{entropy}\end{center}\caption{\label{entropy}The Entropyfunction $H(x)$}\end{figure}\end{document}

Page 61: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Making New Commands

In a recent paper, I had to typeset a nasty matrix:

Page 62: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Making New Commands

Typing all matrix entries into an array would likely have lead todesaster.

The trick was to use newcommand to have each matrix entrydefined separately.

newcommand defines a new latex command that can be usedanywhere in the document.

For instance, it can be used to make a matrix entry.

Here we go

Page 63: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Making New Commands

\documentclass[12pt]{article}\pagestyle{empty}\newcommand{\rraa}{d^{2q+2}}\newcommand{\rrab}{c^{q+1}d^{q+1}}\newcommand{\rrac}{c^{2q+2}}\newcommand{\rrad}{c^qd^{q+2}}...\begin{document}$$\left(\begin{array}{c|c|c|c|c}\rraa &\rrab &\rrac &\rrad &\rrae \\ \hline\rrba &\rrbb &\rrbc &\rrbd &\rrbe \\ \hline\rrca &\rrcb &\rrcc &\rrcd &\rrce \\ \hline\rrda &\rrdb &\rrdc &\rrdd &\rrde \\ \hline\rrea &\rreb &\rrec &\rred &\rree \\\end{array}\right)$$\end{document}

Page 64: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Graphics

Sometimes, we do fun stuff.

The following Domino Portrait is taken from the 2007dissertation of Bader Al-Shamarey

Title of the dissertation: Two Topics in CombinatorialOptimization.

In a Domino Portrait, we approximate an image using a fixednumber of complete sets of Dominoes (here, double-9)

Page 65: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University
Page 66: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Graphics

This graphics was produced in the Metapost language.

The Metapost input file was generated by Bader’s computerprogram.

Metapost is a language for graphics. Documentation can befound on the Web.

Page 67: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Metapost

Consider an example for a Metapost graphics:

This graphic was created using the following piece of Metapostcode:

Page 68: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

input boxes

verbatimtex\documentclass[10pt]{article}\begin{document}etex;u=0.100000mm;beginfig(1);path p[];draw (0u,150u)--(250u,0u);draw (156u,93u)--(31u,18u) dashed evenlyscaled 0.5;path pp;pp = (67u,37u) .. (62u,42u) .. (57u,37u) ..(62u,32u) .. (67u,37u) .. cycle;fill pp withcolor 1 white;path pp;pp = (67u,37u) .. (62u,42u) .. (57u,37u) ..(62u,32u) .. (67u,37u) .. cycle;draw pp;path pp;pp = (130u,75u) .. (125u,80u) .. (120u,75u) ..(125u,70u) .. (130u,75u) .. cycle;fill pp withcolor 1 white;path pp;pp = (130u,75u) .. (125u,80u) .. (120u,75u) ..(125u,70u) .. (130u,75u) .. cycle;draw pp;endfig;

end

Page 69: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Making Presentations with Latex / Beamer

This presentation is made using the Beamer package of Latex.

Page 70: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

\documentclass{beamer}\mode<presentation>{\usetheme{Singapore}\setbeamercovered{transparent}}\title{An Introduction to Latex}\author{Anton~Betten}\institute[Colorado State University]{Department of Mathematics\\Colorado State University}\date[GTA training]{August 2008}\setbeamertemplate{blocks}[rounded][shadow=true]\begin{document}\begin{frame}\titlepage

\end{frame}\begin{frame}\frametitle{What is Latex?}\framesubtitle{What is Latex, really?}

This is a presentation made using the\alert{beamer} package and Latex.\end{frame}\end{document}

Page 71: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Making Presentations with Latex / BeamerOne more slide:

Page 72: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

\documentclass{beamer}\mode<presentation>{\usetheme{Singapore}\setbeamercovered{transparent}}\title{An Introduction to Latex}\author{Anton~Betten}\institute[Colorado State University]{Department of Mathematics\\Colorado State University}\date[GTA training]{August 2008}\setbeamertemplate{blocks}[rounded][shadow=true]\newcommand{\PG}{{\rm PG}}\newcommand{\PGL}{{\rm PGL}}\newcommand{\PGammaL}{{\rm P}\Gamma{\rm L}}\begin{document}

\begin{frame}\frametitle{The Fundamental Theoremof Projective Geometry}Together they generate the\alert{semilinear group}$$\PGammaL(n+1,q) =\PGL(n+1,q) \ltimes \langle \phi \rangle.$$\bigskip\bigskip\bigskip\begin{block}{THEOREM (well known)}For $n \ge 2,$ the automorphism groupof $\PG(n,q)$ is $\PGammaL(n+1,q).$\end{block}\end{frame}\end{document}

Page 73: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Making A Web-Site Using Latex

Latex can be used to make a web-site, too.

For this, you can use the (unix) program tth (tex-to-html)

Simply create your future web-site using Latex, and thentranslate it into html format using tth.

In my case, my homepage is defined in the file index.tex

I convert it using the command

tth -e2 index.tex

The -e2 is so that the picture is embedded into the web site.

Page 74: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

Making A Web-Site Using Latex

...

Page 75: An Introduction to Latex - Colorado State Universitybetten/talks/talk_latex_intro.pdf · An Introduction to Latex Anton Betten Department of Mathematics Colorado State University

\documentclass[12pt]{article}\begin{document}\parindent 0pt\section*{Anton Betten}\begin{tabular}{*{4}{c}}\includegraphics*[width=50mm]{anton_ow.eps} & & &

\begin{tabular}{l}Dr. Anton Betten\\Department of Mathematics\\Colorado State University\\Fort Collins, CO 80523\\USA.\\phone: (970) 491 1865\\fax: (970) 491 2161\\betten at math dot colostate dot edu\\\end{tabular}\\

\end{tabular}\section*{Welcome and Brief Bio}Bla,bla...\section*{Teaching\label{teaching}}In Fall 2008, I am teachingMATH501 Combinatorics I,%%tth: \begin{html} <a href="http://www.math.colo

state.edu/~betten/courses/MATH501/FA08/501_syllabus.html"> MATH501 Combinatorics I </a> \end{html}

\end{document}