A collection of useful latex tips for writing scientific papers and reports. I’ll keep updating this page as I learn new tricks!
\newcommand{\cO}{\mathcal O}
$$ ... $$
is deprecated, use \[ ... \]
instead.the variable~$x$
instead of the variable $x$
, so that latex will try to keep “variable” and “x” on the same line.%==============================================================================
\section{Section Name} \label{sec:one}
%==============================================================================
Some text here...
%------------------------------------------------------------------------------
\subsection{Subsection} \label{sec:oneone}
%------------------------------------------------------------------------------
Some text here...
\cref
instead of \ref
for smarter ref. names. (import with \usepackage{cleveref}
)\Cref
at the beginning of sentences and \cref
in the middle.
\Cref
forces things to be unabbreviated (eg. “Equation” instead of “Eq.”)\label{sec:some-section}
\label{subsec:some-subsection}
\label{eq:some-equation}
\label{tab:some-table}
\label{fig:some-figure}
Overleaf has some great tutorials for latex.
Most of these tips are taken from my advisor Michael Walter. I also want to thank Harold for explaining some of these.