Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
LATEXInstallation and Introduction
Andrew McAllister
Society of Physics Students
September 21st, 2011
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 1 / 22
What is LATEX?
LATEXis a typesetting system that is considered the “standard” for writingscientific papers - especially those with a lot of math.
Consider the following example:
OR:
\int_a^b f(x) dx = \lim_{n\rightarrow\infty} \sum_{n=1}^n f(c_i) \Delta x_i
∫ b
af (x)dx = lim
n→∞
n∑n=1
f (ci )∆xi
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 2 / 22
What is LATEX?
LATEXis a typesetting system that is considered the “standard” for writingscientific papers - especially those with a lot of math.
Consider the following example:
OR:
\int_a^b f(x) dx = \lim_{n\rightarrow\infty} \sum_{n=1}^n f(c_i) \Delta x_i
∫ b
af (x)dx = lim
n→∞
n∑n=1
f (ci )∆xi
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 2 / 22
What You Need to Run LATEX
A LATEXDistribution
An Editor
A Document Viewer
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 3 / 22
LATEXDistribution - Miktex
The most common distribution is Miktex which can be found atmiktex.org.
Miktex also easily installs packages for you.
Examples:
AMS Math Packages
Resume Packages
TikZ and PGF. . .
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 4 / 22
LATEXDistribution - Miktex
The most common distribution is Miktex which can be found atmiktex.org.
Miktex also easily installs packages for you.
Examples:
AMS Math Packages
Resume Packages
TikZ and PGF. . .
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 4 / 22
. . . Which does things like this:
ITEMname
COMPONENT
nil
SYSTEM
parts
SENSOR
nil
PART
nil
Pressure
nil
Temperature
nil
Instants
fw-p-suctionfw-p-deliveryfw-p-loopsw-p-suctionsw-p-deliverysw-p-loop
Closed/Open
nil
Instants
fw-clop-warm-upsw-clop-control
Instants
fw-t-enginefw-t-heat-exch.sw-t-heat-exch.
Level
nil
Instants
fw-l-tank
Ammeter
nil
Instants
fw-pump-ammetersw-pump-ammeter
Pump
nil
Valve
nil
Instants
fw-pumpsw-pump
Tank
nil
Instants
fw-suction-valvefw-delivery-valvesw-suction-valvesw-delivery-valvesw-discharge-valvesw-control-valve
Engine
nil
Instants
fw-expansion-tank
Heat Exchanger
nil
Instants
fw-heat-exchanger
Instants
fw-engine
Strainer
nil
Instants
sw-strainer
Coolant
nil
Instants
fw-coolantsw-coolant
Cooling System
nil
Cooling Loop
nil
Instants
cool
Instants
fw-loopsw-loop
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 5 / 22
LATEXEditor - TeXnic Center
We’ve got a lot of choices here, why use TeXnic Center?
Easy to install
Lots of features to help new users
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 6 / 22
LATEXViewer
This is the easy one you all already have Acrobat installed on yourcomputers.
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 7 / 22
Actually Writing a LATEXDocument!
The Basic Structure
\documentclass[11pt]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}
\begin{document}
\end{document}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 8 / 22
Actually Writing a LATEXDocument!
The Basic Structure
\documentclass[11pt]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}
\begin{document}
\end{document}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 8 / 22
Regular Text
\begin{document}
\title{Your Title}
\author{You}
\date{The Date}
\maketitle
\tableofcontents
\section{Stuff}
To write regular text, just write wherever you want
it to appear.
\subsection{More Stuff}
\subsubsection{Even More Stuff}
\end{document}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 9 / 22
What does that look like?
Your Title
You
The Date
Contents
1 Stuff 11.1 More Stuff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Even More Stuff . . . . . . . . . . . . . . . . . . . . . 1
1 Stuff
To write regular text, just write wherever you want it to appear.
1.1 More Stuff
1.1.1 Even More Stuff
1
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 10 / 22
Including Math (the important thing)
There are two things that you need to know:
Commands are always started with a backslash
“Math Mode” - Inline math mode is surrounded by: \( MATH \)Separate line math mode is surrounded by: \[ MATH \]
NOTE: Some people use $ to and $$ for math mode. I think this is weirdlooking and prefer to use paranthesis and brackets, but you can use either.
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 11 / 22
Including Math (the important thing)
There are two things that you need to know:
Commands are always started with a backslash
“Math Mode” - Inline math mode is surrounded by: \( MATH \)Separate line math mode is surrounded by: \[ MATH \]
NOTE: Some people use $ to and $$ for math mode. I think this is weirdlooking and prefer to use paranthesis and brackets, but you can use either.
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 11 / 22
Some Basic Math Commands
Greek Letters: Just use \LETTER\lambda = λ \ Lambda = Λ
Del is called nabla: \nabla = ∇Integrals and Sums: \int and \sum
Upper and Lower “Things”: Upper - L̂ower -
Trig Functions: \sin,cos etc.
Fractions: \frac{}{}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands
Greek Letters: Just use \LETTER\lambda = λ \ Lambda = Λ
Del is called nabla: \nabla = ∇Integrals and Sums: \int and \sum
Upper and Lower “Things”: Upper - L̂ower -
Trig Functions: \sin,cos etc.
Fractions: \frac{}{}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands
Greek Letters: Just use \LETTER\lambda = λ \ Lambda = Λ
Del is called nabla: \nabla = ∇
Integrals and Sums: \int and \sum
Upper and Lower “Things”: Upper - L̂ower -
Trig Functions: \sin,cos etc.
Fractions: \frac{}{}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands
Greek Letters: Just use \LETTER\lambda = λ \ Lambda = Λ
Del is called nabla: \nabla = ∇Integrals and Sums: \int and \sum
Upper and Lower “Things”: Upper - L̂ower -
Trig Functions: \sin,cos etc.
Fractions: \frac{}{}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands
Greek Letters: Just use \LETTER\lambda = λ \ Lambda = Λ
Del is called nabla: \nabla = ∇Integrals and Sums: \int and \sum
Upper and Lower “Things”: Upper - L̂ower -
Trig Functions: \sin,cos etc.
Fractions: \frac{}{}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands
Greek Letters: Just use \LETTER\lambda = λ \ Lambda = Λ
Del is called nabla: \nabla = ∇Integrals and Sums: \int and \sum
Upper and Lower “Things”: Upper - L̂ower -
Trig Functions: \sin,cos etc.
Fractions: \frac{}{}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Some Basic Math Commands
Greek Letters: Just use \LETTER\lambda = λ \ Lambda = Λ
Del is called nabla: \nabla = ∇Integrals and Sums: \int and \sum
Upper and Lower “Things”: Upper - L̂ower -
Trig Functions: \sin,cos etc.
Fractions: \frac{}{}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 12 / 22
Basic Formatting - 1
Text Sizes
1 \tiny
2 \scriptsize
3 \footnotesize
4 \small
5 \normalsize
6 \large
7 \Large
8 \LARGE
9 \huge
10 \HUGE
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 13 / 22
Basic Formatting - 2
Font Emphasis
Bold - \textbf{}Italic - \emph{}
Breaks
Line Break \newline
Page Break \newpage
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 14 / 22
Basic Formatting - 3
Making Lists These are contained in environments -
\begin{itemize}
\item
\end{itemize}
Instead of itemize you can have enumerate or description.
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 15 / 22
Tables
Tables are contained in the Table Environment:
\begin{table}[H]
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
& \textbf{Outgoing Officers (2010-2011)} & \textbf{Incoming Officers (2011-2012)} \\\hline
\textbf{President} & Andrew McAllister & Charles Martin \\\hline
\textbf{Vice President} & Joe Paki & Krysta Boccuzzi \\\hline
\textbf{Secretary/Treasurer} & Charles Martin & Amy Lovell \\\hline
\textbf{Outreach Coordinater} & Allycia Gariepy & Ryan Roussel \\\hline
\end{tabular}
\end{center}
\end{table}
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 16 / 22
Example Table
Outgoing Officers (2010-2011) Incoming Officers (2011-2012)President Andrew McAllister Charles Martin
Vice President Joe Paki Krysta BoccuzziSecretary/Treasurer Charles Martin Amy Lovell
Outreach Coordinater Allycia Gariepy Ryan Roussel
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 17 / 22
Example Table 2
Outgoing Officers (2010-2011) Incoming Officers (2011-2012)President Andrew McAllister Charles Martin
Vice President Joe Paki Krysta BoccuzziSecretary/Treasurer Charles Martin Amy Lovell
Outreach Coordinater Allycia Gariepy Ryan Roussel
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 18 / 22
Figures
Inserting figures into documents is easy:
\begin{figure}[H]
\includegraphics[scale = .5]{FILENAME}
\end{figure}
Getting them where you want is NOT.The best advice I can give is to use [h!] or [H] after your begin figure ortable. This is telling Latex to put the figure HERE in the document.
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 19 / 22
Figures
Inserting figures into documents is easy:
\begin{figure}[H]
\includegraphics[scale = .5]{FILENAME}
\end{figure}
Getting them where you want is NOT.
The best advice I can give is to use [h!] or [H] after your begin figure ortable. This is telling Latex to put the figure HERE in the document.
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 19 / 22
Figures
Inserting figures into documents is easy:
\begin{figure}[H]
\includegraphics[scale = .5]{FILENAME}
\end{figure}
Getting them where you want is NOT.The best advice I can give is to use [h!] or [H] after your begin figure ortable. This is telling Latex to put the figure HERE in the document.
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 19 / 22
Common Warning/Error Messages
Overfull or Underfull Boxes - Not that big of a deal.
“I can’t write on file. . . ” - You have the pdf open, it can’t be made unlessyou close it.
File ended while scanning the use of. . . - You didn’t close a curly bracket orforgot to end an environment.
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 20 / 22
Some Packages/Other Interesting Things
amssymbamsmathamsfontsGraphicxBibTexBeamer
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 21 / 22
What Next?
I have a few books on starting latex that I can give to you/put online. Ialso can give some example documents to look at.
If there is interest I can do some more advanced subjects.
Don’t forget - lots of upperclassmen use LaTeX and can help. Also, theinternet has the answer to 99% of your questions about Latex.
Andrew McAllister (SPS) LATEXIntro September 21st, 2011 22 / 22