Introduction To LaTeX Writing Papers The Right Way La Te X MIT Guide
LaTeX_MIT_Guide
User Manual:
Open the PDF directly: View PDF .
Page Count: 55
Introduction to L
A
T
E
X
Introduction
L
A
T
E
X is not. . .
. . . a word processor.
L
A
T
EX does not. . .
Spell-check your documents1
Give you complete control over formatting
Provide a graphical interface for editing
“You take care of writing, and we’ll take care of presentation.”
1You can use ispell to check your L
A
T
E
X
Introduction to L
A
T
E
X
Introduction
Why L
A
T
E
X?
Presentation shouldn’t get in the way of content.
For example. . .
With a word processor, you spend valuable time agonizing over
what font size to make the section headings.
With L
A
T
E
X, you just tell it to start a new section.
With a word processor, changing the formatting means you have to
change each instance individually.
With L
A
T
E
X, you just redefine the relevant commands.
With a word processor, you have to carefully match any provided
templates.
With L
A
T
E
X, you can be sure you’ve fit the template, and switch
templates easily.
Introduction to L
A
T
E
X
A Basic Document
”Hello L
A
T
E
X!”
Creating a L
A
T
E
X Document
Write a .tex file using any text editor and save it in the
MiniPaper folder
% this is hello.tex
\documentclass{article}
\begin{document}
Hello, \LaTeX!
\end{document}
Compile using the RSI Makefile
$ cd ∼/RSI/MiniPaper/
$ make hello.pdf
Preview the results
$ evince hello.pdf &
Introduction to L
A
T
E
X
A Basic Document
Writing LaTeX Code
Declarations and Environments
Declarations. . .
Are stated once
Take effect until further notice
Can optionally be constrained
Ex. \documentclass,\small
Environments. . .
Have matching begin and end declarations
Must be constrained
Ex. \begin{document}...\end{document}
Introduction to L
A
T
E
X
A Basic Document
Writing LaTeX Code
Arguments
Required arguments. . .
Are contained in curly braces
Must be included
Ex. \documentclass{article}
Optional arguments. . .
Are contained in square brackets
Can be left out
Give you more control over the commands
Ex. \documentclass[12pt]{article}
Introduction to L
A
T
E
X
A Basic Document
Writing LaTeX Code
Special Characters
Another type of command
Don’t define any formatting or structure
Print non-standard characters or characters which usually
mean something else
Ex. \LaTeX,\textbackslash,\%
Note: % is a special character reserved for comments (after a %,
the rest of a line is ignored by the compiler)
Introduction to L
A
T
E
X
A Basic Document
Writing LaTeX Code
Packages
Packages allow you to further customize L
A
T
EX.
The command:
\usepackage{name}
Some packages:
graphicx, epsfig, geometry, fancyhdr, setspace, amsmath, listings,
xcolor, url. . .
Most of the packages you’ll need are already included in the
template
Introduction to L
A
T
E
X
A Basic Document
Basic Formatting
Font Types
Font face:
\emph{Text},\textbf{Text},\texttt{Text},\textrm{Text},
\textsf{Text},\textsc{Text}
Font size:
{\tiny Text},{\scriptsize Text},{\footnotesize Text},
{\small Text},{\normalsize Text},{\large Text},{\Large
Text},{\LARGE Text},{\huge Text},{\Huge Text}
Alignment:
\begin{center/flushright/flushleft}
...
\end{center/flushright/flushleft}
Introduction to L
A
T
E
X
A Basic Document
Basic Formatting
Spacing
Margins
The default: between 1.5 inches and 1.875 inches
Setting margins: \usepackage[margin=0.5in]{geometry}
Paragraphs and other breaks
Paragraphs are separated by a blank line.
You can force a new line using \\
To force a new page, use \newpage or \clearpage
Other spacing
Force a space using ∼
Add space using \hspace{1in}or \vspace{1in}
Fill space using \hfill or \vfill
Introduction to L
A
T
E
X
L
A
T
E
X and You
The Files
The RSI File Structure
In your MiniPaper or Paper directory, you’ll notice several files. . .
main.tex brings everything together, don’t edit it
preamble.tex contains any additional packages or macros
cover.tex contains the cover information (title, author, etc.)
abstract.tex and summary.tex contain the text of your
scientific abstract and executive summary, respectively
paper.tex contains the main body of your paper, including
any and all figures, tables, etc.
biblio.bib is a BibT
EX file containing your references
appa.tex contains the text of any appendices you may have
Compile using make main.pdf
Introduction to L
A
T
E
X
L
A
T
E
X and You
The Files
The Title Page
cover.tex is where you define the content of your title page
It includes declarations of the title,author, and date
You should replace the title and author as needed, but leave
the date alone
\title{Length-enhanced superlative verbiage}
\author{Joe Everystudent
\vspace{0.5in}\\
under the direction of\\
Dr. Famous Person\\
Massachusetts Institute of Technology
\vspace{1in}}
The title page is created automatically using the maketitle
command in main.tex
Introduction to L
A
T
E
X
L
A
T
E
X and You
The Files
Abstract and Summary
The minipaper only has an abstract
Your final paper will have both a technical abstract and a
non-technical summary
All you need to do is fill in the text, and the template takes
care of the rest
Behind the Scenes
\begin{abstract}
\input{abstract}
\vspace{1in}
\begin{center}\textbf{Summary}\end{center}
\input{summary}
\end{abstract}
Introduction to L
A
T
E
X
L
A
T
E
X and You
The Files
Bibliography
biblio.bib acts as a database of references, and only includes in
the bibliography those references you cite in your paper
BibT
EX
@article{nameofentry,
author = {John Backus},
title = {Symmetric Encryption},
journal = {Journal of Modalities},
volume = 46,
year = 1993,
number = 2,
pages = {44--57}
}
A more complete list of examples can be found at
web.mit.edu/rsi/www/pdfs/bibtex-format.pdf
Introduction to L
A
T
E
X
L
A
T
E
X and You
Math Mode
Some Commands
974 $974$
4+2 $4+2$
3
√5$\sqrt[3]{5}$
x
y$\frac{x}{y}$
Ax
y$A^{x} {y}$
Pn
k=1 k$\sum {k=1}^n k$
26= 4 $2 \ne 4$
φ∈Ψ$\phi \in \Psi$
ˆı ׈ = ˆ
k$\hat{\i} \times \hat{\j}=\hat{k}$
f00(ξ)$f’’(\xi)$
CH3COOH CH$ 3$COOH
180◦C180$^{\circ}$C
...runs in $\Theta(\log n)$ time...
Introduction to L
A
T
E
X
L
A
T
E
X and You
Math Mode
Math symbols resources
Detexify: http://detexify.kirelabs.org
Draw a symbol, Detexify tells you a bunch of possible
L
A
T
E
Xsymbols
AoPS symbols: http://www.artofproblemsolving.com
/wiki/index.php/LaTeX:Symbols
Also has lots of other L
A
T
E
Xresources
RSI Website (go to “Tech help”)
Introduction to L
A
T
E
X
L
A
T
E
X and You
Figures and Tables
Formatting Tables
The table environment defines the figure style. The tabular
environment defines the table itself.
\section{Related Work}
\begin{table}[ht]
\centering
\begin{tabular}{|r||c|c|} \hline
Trial & $n$ & $t$ \\ \hline
1&23&2\\ \hline
2&15&10\\ \hline
3 & 100 & 20 \\ \hline
\end{tabular}
\end{table}
Trial n t
1 23 2
2 15 10
3 100 20
Introduction to L
A
T
E
X
Beamer
Beamer at RSI
We have a template for this too! It’s in the file slides.tex
Title Slide
Be sure to fill in the title, subtitle (if necessary) and author
\title{Witty catch-phrase}
\subtitle{Length-enhanced superlative verbiage}
\author[Joe Everystudent]{Joe Everystudent\\
Research Science Institute\\
Under the Direction of Dr. Famous Person\\
Massachusetts Institute of Technology}
The template already includes a title slide!
Introduction to L
A
T
E
X
Beamer
Animation
You can also do some basic animation in beamer.
\pause puts a pause before revealing the rest of the slide
command<num-num>makes the command apply only for
some number of the “frames”
The previous bullet is defined by \item<3-4>
The bullet disappears after the fourth “frame”
Introduction to L
A
T
E
X
Beamer
Animation
You can also do some basic animation in beamer.
\pause puts a pause before revealing the rest of the slide
command<num-num>makes the command apply only for
some number of the “frames”
The previous bullet is defined by \item<3-4>
The bullet disappears after the fourth “frame”
Introduction to L
A
T
E
X
Beamer
Animation
You can also do some basic animation in beamer.
\pause puts a pause before revealing the rest of the slide
command<num-num>makes the command apply only for
some number of the “frames”
The previous bullet is defined by \item<3-4>
The bullet disappears after the fourth “frame”
Introduction to L
A
T
E
X
Beamer
Animation
You can also do some basic animation in beamer.
\pause puts a pause before revealing the rest of the slide
command<num-num>makes the command apply only for
some number of the “frames”
The previous bullet is defined by \item<3-4>
The bullet disappears after the fourth “frame”
Introduction to L
A
T
E
X
Beamer
Animation
You can also do some basic animation in beamer.
\pause puts a pause before revealing the rest of the slide
command<num-num>makes the command apply only for
some number of the “frames”
The previous bullet is defined by \item<3-4>
The bullet disappears after the fourth “frame”
Introduction to L
A
T
E
X
Conclusion
So, why L
A
T
E
X?
L
A
T
EX allows you to worry about the content and the
structure, rather than the presentation.
L
A
T
EX has one of the most advanced math typesetting systems
around.
L
A
T
EX is incredibly extendible.
L
A
T
EX keeps track of references so you don’t have to.
L
A
T
EX allows you to make more consistent, and more easily
changeable, documents.
Introduction to L
A
T
E
X
Conclusion
Getting Help and Learning More
L
A
T
EX Wikibooks:
en.wikibooks.org/wiki/LaTeX
The Not So Short Introduction to L
A
T
E
X 2ε:
www.ctan.org/tex-archive/info/lshort/english/lshort.
pdf
A Short Math Guide for L
A
T
E
X:
ftp:
//ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf
The Beamer Theme Matrix:
www.hartwork.org/beamer-theme-matrix/
Google is still your best friend!