SlideShare a Scribd company logo
1 of 84
Download to read offline
Advanced LaTeX
Aubry Verret

October 22, 2013
Macros

Definition

A shorthand command used to abbreviate another
command or series of commands.
A
Fact: LTEX is comprised of numerous macros built
on the TEX language.
How to write a Macro

Define a macro in the Preamble using:
newcommand{command name}{definition}
How to write a Macro

Define a macro in the Preamble using:
newcommand{command name}{definition}
Example:
newcommand{uva}{University of Virginia}
How to write a Macro

Define a macro in the Preamble using:
newcommand{command name}{definition}
Example:
newcommand{uva}{University of Virginia}
Whenever you want ”University of Virginia” to appear you use
the uva command.
Macros with Arguments
Specify the number of arguments in square braces:
newcommand{command name}[# args]{definition}
Refer to the arguments as #1, #2, #3, #4 etc. in the
definition.
Macros with Arguments
Specify the number of arguments in square braces:
newcommand{command name}[# args]{definition}
Refer to the arguments as #1, #2, #3, #4 etc. in the
definition.
Example:
newcommand{shout}[1]{{Huge{bf {#1}}}
Macros with Arguments
Specify the number of arguments in square braces:
newcommand{command name}[# args]{definition}
Refer to the arguments as #1, #2, #3, #4 etc. in the
definition.
Example:
newcommand{shout}[1]{{Huge{bf {#1}}}

Pay Attention!
Macros with Arguments
Specify the number of arguments in square braces:
newcommand{command name}[# args]{definition}
Refer to the arguments as #1, #2, #3, #4 etc. in the
definition.
Example:
newcommand{shout}[1]{{Huge{bf {#1}}}

Pay Attention!
shout{Pay Attention!}
Macros with Math
$$sum_{i=0}^n i^n$$
n

in
i=0

newcommand{sums}{$$sum {i=0}ˆn iˆn$$}
Macros with Math
$$sum_{i=0}^n i^n$$
n

in
i=0

newcommand{sums}{$$sum {i=0}ˆn iˆn$$}
sums
Macros with Math
$$sum_{i=0}^n i^n$$
n

in
i=0

newcommand{sums}{$$sum {i=0}ˆn iˆn$$}
sums
newcommand{sums}[1]{$$sum {i=0}ˆ#1 iˆ#1$$}
sums{5}
5

i5
i=0
Renewcommand

Use renewcommand to redefine an existing command
Renewcommand

Use renewcommand to redefine an existing command
Example:
The emph command italicizes its input.
Renewcommand

Use renewcommand to redefine an existing command
Example:
The emph command italicizes its input.
Suppose you want to use it instead of the shout command:
renewcommand{emph}[1]{{Huge{bf {#1}}}
Renewcommand

Use renewcommand to redefine an existing command
Example:
The emph command italicizes its input.
Suppose you want to use it instead of the shout command:
renewcommand{emph}[1]{{Huge{bf {#1}}}
emph{Pay Attention!}
Renewcommand

Use renewcommand to redefine an existing command
Example:
The emph command italicizes its input.
Suppose you want to use it instead of the shout command:
renewcommand{emph}[1]{{Huge{bf {#1}}}
emph{Pay Attention!}

Pay Attention!
PerlTeX

PerlTeX allows you to define macros using the Perl programming
language
Download:
http://www.ctan.org/tex-archive/macros/latex/contrib/
perltex/
User Manual:
http:
//www.tug.org/TUGboat/Articles/tb25-2/tb81pakin.pdf
Ams-LaTeX
A
Ams-LaTeX is a collection of extensions for LTEX in the form of
document classes and packages designed to enhance the
typesetting of mathematics.

The Amsmath package is an extension of AMS-LaTeX that
provides:
Superior equation formatting
Support for multiline equations
Support for better equation numbering
Auxilliary packages that provide additional support for
displayed equations
Additional Packages

The Amsthm package provides extensions to the
A
LTEX newtheorem command which include:
Various theorem styles
More control over numbering
A proof environment
Additional Packages

The Amsthm package provides extensions to the
A
LTEX newtheorem command which include:
Various theorem styles
More control over numbering
A proof environment
The Amssymb package provides additional fonts and symbols:
Additional Packages

The Amsthm package provides extensions to the
A
LTEX newtheorem command which include:
Various theorem styles
More control over numbering
A proof environment
The Amssymb package provides additional fonts and symbols:
Amsmath Equation Environments - Align

1

begin{align}
x^2 + y^2 & = z^2 nonumber 
x^3 + y^3 & < z^3
end{align}
x2 + y2 = z2
x3 + y3 < z3

(1)

Facts:
A
Better spacing than the LTEX eqnarray environment
Use the ”∗” to suppress numbering - begin{array∗}

Use nonumber to suppress numbering of individual equations
1

This and all following Amsmath slides adapted from
http://www.icms.org.uk/downloads/pgcourses/15october/Zachary.pdf
Amsmath Equation Environments - Multline
begin{multline}
lim_{xtoinfty}frac{P(M>x)}{overline{F^s}(x)} 
le limsup_{xtoinfty}
frac{P(M>x,,S_{tau_1}>x-R+a-epsilon)}%
{overline{F^s}(x)} 
+gamma
left(frac{2-gamma}{(a-epsilon)(1-gamma)^2}right)
end{multline}
lim

x→∞

P(M > x)
F s (x)
≤ lim sup
x→∞

P(M > x, Sτ1 > x − R + a − )
F s (x)
2−γ
+γ
(a − )(1 − γ)2

(2)
Amsmath Equation Environments - Cases

begin{equation*}
I_A =
begin{cases}
1 & text{if $xin A$}
0 & text{otherwise}
end{cases}
end{equation*}
IA =

1
0

if x ∈ A
otherwise
More Environments
Equation - single equation on a single line
Gather - multiple equations with no alignment
Flalign - horizontally spread version of align
Split - split single equations with alignment
begin{equation}
begin{split}
(a + b)^3 &= (a + b) (a + b)^2 
&= (a + b)(a^2 + 2ab + b^2) 
&= a^3 + 3a^2b + 3ab^2 + b^3
end{split}
end{equation}
(a + b)3 = (a + b)(a + b)2
= (a + b)(a2 + 2ab + b 2 )
= a3 + 3a2 b + 3ab 2 + b 3

(3)
Matrix Environments

begin{equation}
begin{matrix}
1 & 0 
0 & 1
end{matrix}
end{equation}
1 0
0 1

(4)
More Matrix Environments
pmatrix
1 0
0 1

(5)

1 0
0 1

(6)

1 0
0 1

(7)

1 0
0 1

(8)

1 0
0 1

(9)

bmatrix

Bmatrix

vmatrix

Vmatrix
AMS-LaTeX Assistance

For info on AMS-LaTeX:
http://www.ams.org/tex/amslatex.html
For info on the Amsmath package:
ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf
For info on Amsthm:
ftp://ftp.ams.org/pub/tex/doc/amscls/amsthdoc.pdf
Headers and Footers
Fancyhdr package creates customizable headers and
footers:
Headers and Footers
Fancyhdr package creates customizable headers and
footers:
 documentclass { a r t i c l e }
 usepackage { fancyhdr }
pagestyle{ fancyplain }
 b e g i n { document }
 l h e a d { Aubry W. V e r r e t }
 r h e a d { t o d a y }
end{ document }
Fancyhdr Output
Fancyhdr Help

You can get assistance with Fancyhdr here:
ftp://ctan.tug.org/tex-archive/macros/latex/
contrib/fancyhdr/fancyhdr.pdf
Minipages

The Minipage environment creates miniature pages within
pages.
begin{minipage}...end{minipage}
It is suitable for:
Grouping figures or tables
Placement of footnotes attached to images
Placing a border around a figure and its title
Minipage example
 b e g i n { f i g u r e } [ htbp ]
 centering
 b e g i n { m i n i p a g e } [ b ] { 5 cm}
 centering
 i n c l u d e g r a p h i c s { image 1}
 c a p t i o n { C a p t i o n 1}
end{ m i n i p a g e }
 b e g i n { m i n i p a g e } [ b ] { 5 cm}
 centering
 i n c l u d e g r a p h i c s { image 2}
 c a p t i o n { C a p t i o n 2}
end{ m i n i p a g e }
end{ f i g u r e }
Output

Figure: Science Cat

Figure: Physics Cat
Minipage Example Two
 b e g i n { f i g u r e } [ htbp ]
 centering
 b e g i n { m i n i p a g e } [ b ] { 3 . 3 cm}
 centering
 i n c l u d e g r a p h i c s [ s c a l e =.14]{ g r a p h i c s / s c i e n c e
 c a p t i o n { S c i e n c e Cat }
end{ m i n i p a g e }
 b e g i n { m i n i p a g e } [ b ] { 3 . 3 cm}
 centering
 i n c l u d e g r a p h i c s [ s c a l e =.23]{ g r a p h i c s / p h y s i c s
 c a p t i o n { P h y s i c s Cat }
end{ m i n i p a g e }
 b e g i n { m i n i p a g e } [ b ] { 3 . 3 cm}
 centering
 i n c l u d e g r a p h i c s [ s c a l e =.14]{ g r a p h i c s / s c i e n c e
 c a p t i o n { S c i e n c e Cat }
end{ m i n i p a g e }
 b e g i n { m i n i p a g e } [ b ] { 3 . 3 cm}
 centering
 i n c l u d e g r a p h i c s [ s c a l e =.23]{ g r a p h i c s / p h y s i c s
 c a p t i o n { P h y s i c s Cat }
end{ m i n i p a g e }
end{ f i g u r e }

cat }

cat }

cat }

cat }
Figure: Science Cat

Figure: Physics Cat

Figure: Science Cat

Figure: Physics Cat
Fonts
Default Font: Computer modern
Default font size: 10pt
How to change the default font:
Additional fonts are available for installation
(http://www.tug.dk/FontCatalogue/)
Fonts
Default Font: Computer modern
Default font size: 10pt
How to change the default font:
Additional fonts are available for installation
(http://www.tug.dk/FontCatalogue/)
How to change the default font size:
documentclass command accepts [11pt] and [12pt] as options
fix-cm package overrides font size defaults
special commands
Font Size Commands
tiny(5pt)

scriptsize(7pt)

footnotesize(8pt)

small(9pt)

normalsize(10pt)

large(12pt)

Large(14pt)

LARGE(18pt)

huge(20pt)

Huge(24pt)
Colored text

Use the xcolor package to add color to your text:
usepackage{xcolor}
Use {color{color name} text} to change the text color.
Predefined colors include:
black, white, red, yellow, blue, green, cyan, magenta
Example

{color{red} This text is red!}
This text is red!
Colored Text Background

colorbox{yellow}{This text has a yellow background!}
This text has a yellow background!
More Colors!

Use the [dvipsnames] option when you call the color
environment:
usepackage[dvipsnames]{xcolor}
You can now access 68 more colors!
New Colors
Wrap figure

To wrap text around a figure use the Wrapfig package:
usepackage{wrapfig}
Wrap the figure in the wrapfigure environment:
begin{wrapfigure}{alignment}{width}...end{wrapfigure}
alignment Either l (left) or r (right)
width Width of image
Wrapfig Example
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam
porttitor rutrum felis eget faucibus. Aliquam erat volutpat. Duis
commodo, libero nec adipiscing pellentesque, risus velit faucibus
augue, eget molestie nibh risus et augue.
 b e g i n { w r a p f i g u r e }{ l }{40mm}
 begin { center }
 includegraphics { far side }
end{ c e n t e r }
 caption { Einstein }
end{ w r a p f i g u r e }
Integer quis tristique est. Pellentesque lacinia mi mattis ipsum
rutrum egestas. Aliquam vestibulum pharetra felis, in congue eros
posuere ac.
Output
Compiling multiple .tex files
As your tex file grows, you may find that it becomes more difficult
to manage (compiling starts to take a long time, it gets hard to
find things, bugs are harder to find, etc.)
The solution: write several files sepearately and compile them
toether at the end. Use the input command to read each “child”
file into your “root” document...

input{child1.tex}
input{child2.tex}
input{child3.tex}
Compiling multiple .tex files
The problem with input is that the “child” files won’t compile on
their own. The solution is in the subfile package.
In the ”root” document the package must be loaded as:
usepackage{subfiles}
Instead of using input, ”child” documents must be loaded as
follows:
subfile{child}
The ”child” documents must start with the following statements:
documentclass[rootdocument.tex]{subfiles}
begin{document}
and end with:
end{document}
Alternate Output

A
LTEX can directly generate two formats:
dvi Generate using the latex command
pdf Generate using the pdflatex command

dvi supports only the eps image format
pdf supports jpg, png, pdf image formats
Converting from DVI to PDF
Directly (dvi → pdf):

Use dvipdfm.
A
There is a special button for this in most LTEXeditors.
Converting from DVI to PDF
Directly (dvi → pdf):

Use dvipdfm.
A
There is a special button for this in most LTEXeditors.
Use this if the original file contains postscript figures
Converting from DVI to PDF
Directly (dvi → pdf):

Use dvipdfm.
A
There is a special button for this in most LTEXeditors.
Use this if the original file contains postscript figures

Indirectly (dvi → ps → pdf):
Use dvips, then sp2pdf
Converting from DVI to PDF
Directly (dvi → pdf):

Use dvipdfm.
A
There is a special button for this in most LTEXeditors.
Use this if the original file contains postscript figures

Indirectly (dvi → ps → pdf):
Use dvips, then sp2pdf
typically ineffecient and can produce larger files of lower
quality
HTML output

A
There are several programs for converting LTEX to HTML:

Hyperlatex Actively maintained to keep up with HTML
standards
TTH Good at formula conversion
Heava Good overall, written in O Caml
LaTeX2HTML Not well maintained
text4ht Difficult to configure but produces good output
Beamer

It is possible to create sophisticated presentations while
A
harnessing the power of LTEX
The Beamer class produces presentations that:
Can be easily cutomized
Contain overlays
Can display sophisitcated mathematics
Are easily converted to handouts
Compile directly to PDF
How to Use Beamer

Use beamer as the document class:
documentclass[style]{beamer}
Go here for examples of Beamer styles:
http://mike.depalatis.net/beamerthemes/
Frames

Beamer uses the Frame environment:
begin{frame}[options]...end{frame}
Frames

Beamer uses the Frame environment:
begin{frame}[options]...end{frame}
Options include:
fragile allows you to include text using the verbatim or
listings packages on a slide
allowframebreaks allows Beamer to create extra slides to
handle overflow text
shrink shrinks contents to fit on one slide
Example of Frame
How to Make A Table

A
To make a table in LTEX use the tabular environment:

begin{tabular}...end{tabular}
How to Make A Table

A
To make a table in LTEX use the tabular environment:

begin{tabular}...end{tabular}
Separate columns with the ”&” symbol
Separate rows with the double backslash ””
Tabular Layout

Specify the column layout when you call tabular:
begin{tabular}{l|l|l}
Vertical bars produce vertical lines between columns.
Alignment Symbols
l - align left
r - align right
c - centered
Tables
begin{tabular}{ l | l | l }
Class
& Species & Lays eggs? 
mammal & lion
& XSolidBrush 
mammal & tiger
& XSolidBrush 
mammal & platypus
& Checkmark 
reptile & iguana & Checkmark 
reptile & snake
& Checkmark 
aves & flamingo & Checkmark 
end{tabular}
Class
mammal
mammal
mammal
reptile
reptile
aves

Species
lion
tiger
platypus
iguana
snake
flamingo

Lays eggs?

%
%
!
!
!
!
Tables
Change alignments:
begin{tabular}{| l | r | c | }
Class
& Species & Lays eggs? 
mammal & lion
& XSolidBrush 
mammal & tiger
& XSolidBrush 
mammal & platypus
& Checkmark 
reptile & iguana & Checkmark 
reptile & snake
& Checkmark 
aves & flamingo & Checkmark 
end{tabular}
Class
mammal
mammal
mammal
reptile
reptile
aves

Species
lion
tiger
platypus
iguana
snake
flamingo

Lays eggs?

%
%
!
!
!
!
Tables
Add horizontal lines:
begin{tabular}{| l | r | c | } hline
Class
& Species & Lays eggs?
 hlinehline
mammal & lion
& XSolidBrush  hline
mammal & tiger
& XSolidBrush  hline
mammal & platypus
& Checkmark  hline
reptile & iguana & Checkmark
 hline
reptile & snake
& Checkmark
 hline
aves & flamingo & Checkmark
 hline
end{tabular}
Class
mammal
mammal
mammal
reptile
reptile
aves

Species
lion
tiger
platypus
iguana
snake
flamingo

Lays eggs?

%
%
!
!
!
!
Tables
Not so many:
begin{tabular}{| l | r | c | } hline
Class
& Species & Lays eggs?
 hlinehline
mammal & lion
& XSolidBrush 
& tiger
& XSolidBrush 
& platypus
& Checkmark  hline
reptile & iguana & Checkmark

& snake
& Checkmark
 hline
aves & flamingo & Checkmark
 hline
end{tabular}
Class
mammal

reptile
aves

Species
lion
tiger
platypus
iguana
snake
flamingo

Lays eggs?

%
%
!
!
!
!
Tables
Partial hlines
begin{tabular}{| l | r | c | } hline
Class
& Species & Lays eggs?
 hlinehline
mammal & lion
& XSolidBrush  cline{2-3}
& tiger
& XSolidBrush  cline{2-3}
& platypus
& Checkmark  hline
reptile & iguana & Checkmark
 cline{2-3}
& snake
& Checkmark
 hline
aves & flamingo & Checkmark
 hline
end{tabular}
Class
mammal

reptile
aves

Species
lion
tiger
platypus
iguana
snake
flamingo

Lays eggs?

%
%
!
!
!
!
Tables
Multirow

begin{tabular}{| l | r | c | } hline
Class
& Species & Lays eggs?
 hlinehlin
multirow{3}{*}{mammal}
& lion
& XSolidBrush  cline{2-3
& tiger
& XSolidBrush  cline{2-3}
& platypus
& Checkmark  hline
multirow{2}{*}{reptile} & iguana & Checkmark
 cline{2-3}
& snake
& Checkmark
 hline
aves
& flamingo & Checkmark
 hl
end{tabular}
Class
mammal

reptile
aves

Species
lion
tiger
platypus
iguana
snake
flamingo

Lays eggs?

%
%
!
!
!
!
Tables
Color (colortbl package)

begin{tabular}{| l | r | c | } hline
rowcolor[gray]{0.8} Class & Species & Lays eggs?
 hlinehl
multirow{3}{*}{mammal}
& lion
& XSolidBrush  cline{2-3
& tiger
& XSolidBrush  cline{2-3}
& platypus
& Checkmark  hline
multirow{2}{*}{reptile} & iguana & Checkmark
 cline{2-3}
& snake
& Checkmark
 hline
aves
& flamingo & Checkmark
 hl
end{tabular}
Class
mammal

reptile
aves

Species
lion
tiger
platypus
iguana
snake
flamingo

Lays eggs?

%
%
!
!
!
!
Tables

Better horizontal lines: booktabs package

begin{tabular}{lrc} toprule
Class & Species & Lays eggs?  toprule
multirow{3}{*}{mammal} & lion & XSolidBrush  cmidrule{2-3
& tiger & XSolidBrush  cmidrule{2-3}
& platypus & Checkmark  midrule
multirow{2}{*}{reptile}& iguana& Checkmark
 cmidrule{2-3}
& snake & Checkmark
 midrule
aves
& flamingo& Checkmark
 botto
end{tabular}
Tables
Better horizontal lines: booktabs package
Class

Species
lion

mammal

tiger
platypus

reptile

iguana
snake

aves

flamingo

Lays eggs?

%
%
!
!
!
!
Tables

The table enviroment:
begin{table} ... end{table}
allows you to:
Turn a table into a float
Add a caption
Number the table for referencing
Tables
table environment

Table: Who lays eggs?

Class

Species
lion

mammal

tiger
platypus

reptile

iguana
snake

aves

flamingo

Lays eggs?

%
%
!
!
!
!
Tables
Formatting Numbers
begin{tabular}{c r}
Expression & Value  hline
$pi$
&
3.1416  hline
$pi^{pi}$
&
36.46
 hline
$pi^{pi^{pi}}$ & 80662.7
 hline
end{tabular}
Expression
π
ππ
π
ππ

Value
3.1416
36.46
80662.7
Tables
One fix:
begin{tabular}{c r @{.} l}
Expression & multicolumn {2}{c}{Value}  hline
$pi$
&
3 & 1416  hline
$pi^{pi}$
&
36 & 46
 hline
$pi^{pi^{pi}}$ & 80662 & 7
 hline
end{tabular}
Expression
π
ππ
π
ππ

Value
3.1416
36.46
80662.7
Tables
Another Fix (dcolumn package)
begin{tabular}{cD{,}{.}{5.4}}
Expression & multicolumn {1}{c}{Value}  hline
$pi$
&
3,1416  hline
$pi^{pi}$
&
36,46
 hline
$pi^{pi^{pi}}$ & 80662,7
 hline
end{tabular}
Expression
π
ππ
π
ππ

Value
3.1416
36.46
80662.7
Tables
Another Fix (rccol package)
begin{tabular}{cR[,][.]{5}{3}}
Expression & multicolumn {1}{c}{Value}  hline
$pi$
&
3,1416  hline
$pi^{pi}$
&
36,46
 hline
$pi^{pi^{pi}}$ & 80662,7
 hline
end{tabular}
Expression
π
ππ
π
ππ

Value
3.142
36.460
80662.700
Tables
Slashed Boxes (slashbox package)
begin{tabular}{|l|>{$}c<{$}|>{$}c<{$}|} hline
backslashbox{Function}{Argument} & 0 & pi/2  hline
$sin$ & 0 & 1  hline
$cos$ & 1 & 0  hline
end{tabular}
```
``` Argument
```
0 π/2
```
Function
sin
0
1
cos
1
0
Tables

Making tables look good...

D
5in
5in
5in
10in
10in
10in

test
test
test
test
test
test

1
2
3
1
2
3

Pu
285
287
230
430
433
431

lb
lb
lb
lb
lb
lb

σN
38.200 psi
38.27 psi
30.67 psi
248.67 psi
28.8 psi
28.7334 psi
Tables
...takes practice.
Table: Maximum load and nominal tension.
D
(in)

Pu
(lbs)

σN
(psi)

5

test 1
test 2
test 3

285
287
230

38.00
38.27
30.67

10

test 1
test 2
test 3

430
433
431

28.67
28.87
28.73
Where To Get Help

A
Books - LTEXConcisely by Adrian Johnstone
Online - numerous manuals available
Research Computing Lab www2.lib.virginia.edu/brown/rescomp/
help/index.html

More Related Content

What's hot

Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1
Kiel Granada
 

What's hot (20)

Introduction to LaTeX
Introduction to LaTeXIntroduction to LaTeX
Introduction to LaTeX
 
Introduction to latex by Rouhollah Nabati
Introduction to latex by Rouhollah NabatiIntroduction to latex by Rouhollah Nabati
Introduction to latex by Rouhollah Nabati
 
Learn Latex
Learn LatexLearn Latex
Learn Latex
 
Latex workshop: Essentials and Practices
Latex workshop: Essentials and PracticesLatex workshop: Essentials and Practices
Latex workshop: Essentials and Practices
 
Latex slides
Latex slidesLatex slides
Latex slides
 
Latex Notes
Latex NotesLatex Notes
Latex Notes
 
Inroduction to Latex
Inroduction to LatexInroduction to Latex
Inroduction to Latex
 
Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1
 
Editing documents with LaTeX
Editing documents with LaTeXEditing documents with LaTeX
Editing documents with LaTeX
 
LaTeX Cheat Sheet
LaTeX Cheat Sheet LaTeX Cheat Sheet
LaTeX Cheat Sheet
 
Training basic latex
Training basic latexTraining basic latex
Training basic latex
 
documents writing with LATEX
documents writing with LATEXdocuments writing with LATEX
documents writing with LATEX
 
LaTeX for beginners
LaTeX for beginnersLaTeX for beginners
LaTeX for beginners
 
Introduction to Latex
Introduction to Latex Introduction to Latex
Introduction to Latex
 
Latex for beginner
Latex for beginnerLatex for beginner
Latex for beginner
 
Introduction to Latex
Introduction to LatexIntroduction to Latex
Introduction to Latex
 
Workshop - Introduction to Machine Learning with R
Workshop - Introduction to Machine Learning with RWorkshop - Introduction to Machine Learning with R
Workshop - Introduction to Machine Learning with R
 
Technical writing using LaTeX
Technical writing using LaTeXTechnical writing using LaTeX
Technical writing using LaTeX
 
LaTex tutorial with Texstudio
LaTex tutorial with TexstudioLaTex tutorial with Texstudio
LaTex tutorial with Texstudio
 
scientific writing 01 - latex
scientific writing   01 - latexscientific writing   01 - latex
scientific writing 01 - latex
 

Similar to Advanced latex

Tech Days Paris Intoduction F# and Collective Intelligence
Tech Days Paris Intoduction F# and Collective IntelligenceTech Days Paris Intoduction F# and Collective Intelligence
Tech Days Paris Intoduction F# and Collective Intelligence
Robert Pickering
 

Similar to Advanced latex (20)

La tex basics
La tex basicsLa tex basics
La tex basics
 
Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, code
 
Perl Presentation
Perl PresentationPerl Presentation
Perl Presentation
 
C Programming Homework Help
C Programming Homework HelpC Programming Homework Help
C Programming Homework Help
 
Latex_Tutorial.pdf
Latex_Tutorial.pdfLatex_Tutorial.pdf
Latex_Tutorial.pdf
 
Matlab Basic Tutorial
Matlab Basic TutorialMatlab Basic Tutorial
Matlab Basic Tutorial
 
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
 
JSUG - TeX Day by Christoph Pickl
JSUG - TeX Day by Christoph PicklJSUG - TeX Day by Christoph Pickl
JSUG - TeX Day by Christoph Pickl
 
5.1 Quadratic Functions
5.1 Quadratic Functions5.1 Quadratic Functions
5.1 Quadratic Functions
 
C Programming Interview Questions
C Programming Interview QuestionsC Programming Interview Questions
C Programming Interview Questions
 
Computational Assignment Help
Computational Assignment HelpComputational Assignment Help
Computational Assignment Help
 
Groovy and Grails talk
Groovy and Grails talkGroovy and Grails talk
Groovy and Grails talk
 
My First Rails Plugin - Usertext
My First Rails Plugin - UsertextMy First Rails Plugin - Usertext
My First Rails Plugin - Usertext
 
Lecture 6 operators
Lecture 6   operatorsLecture 6   operators
Lecture 6 operators
 
Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021
Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021
Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021
 
Matlab1
Matlab1Matlab1
Matlab1
 
Tres Gemas De Ruby
Tres Gemas De RubyTres Gemas De Ruby
Tres Gemas De Ruby
 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
 
Tech Days Paris Intoduction F# and Collective Intelligence
Tech Days Paris Intoduction F# and Collective IntelligenceTech Days Paris Intoduction F# and Collective Intelligence
Tech Days Paris Intoduction F# and Collective Intelligence
 
Chap11 scr
Chap11 scrChap11 scr
Chap11 scr
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Advanced latex

  • 2. Macros Definition A shorthand command used to abbreviate another command or series of commands. A Fact: LTEX is comprised of numerous macros built on the TEX language.
  • 3. How to write a Macro Define a macro in the Preamble using: newcommand{command name}{definition}
  • 4. How to write a Macro Define a macro in the Preamble using: newcommand{command name}{definition} Example: newcommand{uva}{University of Virginia}
  • 5. How to write a Macro Define a macro in the Preamble using: newcommand{command name}{definition} Example: newcommand{uva}{University of Virginia} Whenever you want ”University of Virginia” to appear you use the uva command.
  • 6. Macros with Arguments Specify the number of arguments in square braces: newcommand{command name}[# args]{definition} Refer to the arguments as #1, #2, #3, #4 etc. in the definition.
  • 7. Macros with Arguments Specify the number of arguments in square braces: newcommand{command name}[# args]{definition} Refer to the arguments as #1, #2, #3, #4 etc. in the definition. Example: newcommand{shout}[1]{{Huge{bf {#1}}}
  • 8. Macros with Arguments Specify the number of arguments in square braces: newcommand{command name}[# args]{definition} Refer to the arguments as #1, #2, #3, #4 etc. in the definition. Example: newcommand{shout}[1]{{Huge{bf {#1}}} Pay Attention!
  • 9. Macros with Arguments Specify the number of arguments in square braces: newcommand{command name}[# args]{definition} Refer to the arguments as #1, #2, #3, #4 etc. in the definition. Example: newcommand{shout}[1]{{Huge{bf {#1}}} Pay Attention! shout{Pay Attention!}
  • 10. Macros with Math $$sum_{i=0}^n i^n$$ n in i=0 newcommand{sums}{$$sum {i=0}ˆn iˆn$$}
  • 11. Macros with Math $$sum_{i=0}^n i^n$$ n in i=0 newcommand{sums}{$$sum {i=0}ˆn iˆn$$} sums
  • 12. Macros with Math $$sum_{i=0}^n i^n$$ n in i=0 newcommand{sums}{$$sum {i=0}ˆn iˆn$$} sums newcommand{sums}[1]{$$sum {i=0}ˆ#1 iˆ#1$$} sums{5} 5 i5 i=0
  • 13. Renewcommand Use renewcommand to redefine an existing command
  • 14. Renewcommand Use renewcommand to redefine an existing command Example: The emph command italicizes its input.
  • 15. Renewcommand Use renewcommand to redefine an existing command Example: The emph command italicizes its input. Suppose you want to use it instead of the shout command: renewcommand{emph}[1]{{Huge{bf {#1}}}
  • 16. Renewcommand Use renewcommand to redefine an existing command Example: The emph command italicizes its input. Suppose you want to use it instead of the shout command: renewcommand{emph}[1]{{Huge{bf {#1}}} emph{Pay Attention!}
  • 17. Renewcommand Use renewcommand to redefine an existing command Example: The emph command italicizes its input. Suppose you want to use it instead of the shout command: renewcommand{emph}[1]{{Huge{bf {#1}}} emph{Pay Attention!} Pay Attention!
  • 18. PerlTeX PerlTeX allows you to define macros using the Perl programming language Download: http://www.ctan.org/tex-archive/macros/latex/contrib/ perltex/ User Manual: http: //www.tug.org/TUGboat/Articles/tb25-2/tb81pakin.pdf
  • 19. Ams-LaTeX A Ams-LaTeX is a collection of extensions for LTEX in the form of document classes and packages designed to enhance the typesetting of mathematics. The Amsmath package is an extension of AMS-LaTeX that provides: Superior equation formatting Support for multiline equations Support for better equation numbering Auxilliary packages that provide additional support for displayed equations
  • 20. Additional Packages The Amsthm package provides extensions to the A LTEX newtheorem command which include: Various theorem styles More control over numbering A proof environment
  • 21. Additional Packages The Amsthm package provides extensions to the A LTEX newtheorem command which include: Various theorem styles More control over numbering A proof environment The Amssymb package provides additional fonts and symbols:
  • 22. Additional Packages The Amsthm package provides extensions to the A LTEX newtheorem command which include: Various theorem styles More control over numbering A proof environment The Amssymb package provides additional fonts and symbols:
  • 23. Amsmath Equation Environments - Align 1 begin{align} x^2 + y^2 & = z^2 nonumber x^3 + y^3 & < z^3 end{align} x2 + y2 = z2 x3 + y3 < z3 (1) Facts: A Better spacing than the LTEX eqnarray environment Use the ”∗” to suppress numbering - begin{array∗} Use nonumber to suppress numbering of individual equations 1 This and all following Amsmath slides adapted from http://www.icms.org.uk/downloads/pgcourses/15october/Zachary.pdf
  • 24. Amsmath Equation Environments - Multline begin{multline} lim_{xtoinfty}frac{P(M>x)}{overline{F^s}(x)} le limsup_{xtoinfty} frac{P(M>x,,S_{tau_1}>x-R+a-epsilon)}% {overline{F^s}(x)} +gamma left(frac{2-gamma}{(a-epsilon)(1-gamma)^2}right) end{multline} lim x→∞ P(M > x) F s (x) ≤ lim sup x→∞ P(M > x, Sτ1 > x − R + a − ) F s (x) 2−γ +γ (a − )(1 − γ)2 (2)
  • 25. Amsmath Equation Environments - Cases begin{equation*} I_A = begin{cases} 1 & text{if $xin A$} 0 & text{otherwise} end{cases} end{equation*} IA = 1 0 if x ∈ A otherwise
  • 26. More Environments Equation - single equation on a single line Gather - multiple equations with no alignment Flalign - horizontally spread version of align Split - split single equations with alignment begin{equation} begin{split} (a + b)^3 &= (a + b) (a + b)^2 &= (a + b)(a^2 + 2ab + b^2) &= a^3 + 3a^2b + 3ab^2 + b^3 end{split} end{equation} (a + b)3 = (a + b)(a + b)2 = (a + b)(a2 + 2ab + b 2 ) = a3 + 3a2 b + 3ab 2 + b 3 (3)
  • 27. Matrix Environments begin{equation} begin{matrix} 1 & 0 0 & 1 end{matrix} end{equation} 1 0 0 1 (4)
  • 28. More Matrix Environments pmatrix 1 0 0 1 (5) 1 0 0 1 (6) 1 0 0 1 (7) 1 0 0 1 (8) 1 0 0 1 (9) bmatrix Bmatrix vmatrix Vmatrix
  • 29. AMS-LaTeX Assistance For info on AMS-LaTeX: http://www.ams.org/tex/amslatex.html For info on the Amsmath package: ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf For info on Amsthm: ftp://ftp.ams.org/pub/tex/doc/amscls/amsthdoc.pdf
  • 30. Headers and Footers Fancyhdr package creates customizable headers and footers:
  • 31. Headers and Footers Fancyhdr package creates customizable headers and footers: documentclass { a r t i c l e } usepackage { fancyhdr } pagestyle{ fancyplain } b e g i n { document } l h e a d { Aubry W. V e r r e t } r h e a d { t o d a y } end{ document }
  • 33. Fancyhdr Help You can get assistance with Fancyhdr here: ftp://ctan.tug.org/tex-archive/macros/latex/ contrib/fancyhdr/fancyhdr.pdf
  • 34. Minipages The Minipage environment creates miniature pages within pages. begin{minipage}...end{minipage} It is suitable for: Grouping figures or tables Placement of footnotes attached to images Placing a border around a figure and its title
  • 35. Minipage example b e g i n { f i g u r e } [ htbp ] centering b e g i n { m i n i p a g e } [ b ] { 5 cm} centering i n c l u d e g r a p h i c s { image 1} c a p t i o n { C a p t i o n 1} end{ m i n i p a g e } b e g i n { m i n i p a g e } [ b ] { 5 cm} centering i n c l u d e g r a p h i c s { image 2} c a p t i o n { C a p t i o n 2} end{ m i n i p a g e } end{ f i g u r e }
  • 37. Minipage Example Two b e g i n { f i g u r e } [ htbp ] centering b e g i n { m i n i p a g e } [ b ] { 3 . 3 cm} centering i n c l u d e g r a p h i c s [ s c a l e =.14]{ g r a p h i c s / s c i e n c e c a p t i o n { S c i e n c e Cat } end{ m i n i p a g e } b e g i n { m i n i p a g e } [ b ] { 3 . 3 cm} centering i n c l u d e g r a p h i c s [ s c a l e =.23]{ g r a p h i c s / p h y s i c s c a p t i o n { P h y s i c s Cat } end{ m i n i p a g e } b e g i n { m i n i p a g e } [ b ] { 3 . 3 cm} centering i n c l u d e g r a p h i c s [ s c a l e =.14]{ g r a p h i c s / s c i e n c e c a p t i o n { S c i e n c e Cat } end{ m i n i p a g e } b e g i n { m i n i p a g e } [ b ] { 3 . 3 cm} centering i n c l u d e g r a p h i c s [ s c a l e =.23]{ g r a p h i c s / p h y s i c s c a p t i o n { P h y s i c s Cat } end{ m i n i p a g e } end{ f i g u r e } cat } cat } cat } cat }
  • 38. Figure: Science Cat Figure: Physics Cat Figure: Science Cat Figure: Physics Cat
  • 39. Fonts Default Font: Computer modern Default font size: 10pt How to change the default font: Additional fonts are available for installation (http://www.tug.dk/FontCatalogue/)
  • 40. Fonts Default Font: Computer modern Default font size: 10pt How to change the default font: Additional fonts are available for installation (http://www.tug.dk/FontCatalogue/) How to change the default font size: documentclass command accepts [11pt] and [12pt] as options fix-cm package overrides font size defaults special commands
  • 42. Colored text Use the xcolor package to add color to your text: usepackage{xcolor} Use {color{color name} text} to change the text color. Predefined colors include: black, white, red, yellow, blue, green, cyan, magenta
  • 43. Example {color{red} This text is red!} This text is red!
  • 44. Colored Text Background colorbox{yellow}{This text has a yellow background!} This text has a yellow background!
  • 45. More Colors! Use the [dvipsnames] option when you call the color environment: usepackage[dvipsnames]{xcolor} You can now access 68 more colors!
  • 47. Wrap figure To wrap text around a figure use the Wrapfig package: usepackage{wrapfig} Wrap the figure in the wrapfigure environment: begin{wrapfigure}{alignment}{width}...end{wrapfigure} alignment Either l (left) or r (right) width Width of image
  • 48. Wrapfig Example Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam porttitor rutrum felis eget faucibus. Aliquam erat volutpat. Duis commodo, libero nec adipiscing pellentesque, risus velit faucibus augue, eget molestie nibh risus et augue. b e g i n { w r a p f i g u r e }{ l }{40mm} begin { center } includegraphics { far side } end{ c e n t e r } caption { Einstein } end{ w r a p f i g u r e } Integer quis tristique est. Pellentesque lacinia mi mattis ipsum rutrum egestas. Aliquam vestibulum pharetra felis, in congue eros posuere ac.
  • 50. Compiling multiple .tex files As your tex file grows, you may find that it becomes more difficult to manage (compiling starts to take a long time, it gets hard to find things, bugs are harder to find, etc.) The solution: write several files sepearately and compile them toether at the end. Use the input command to read each “child” file into your “root” document... input{child1.tex} input{child2.tex} input{child3.tex}
  • 51. Compiling multiple .tex files The problem with input is that the “child” files won’t compile on their own. The solution is in the subfile package. In the ”root” document the package must be loaded as: usepackage{subfiles} Instead of using input, ”child” documents must be loaded as follows: subfile{child} The ”child” documents must start with the following statements: documentclass[rootdocument.tex]{subfiles} begin{document} and end with: end{document}
  • 52. Alternate Output A LTEX can directly generate two formats: dvi Generate using the latex command pdf Generate using the pdflatex command dvi supports only the eps image format pdf supports jpg, png, pdf image formats
  • 53. Converting from DVI to PDF Directly (dvi → pdf): Use dvipdfm. A There is a special button for this in most LTEXeditors.
  • 54. Converting from DVI to PDF Directly (dvi → pdf): Use dvipdfm. A There is a special button for this in most LTEXeditors. Use this if the original file contains postscript figures
  • 55. Converting from DVI to PDF Directly (dvi → pdf): Use dvipdfm. A There is a special button for this in most LTEXeditors. Use this if the original file contains postscript figures Indirectly (dvi → ps → pdf): Use dvips, then sp2pdf
  • 56. Converting from DVI to PDF Directly (dvi → pdf): Use dvipdfm. A There is a special button for this in most LTEXeditors. Use this if the original file contains postscript figures Indirectly (dvi → ps → pdf): Use dvips, then sp2pdf typically ineffecient and can produce larger files of lower quality
  • 57. HTML output A There are several programs for converting LTEX to HTML: Hyperlatex Actively maintained to keep up with HTML standards TTH Good at formula conversion Heava Good overall, written in O Caml LaTeX2HTML Not well maintained text4ht Difficult to configure but produces good output
  • 58. Beamer It is possible to create sophisticated presentations while A harnessing the power of LTEX The Beamer class produces presentations that: Can be easily cutomized Contain overlays Can display sophisitcated mathematics Are easily converted to handouts Compile directly to PDF
  • 59. How to Use Beamer Use beamer as the document class: documentclass[style]{beamer} Go here for examples of Beamer styles: http://mike.depalatis.net/beamerthemes/
  • 60. Frames Beamer uses the Frame environment: begin{frame}[options]...end{frame}
  • 61. Frames Beamer uses the Frame environment: begin{frame}[options]...end{frame} Options include: fragile allows you to include text using the verbatim or listings packages on a slide allowframebreaks allows Beamer to create extra slides to handle overflow text shrink shrinks contents to fit on one slide
  • 63. How to Make A Table A To make a table in LTEX use the tabular environment: begin{tabular}...end{tabular}
  • 64. How to Make A Table A To make a table in LTEX use the tabular environment: begin{tabular}...end{tabular} Separate columns with the ”&” symbol Separate rows with the double backslash ””
  • 65. Tabular Layout Specify the column layout when you call tabular: begin{tabular}{l|l|l} Vertical bars produce vertical lines between columns. Alignment Symbols l - align left r - align right c - centered
  • 66. Tables begin{tabular}{ l | l | l } Class & Species & Lays eggs? mammal & lion & XSolidBrush mammal & tiger & XSolidBrush mammal & platypus & Checkmark reptile & iguana & Checkmark reptile & snake & Checkmark aves & flamingo & Checkmark end{tabular} Class mammal mammal mammal reptile reptile aves Species lion tiger platypus iguana snake flamingo Lays eggs? % % ! ! ! !
  • 67. Tables Change alignments: begin{tabular}{| l | r | c | } Class & Species & Lays eggs? mammal & lion & XSolidBrush mammal & tiger & XSolidBrush mammal & platypus & Checkmark reptile & iguana & Checkmark reptile & snake & Checkmark aves & flamingo & Checkmark end{tabular} Class mammal mammal mammal reptile reptile aves Species lion tiger platypus iguana snake flamingo Lays eggs? % % ! ! ! !
  • 68. Tables Add horizontal lines: begin{tabular}{| l | r | c | } hline Class & Species & Lays eggs? hlinehline mammal & lion & XSolidBrush hline mammal & tiger & XSolidBrush hline mammal & platypus & Checkmark hline reptile & iguana & Checkmark hline reptile & snake & Checkmark hline aves & flamingo & Checkmark hline end{tabular} Class mammal mammal mammal reptile reptile aves Species lion tiger platypus iguana snake flamingo Lays eggs? % % ! ! ! !
  • 69. Tables Not so many: begin{tabular}{| l | r | c | } hline Class & Species & Lays eggs? hlinehline mammal & lion & XSolidBrush & tiger & XSolidBrush & platypus & Checkmark hline reptile & iguana & Checkmark & snake & Checkmark hline aves & flamingo & Checkmark hline end{tabular} Class mammal reptile aves Species lion tiger platypus iguana snake flamingo Lays eggs? % % ! ! ! !
  • 70. Tables Partial hlines begin{tabular}{| l | r | c | } hline Class & Species & Lays eggs? hlinehline mammal & lion & XSolidBrush cline{2-3} & tiger & XSolidBrush cline{2-3} & platypus & Checkmark hline reptile & iguana & Checkmark cline{2-3} & snake & Checkmark hline aves & flamingo & Checkmark hline end{tabular} Class mammal reptile aves Species lion tiger platypus iguana snake flamingo Lays eggs? % % ! ! ! !
  • 71. Tables Multirow begin{tabular}{| l | r | c | } hline Class & Species & Lays eggs? hlinehlin multirow{3}{*}{mammal} & lion & XSolidBrush cline{2-3 & tiger & XSolidBrush cline{2-3} & platypus & Checkmark hline multirow{2}{*}{reptile} & iguana & Checkmark cline{2-3} & snake & Checkmark hline aves & flamingo & Checkmark hl end{tabular} Class mammal reptile aves Species lion tiger platypus iguana snake flamingo Lays eggs? % % ! ! ! !
  • 72. Tables Color (colortbl package) begin{tabular}{| l | r | c | } hline rowcolor[gray]{0.8} Class & Species & Lays eggs? hlinehl multirow{3}{*}{mammal} & lion & XSolidBrush cline{2-3 & tiger & XSolidBrush cline{2-3} & platypus & Checkmark hline multirow{2}{*}{reptile} & iguana & Checkmark cline{2-3} & snake & Checkmark hline aves & flamingo & Checkmark hl end{tabular} Class mammal reptile aves Species lion tiger platypus iguana snake flamingo Lays eggs? % % ! ! ! !
  • 73. Tables Better horizontal lines: booktabs package begin{tabular}{lrc} toprule Class & Species & Lays eggs? toprule multirow{3}{*}{mammal} & lion & XSolidBrush cmidrule{2-3 & tiger & XSolidBrush cmidrule{2-3} & platypus & Checkmark midrule multirow{2}{*}{reptile}& iguana& Checkmark cmidrule{2-3} & snake & Checkmark midrule aves & flamingo& Checkmark botto end{tabular}
  • 74. Tables Better horizontal lines: booktabs package Class Species lion mammal tiger platypus reptile iguana snake aves flamingo Lays eggs? % % ! ! ! !
  • 75. Tables The table enviroment: begin{table} ... end{table} allows you to: Turn a table into a float Add a caption Number the table for referencing
  • 76. Tables table environment Table: Who lays eggs? Class Species lion mammal tiger platypus reptile iguana snake aves flamingo Lays eggs? % % ! ! ! !
  • 77. Tables Formatting Numbers begin{tabular}{c r} Expression & Value hline $pi$ & 3.1416 hline $pi^{pi}$ & 36.46 hline $pi^{pi^{pi}}$ & 80662.7 hline end{tabular} Expression π ππ π ππ Value 3.1416 36.46 80662.7
  • 78. Tables One fix: begin{tabular}{c r @{.} l} Expression & multicolumn {2}{c}{Value} hline $pi$ & 3 & 1416 hline $pi^{pi}$ & 36 & 46 hline $pi^{pi^{pi}}$ & 80662 & 7 hline end{tabular} Expression π ππ π ππ Value 3.1416 36.46 80662.7
  • 79. Tables Another Fix (dcolumn package) begin{tabular}{cD{,}{.}{5.4}} Expression & multicolumn {1}{c}{Value} hline $pi$ & 3,1416 hline $pi^{pi}$ & 36,46 hline $pi^{pi^{pi}}$ & 80662,7 hline end{tabular} Expression π ππ π ππ Value 3.1416 36.46 80662.7
  • 80. Tables Another Fix (rccol package) begin{tabular}{cR[,][.]{5}{3}} Expression & multicolumn {1}{c}{Value} hline $pi$ & 3,1416 hline $pi^{pi}$ & 36,46 hline $pi^{pi^{pi}}$ & 80662,7 hline end{tabular} Expression π ππ π ππ Value 3.142 36.460 80662.700
  • 81. Tables Slashed Boxes (slashbox package) begin{tabular}{|l|>{$}c<{$}|>{$}c<{$}|} hline backslashbox{Function}{Argument} & 0 & pi/2 hline $sin$ & 0 & 1 hline $cos$ & 1 & 0 hline end{tabular} ``` ``` Argument ``` 0 π/2 ``` Function sin 0 1 cos 1 0
  • 82. Tables Making tables look good... D 5in 5in 5in 10in 10in 10in test test test test test test 1 2 3 1 2 3 Pu 285 287 230 430 433 431 lb lb lb lb lb lb σN 38.200 psi 38.27 psi 30.67 psi 248.67 psi 28.8 psi 28.7334 psi
  • 83. Tables ...takes practice. Table: Maximum load and nominal tension. D (in) Pu (lbs) σN (psi) 5 test 1 test 2 test 3 285 287 230 38.00 38.27 30.67 10 test 1 test 2 test 3 430 433 431 28.67 28.87 28.73
  • 84. Where To Get Help A Books - LTEXConcisely by Adrian Johnstone Online - numerous manuals available Research Computing Lab www2.lib.virginia.edu/brown/rescomp/ help/index.html