Equations and Numbering
Simply speaking:
- use the environment
align
instead ofequation
andeqnarray
to display equations. - put
align
blocks inside asubequations
environment if subnumbers are required. - use
aligned
to break a single long equation with a single number into multiple lines. - put
\nonumber
before an equation if that equation does not need to be numbered. usealign*
if no equations need to be numbered.
Environments align
and aligned
are defined in package amsmath.
Examples:
- A single equation
\begin{align}
\label{eq:massEnergyRelation}
E=mc^2
\end{align}
- multiple equations
\begin{align}
E=&\hbar\Omega\\
\vec p =& \hbar\vec k
\end{align}
- multiple equations with subnumbers
\begin{subequations}
\begin{align}
\nonumber\dod{p_j}{t}&=-\dpd{\mathcal H}{q_j}\\
\dod{q_j}{t}&=+\dpd{\mathcal H}{p_j}
\end{align}
\end{subequations}
- A long equation broken into two lines
\begin{align}
\begin{aligned}
M = &\sum_n e^{in\theta}\ket{N-n, n}\bra{N-n, n} = \\
&\sum_l e^{i (N/2-l)\theta}\ket{l}\bar{l}
\end{aligned}
\end{align}
Derivatives
Use packages physics and esdiff.
% those commands are from package physics
\dd x % differential
\dd[n] x % higher order differential
\dv{f}{x} % derivative df/dx
\dv[n]{f}{x} % higher order derivative
\pdv{f}{x} % partial derivative
\pdv[n]{f}{x} % higher order partial derivative
\pdf{f}{x}{y} % mixed partial derivative
% the command below is from package esdiff
\diffp*{p}{V}{T} % partial derivative of p relative to V with T fixed.
Figures
- Insert a single figure
\usepackage{graphicx} % should be put in the preamble
\begin{figure}
\centering
\includegraphics[width=\textwidth]{{y=x+0.1}.pdf} % pay attention to the filename
\caption{$U/t=0.1$}
\label{fig:y=x+0.1}
\end{figure}
- Insert multiple figures with subcaptions respectively
\usepackage{graphicx} % should be put in the preamble
\usepackage{subcaption} % should be put in the preamble
\begin{figure}
\centering
\begin{subfigure}[b]{0.48\textwidth}
\centering
\includegraphics[width=\textwidth]{{analyticalResults}.pdf}
\caption{Analytical Results}
\label{fig:analyticalResults}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\textwidth}
\centering
\includegraphics[width=\textwidth]{{imageFromExperiments}.eps}
\caption{Image From Experiments}
\label{fig:experimentalFigure}
\end{subfigure}
\caption{Analytical and experimental results.}
\label{fig:analyticalAndExperimental}
\end{figure}
File names of images should be written as {filename}.eps
in case there are some special characaters, like .
, in the filename
part.