what is latex?€¦ · what is latex? latex is a document preparation system by leslie lamport...

63
What is L A T E X? Dan Yasaki UNC Greensboro June 4, 2018 REU at Elon University Dan Yasaki What is L A T E X? 1 / 22

Upload: others

Post on 13-Jul-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

What is LATEX?

Dan Yasaki

UNC Greensboro

June 4, 2018REU at Elon University

Dan Yasaki What is LATEX? 1 / 22

Page 2: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

What is LATEX?

LATEX is a document preparation system by Leslie Lamport builtupon Donald Knuth’s TEX formatting engine. It is widely used inacademia to produce documents of high typographical quality.

Figure: Knuth (left) and Lamport (right).

Dan Yasaki What is LATEX? 2 / 22

Page 3: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Some Advantages

LATEX follows the design philosophy of separatingpresentation from content.High quality typesetting.Convenient formatting of mathematical formulae.Complex structures (footnotes, references, table ofcontents, links, etc) can be generated easily.Encourages structured writing.Highly portable and free.

Dan Yasaki What is LATEX? 3 / 22

Page 4: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Some Disadvantages?

LATEX follows the design philosophy of separatingpresentation from content.It is very hard to write unstructured and disorganizeddocuments.Changes to document layout are tricky.Syntax errors.

Dan Yasaki What is LATEX? 4 / 22

Page 5: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Basic Workflow

Plain text file foo.tex to foo.pdf

Edit LATEX

Dan Yasaki What is LATEX? 5 / 22

Page 6: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Advanced Workflow

Edit

LATEX

BibTEX

make-index

LATEX

Dan Yasaki What is LATEX? 6 / 22

Page 7: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Resources

