Christina Lee
Skill Pill
January 21, 2016
The basis for MathJax
Markdown uses
Packages for Today
$ $
\[ \]
\begin{equation}
\end{equation}
Good for inline
Beware!
You need to close the environment! Else LaTeX will be mad
Unnumbered equations
Numbered Equations
\[ f(x) = a x + b \]
Elementary Additions
Subscripts and Superscripts
x_a
x^a
e^{ikx}
e^ikx
Beware!
You need brackets if the sub/super script contains more than one character
Elementary Additions
Greek Letters
\alpha
\pi
\Psi
\epsilon
\varepsilon
Elementary Additions
Simple Functions
\frac{a}{b}
\sqrt{x+y}
\sqrt[n]{x+y}
2 \pm 1 \geq 0
Elementary Additions
Simple Functions
\cos \theta
\sin \theta
\mathrm{e}^{-t/\tau}
\vec{x} \cdot \vec{y}
1 \neq 2
Elementary Additions
Simple Functions
\int\limits_{0}^{\infty} f(x) \mathrm{d}x
Get the d to stand up
Get the limits above the integration sign
Infinity
Elementary Additions
Parentheses
\left( \frac{x+y}{2} +
\left( z \right) \right)
( \big( \Big( \bigg( \Bigg(
Danger!
\left( f(x) = a x +b
makes LaTeX very angry!
Intro Debugging Checklist
\]
x+
a
\]
makes LaTeX
mad
Finding out how to do something
On Mac
write snippits of LaTeX and drop them into presentations
First Problems Break!
Matrices
\begin{matrix}
1 & 0 \\
0 & 1
\end{matrix}
Next Column
Next Row
Matrices
\begin{matrix}
1 & 0 \\
0 & 1
\end{matrix}
\sigma^y =
\begin{pmatrix}
0 & -i \\
i & 0
\end{pmatrix}
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
Math Fonts
\mathrm{ABC def}
\mathit{ABC def}
\mathbf{ABC def}
\mathfrak{ABC def}
\mathcal{ABC def}
\mathbb{ABC def}
requires mathsymb or amsfonts
Multi-Line Environment
\begin{align}
f(x) =& 1+ x^2 + x^3 \\
&+x^4 + x^5
\end{align}
Multi-Line Environment
\begin{align}
f(x) =& 1+ x^2 + x^3 \nonumber \\
&+x^4 + x^5
\end{align}
Multi-Line Environment
\begin{subequations}
Maxwell's Equations
\begin{align}
B &= - \nabla \times E \\
E &= \nabla \times B - 4 \pi j
\end{align}
\end{subequations}
Multi-Line Environment
\Theta(x)=
\begin{cases}
0 & \text{if } x<0 \\
1 & \text{if } x\geq 0
\end{cases}
Boxed
\boxed{
\cal{H} = \frac{\hbar^2}{2m}\nabla^2 + V(x,y)
}
Second Problem Break
For A Cookie!
Yes ;) That's part of my research notes right now.
Use the package graphicx
Available image types
Our first image!
\includegraphics{picture.jpg}
Now a better version!
\includegraphics[width=\textwidth]{picture.jpg}
\includegraphics[scale=0.5]{picture.jpg}
Control how large you want the image.
I prefer width to scale.
Tables
\begin{tabular}{c c}
1 & 1 \\
2 & 2
\end{tabular}
My First Table!
Tables
\begin{tabular}{c c}
1 & 1 \\
2 & 2
\end{tabular}
Align to the center
Other options r or l
New Line.
Don't have one on the last line
New column
Tables
\begin{tabular}{|| c | c | c ||}
\hline
1 & 1 & 1 \\
2 & 2 & 2\\
\hline
\end{tabular}
Adds a horizontal line
Location of vertical lines
Tables
\begin{tabular}{| c | c |}
\multicolumn{2}{|c|}{Columns}\\
\hline
1 & 1 \\
2 & 2 \\
\end{tabular}
Span multiple columns
\multicolumn{number of columns}
{style}{text}
Yeah, Yeah, Yeah... But I don't want to write it out...
TexMaker
Internet
Matlab
Excel to LaTeX addon
A Basic Figure
\begin{figure}
\includegraphics
[width=\textwidth]
{picture.jpg}
\end{figure}
Now a better version!
\begin{figure}
\includegraphics
[width=\textwidth]
{picture.jpg}
\caption{An Image}
\label{FIRE}
\end{figure}
Adding a Caption
On To Two Images!
\begin{figure}
\begin{subfigure}{.5\textwidth}
\includegraphics[width=\textwidth]{bg4.jpg}
\caption{fire}
\label{FIRE}
\end{subfigure}
\begin{subfigure}{.5\textwidth}
\includegraphics[width=\textwidth]{dragon.jpg}
\caption{dragon}
\label{dragon}
\end{subfigure}
\caption{Two Images4}
\label{ims}
\end{figure}
Set the width of each figure block
Can label and caption individually
Requires package subcaption
Positioning on the page
\begin{figure}[!b]
\includegraphics[width=\textwidth]{pic.jpg}
\caption{A fantasy picture forced to the bottom}
\label{fig:picb}
\end{figure}
Location
on the page.
h | here |
---|---|
H | HERE!!!! |
b | bottom |
t | top |
p | float page |
! | I MEAN IT! |
Requires Float Package
Figure Wrapping
\begin{wrapfigure}{r}{.5\textwidth}
\includegraphics[width=.49\textwidth]{bg4.jpg}
\caption{A wrapped image}
\label{fig:wrap}
\end{wrapfigure}
Set the width of each figure block
Where on page
Can be r,l
i,o for twoside doc
Requires package wrapfig
\listoffigures
Referencing
\begin{equation}
\label{eq:myequation}
f(x) = a x+b
\end{equation}
Lets Reference Equation~\ref{eq:myequation}