Getting started with TeX, LaTeX, and friends from the TeXUsers Group(http://www.tug.org/begin.html)LaTeX project site(https://www.latex-project.org)This workshop page(https://www.uncg.edu/mat/faculty/d_yasaki/teaching/latex/)

Dan Yasaki What is LATEX? 7 / 22

Page 8: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Get to Work

hello-world.texnonsense.texworkshop-article.texworkshop-slides.tex (if time permits)

Dan Yasaki What is LATEX? 8 / 22

Page 9: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

hello-world.tex

\documentclass{amsart}% This is a comment\begin{document}Hello world.\end{document}

Dan Yasaki What is LATEX? 9 / 22

Page 10: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

hello-world.tex

\documentclass{amsart}% This is a comment\begin{document}Hello world.\end{document}

Dan Yasaki What is LATEX? 9 / 22

Page 11: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

hello-world.tex

\documentclass{amsart}% This is a comment\begin{document}Hello world.\end{document}

Dan Yasaki What is LATEX? 9 / 22

Page 12: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

hello-world.tex

\documentclass{amsart}% This is a comment\begin{document}Hello world.\end{document}

Dan Yasaki What is LATEX? 9 / 22

Page 13: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

nonsense.tex

\documentclass{amsart}\usepackage{lipsum}\begin{document}\title{Some Nonsense}\author{Dan Yasaki}\begin{abstract}\lipsum[1]\end{abstract}\maketitle\section{Introduction}\lipsum\end{document}

Dan Yasaki What is LATEX? 10 / 22

Page 14: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

nonsense.tex

\documentclass{amsart}\usepackage{lipsum}\begin{document}\title{Some Nonsense}\author{Dan Yasaki}\begin{abstract}\lipsum[1]\end{abstract}\maketitle\section{Introduction}\lipsum\end{document}

Dan Yasaki What is LATEX? 10 / 22

Page 15: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

nonsense.tex

\documentclass{amsart}\usepackage{lipsum}\begin{document}\title{Some Nonsense}\author{Dan Yasaki}\begin{abstract}\lipsum[1]\end{abstract}\maketitle\section{Introduction}\lipsum\end{document}

Dan Yasaki What is LATEX? 10 / 22

Page 16: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

nonsense.tex

\documentclass{amsart}\usepackage{lipsum}\begin{document}\title{Some Nonsense}\author{Dan Yasaki}\begin{abstract}\lipsum[1]\end{abstract}\maketitle\section{Introduction}\lipsum\end{document}

Dan Yasaki What is LATEX? 10 / 22

Page 17: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

nonsense.tex

\documentclass{amsart}\usepackage{lipsum}\begin{document}\title{Some Nonsense}\author{Dan Yasaki}\begin{abstract}\lipsum[1]\end{abstract}\maketitle\section{Introduction}\lipsum\end{document}

Dan Yasaki What is LATEX? 10 / 22

Page 18: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

nonsense.tex

\documentclass{amsart}\usepackage{lipsum}\begin{document}\title{Some Nonsense}\author{Dan Yasaki}\begin{abstract}\lipsum[1]\end{abstract}\maketitle\section{Introduction}\lipsum\end{document}

Dan Yasaki What is LATEX? 10 / 22

Page 19: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

nonsense.tex

\documentclass{amsart}\usepackage{lipsum}\begin{document}\title{Some Nonsense}\author{Dan Yasaki}\begin{abstract}\lipsum[1]\end{abstract}\maketitle\section{Introduction}\lipsum\end{document}

Dan Yasaki What is LATEX? 10 / 22

Page 20: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

minimal.tex

Go to

https://www.uncg.edu/mat/faculty/d_yasaki/teaching/latex/

and download minimal.tex. Rename itworkshop-article.tex and move to a workshop folder.

Dan Yasaki What is LATEX? 11 / 22

Page 21: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Inline versus displayed

Use $ around inline math and \[. . .\] around displayed math.

$1 + 2 = 2$ versus \[1 + 2 = 2.\]

The number of nonisomorphic Galois 2-adic fields with Galoisgroup G is

1#Aut(G)

∑H≤G

µG(H)α(H).

The number of nonisomorphic Galois $2$-adicfields with Galois group $G$ is\[\frac{1}{\#\Aut(G)}\sum_{H \leq G}

\mu_G(H)\alpha(H).\]

Dan Yasaki What is LATEX? 12 / 22

Page 22: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Inline versus displayed

Use $ around inline math and \[. . .\] around displayed math.

$1 + 2 = 2$ versus \[1 + 2 = 2.\]

The number of nonisomorphic Galois 2-adic fields with Galoisgroup G is

1#Aut(G)

∑H≤G

µG(H)α(H).

The number of nonisomorphic Galois $2$-adicfields with Galois group $G$ is\[\frac{1}{\#\Aut(G)}\sum_{H \leq G}

\mu_G(H)\alpha(H).\]

Dan Yasaki What is LATEX? 12 / 22

Page 23: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Inline versus displayed

Use $ around inline math and \[. . .\] around displayed math.

$1 + 2 = 2$ versus \[1 + 2 = 2.\]

The number of nonisomorphic Galois 2-adic fields with Galoisgroup G is

1#Aut(G)

∑H≤G

µG(H)α(H).

The number of nonisomorphic Galois $2$-adicfields with Galois group $G$ is\[\frac{1}{\#\Aut(G)}\sum_{H \leq G}

\mu_G(H)\alpha(H).\]

Dan Yasaki What is LATEX? 12 / 22

Page 24: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Inline versus displayed

Use $ around inline math and \[. . .\] around displayed math.

$1 + 2 = 2$ versus \[1 + 2 = 2.\]

The number of nonisomorphic Galois 2-adic fields with Galoisgroup G is

1#Aut(G)

∑H≤G

µG(H)α(H).

The number of nonisomorphic Galois $2$-adicfields with Galois group $G$ is\[\frac{1}{\#\Aut(G)}\sum_{H \leq G}

\mu_G(H)\alpha(H).\]

Dan Yasaki What is LATEX? 12 / 22

Page 25: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

A Syntax Error

Figure: xkcd: Wisdom of the Ancients (https://xkcd.com/979/).All long help threads should have a sticky globally-editable post at thetop saying ’DEAR PEOPLE FROM THE FUTURE: Here’s what we’vefigured out so far . . . ’

Dan Yasaki What is LATEX? 13 / 22

Page 26: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

newcommand and DeclareMathOperator

You can define your own functions. Add these lines to yourpreamble.

\newcommand{\RR}{\mathbb{R}}\newcommand{\QQ}{\mathbb{Q}}\DeclareMathOperator{\Aut}{Aut}

Dan Yasaki What is LATEX? 14 / 22

Page 27: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

newcommand and DeclareMathOperator

You can define your own functions. Add these lines to yourpreamble.

\newcommand{\RR}{\mathbb{R}}\newcommand{\QQ}{\mathbb{Q}}\DeclareMathOperator{\Aut}{Aut}

Dan Yasaki What is LATEX? 14 / 22

Page 28: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

newcommand and DeclareMathOperator

You can define your own functions. Add these lines to yourpreamble.

\newcommand{\RR}{\mathbb{R}}\newcommand{\QQ}{\mathbb{Q}}\DeclareMathOperator{\Aut}{Aut}

Dan Yasaki What is LATEX? 14 / 22

Page 29: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 30: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 31: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 32: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 33: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 34: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 35: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 36: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 37: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 38: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Labels and references

Label and reference. Compile at least twice.

\begin{theorem}\label{thm:bob}Let $a$, $b$, and $c$ blah.\end{theorem}

An equation we want to reference:

\begin{equation}\label{eq:fancy}\sum_{k = 1}^{\infty} k = -\frac{1}{12}.\end{equation}

Theorem~\ref{thm:bob} and\eqref{eq:fancy} blah.

Dan Yasaki What is LATEX? 15 / 22

Page 39: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Citations

Go to MathSciNet:

http://www.ams.org/mathscinet/

Retrieve BibTEX reference. Save to references.bib.At end:

\bibliographystyle{amsalpha}\bibliography{references}

In text:

\cite{foo} or \cite[Theorem 1.2]{foo}

LATEX, BibTEX, LATEX, LATEX.

Dan Yasaki What is LATEX? 16 / 22

Page 40: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Citations

Go to MathSciNet:

http://www.ams.org/mathscinet/

Retrieve BibTEX reference. Save to references.bib.At end:

\bibliographystyle{amsalpha}\bibliography{references}

In text:

\cite{foo} or \cite[Theorem 1.2]{foo}

LATEX, BibTEX, LATEX, LATEX.

Dan Yasaki What is LATEX? 16 / 22

Page 41: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Citations

Go to MathSciNet:

http://www.ams.org/mathscinet/

Retrieve BibTEX reference. Save to references.bib.At end:

\bibliographystyle{amsalpha}\bibliography{references}

In text:

\cite{foo} or \cite[Theorem 1.2]{foo}

LATEX, BibTEX, LATEX, LATEX.

Dan Yasaki What is LATEX? 16 / 22

Page 42: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Citations

Go to MathSciNet:

http://www.ams.org/mathscinet/

Retrieve BibTEX reference. Save to references.bib.At end:

\bibliographystyle{amsalpha}\bibliography{references}

In text:

\cite{foo} or \cite[Theorem 1.2]{foo}

LATEX, BibTEX, LATEX, LATEX.

Dan Yasaki What is LATEX? 16 / 22

Page 43: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

align and friends

a = 1 + 3 (1)c = 4 (2)

\begin{align}a &= 1 + 3 \label{eq:eve1} \\c &= 4 \label{eq:eve2}\end{align}

Use align* for no equation numbers.

a = 1 + 3c = 4

Dan Yasaki What is LATEX? 17 / 22

Page 44: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

align and friends

a = 1 + 3 (1)c = 4 (2)

\begin{align}a &= 1 + 3 \label{eq:eve1} \\c &= 4 \label{eq:eve2}\end{align}

Use align* for no equation numbers.

a = 1 + 3c = 4

Dan Yasaki What is LATEX? 17 / 22

Page 45: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

align and friends

a = 1 + 3 (1)c = 4 (2)

\begin{align}a &= 1 + 3 \label{eq:eve1} \\c &= 4 \label{eq:eve2}\end{align}

Use align* for no equation numbers.

a = 1 + 3c = 4

Dan Yasaki What is LATEX? 17 / 22

Page 46: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

align and friends

a = 1 + 3 (1)c = 4 (2)

\begin{align}a &= 1 + 3 \label{eq:eve1} \\c &= 4 \label{eq:eve2}\end{align}

Use align* for no equation numbers.

a = 1 + 3c = 4

Dan Yasaki What is LATEX? 17 / 22

Page 47: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Figures

In your preamble:

\usepackage{graphicx} %for including pictures

Figure captions go below. The [width = 0.5\textwidth]is optional.

\begin{figure}\includegraphics[width=0.5\textwidth]{me.jpg}\caption{Caption goes here.}\label{fig:selfie}\end{figure}

Dan Yasaki What is LATEX? 18 / 22

Page 48: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Figures

In your preamble:

\usepackage{graphicx} %for including pictures

Figure captions go below. The [width = 0.5\textwidth]is optional.

\begin{figure}\includegraphics[width=0.5\textwidth]{me.jpg}\caption{Caption goes here.}\label{fig:selfie}\end{figure}

Dan Yasaki What is LATEX? 18 / 22

Page 49: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Figures

In your preamble:

\usepackage{graphicx} %for including pictures

Figure captions go below. The [width = 0.5\textwidth]is optional.

\begin{figure}\includegraphics[width=0.5\textwidth]{me.jpg}\caption{Caption goes here.}\label{fig:selfie}\end{figure}

Dan Yasaki What is LATEX? 18 / 22

Page 50: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Figures

In your preamble:

\usepackage{graphicx} %for including pictures

Figure captions go below. The [width = 0.5\textwidth]is optional.

\begin{figure}\includegraphics[width=0.5\textwidth]{me.jpg}\caption{Caption goes here.}\label{fig:selfie}\end{figure}

Dan Yasaki What is LATEX? 18 / 22

Page 51: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Figures

In your preamble:

\usepackage{graphicx} %for including pictures

Figure captions go below. The [width = 0.5\textwidth]is optional.

\begin{figure}\includegraphics[width=0.5\textwidth]{me.jpg}\caption{Caption goes here.}\label{fig:selfie}\end{figure}

Dan Yasaki What is LATEX? 18 / 22

Page 52: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Figures

In your preamble:

\usepackage{graphicx} %for including pictures

Figure captions go below. The [width = 0.5\textwidth]is optional.

\begin{figure}\includegraphics[width=0.5\textwidth]{me.jpg}\caption{Caption goes here.}\label{fig:selfie}\end{figure}

Dan Yasaki What is LATEX? 18 / 22

Page 53: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Tables using tabular

You can create tables with tabular and array. The caption isbefore the table. The label comes after the caption.In preamble:

\usepackage{booktabs} %for good looking tables.

\begin{table}\caption{Caption goes here.}\label{tab:han}\begin{tabular}{clr}\toprulecentered & left & right\\\midrulealice & bob & eve\\$x$ & $y$ & $z$\\\bottomrule\end{tabular}\end{table}

Dan Yasaki What is LATEX? 19 / 22

Page 54: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Tables using tabular

You can create tables with tabular and array. The caption isbefore the table. The label comes after the caption.In preamble:

\usepackage{booktabs} %for good looking tables.

\begin{table}\caption{Caption goes here.}\label{tab:han}\begin{tabular}{clr}\toprulecentered & left & right\\\midrulealice & bob & eve\\$x$ & $y$ & $z$\\\bottomrule\end{tabular}\end{table}

Dan Yasaki What is LATEX? 19 / 22

Page 55: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Tables using tabular

You can create tables with tabular and array. The caption isbefore the table. The label comes after the caption.In preamble:

\usepackage{booktabs} %for good looking tables.

\begin{table}\caption{Caption goes here.}\label{tab:han}\begin{tabular}{clr}\toprulecentered & left & right\\\midrulealice & bob & eve\\$x$ & $y$ & $z$\\\bottomrule\end{tabular}\end{table}

Dan Yasaki What is LATEX? 19 / 22

Page 56: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Tables using tabular

You can create tables with tabular and array. The caption isbefore the table. The label comes after the caption.In preamble:

\usepackage{booktabs} %for good looking tables.

\begin{table}\caption{Caption goes here.}\label{tab:han}\begin{tabular}{clr}\toprulecentered & left & right\\\midrulealice & bob & eve\\$x$ & $y$ & $z$\\\bottomrule\end{tabular}\end{table}

Dan Yasaki What is LATEX? 19 / 22

Page 57: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Tables using tabular

You can create tables with tabular and array. The caption isbefore the table. The label comes after the caption.In preamble:

\usepackage{booktabs} %for good looking tables.

\begin{table}\caption{Caption goes here.}\label{tab:han}\begin{tabular}{clr}\toprulecentered & left & right\\\midrulealice & bob & eve\\$x$ & $y$ & $z$\\\bottomrule\end{tabular}\end{table}

Dan Yasaki What is LATEX? 19 / 22

Page 58: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Tables using tabular

You can create tables with tabular and array. The caption isbefore the table. The label comes after the caption.In preamble:

\usepackage{booktabs} %for good looking tables.

\begin{table}\caption{Caption goes here.}\label{tab:han}\begin{tabular}{clr}\toprulecentered & left & right\\\midrulealice & bob & eve\\$x$ & $y$ & $z$\\\bottomrule\end{tabular}\end{table}

Dan Yasaki What is LATEX? 19 / 22

Page 59: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Tables using tabular

You can create tables with tabular and array. The caption isbefore the table. The label comes after the caption.In preamble:

\usepackage{booktabs} %for good looking tables.

\begin{table}\caption{Caption goes here.}\label{tab:han}\begin{tabular}{clr}\toprulecentered & left & right\\\midrulealice & bob & eve\\$x$ & $y$ & $z$\\\bottomrule\end{tabular}\end{table}

Dan Yasaki What is LATEX? 19 / 22

Page 60: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Tables using array

\begin{table}\caption{Caption goes here.}\label{tab:obiwan}$\begin{array}{clr}\toprule\text{centered} & \text{left} & \text{right}\\\midrule\text{alice} & \text{bob} & \text{eve}\\x & y & z\\\bottomrule\end{array}$\end{table}

Dan Yasaki What is LATEX? 20 / 22

Page 61: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Tables using array

\begin{table}\caption{Caption goes here.}\label{tab:obiwan}$\begin{array}{clr}\toprule\text{centered} & \text{left} & \text{right}\\\midrule\text{alice} & \text{bob} & \text{eve}\\x & y & z\\\bottomrule\end{array}$\end{table}

Dan Yasaki What is LATEX? 20 / 22

Page 62: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Beamer

Go to:

https://www.uncg.edu/mat/faculty/d_yasaki/teaching/latex/

and download sample-slides.tex. Rename itworkshop-slides.tex and move to workshop folder.We will edit that file together.

Dan Yasaki What is LATEX? 21 / 22

Page 63: What is LaTeX?€¦ · What is LATEX? LATEX is a document preparation system by Leslie Lamport built upon Donald Knuth’s TEX formatting engine. It is widely used in academia to

Thank you.

Dan Yasaki What is LATEX? 22 / 22