LaTeX Reference Hub & Overview
Welcome to the Andromeda LaTeX Reference Hub. Use the top-left search box to jump directly to any command, or browse the specialized category modules below.
Document Structure & Preamble
Comprehensive syntax, arguments, options, and copyable snippets for document structure & preamble.
\documentclass{class}
Declares the document class (article, report, book, letter, beamer, etc.)
Document Classes & Options:
• Classes: article (papers/essays), report (theses with chapters), book (two-sided books), beamer (slides).
• Font Sizes: 10pt, 11pt, 12pt.
• Paper Sizes: a4paper, letterpaper.
• Layouts: twocolumn, onecolumn, titlepage, draft, final.
\documentclass{article}
\usepackage{package}
Loads a package
\usepackage{amsmath}
\usepackage[options]{package}
Loads a package with options
\usepackage[utf8]{inputenc}
\begin{document}
Starts the document body
\begin{document}
\end{document}
Ends the document body
\end{document}
\title{text}
Sets the document title
\title{A Study of Light Scattering}
\author{text}
Sets the document author(s)
\author{Deb}
\date{text}
Sets the document date
\date{\today}
\maketitle
Typesets the title block
\maketitle
\newcommand{\name}[n]{def}
Defines a new command with n arguments
\newcommand{\vect}[1]{\mathbf{#1}}
\renewcommand{\name}[n]{def}
Redefines an existing command
\renewcommand{\arraystretch}{1.5}
\providecommand{\name}{def}
Defines a command only if not already defined
\providecommand{\eps}{\varepsilon}
\newenvironment{name}{begin}{end}
Defines a new environment
\newenvironment{note}{\begin{quote}\itshape}{\end{quote}}
\renewenvironment{name}{begin}{end}
Redefines an existing environment
\renewenvironment{abstract}{\small}{}
\input{file}
Inserts contents of another file
\input{chapter1}
\include{file}
Includes another file (starts new page)
\include{chapter2}
\includeonly{file1,file2}
Restricts which \include files are processed
\includeonly{chapter1,chapter3}
\newpage
Starts a new page
\newpage
\clearpage
Flushes floats and starts a new page
\clearpage
\cleardoublepage
Clears page, ensures next page is odd-numbered
\cleardoublepage
\pagebreak
Suggests a page break
\pagebreak
\nopagebreak
Suggests no page break
\nopagebreak
\linebreak
Suggests a line break
\linebreak
\nolinebreak
Suggests no line break
\nolinebreak
\pagestyle{style}
Sets the page style (plain, empty, headings, fancy)
\pagestyle{fancy}
\thispagestyle{style}
Sets page style for current page only
\thispagestyle{empty}
\pagenumbering{style}
Sets page numbering style (arabic, roman, alph)
\pagenumbering{roman}
Document Hierarchy & Sectioning
Comprehensive syntax, arguments, options, and copyable snippets for document hierarchy & sectioning.
\part{title}
Top-level sectioning (books/reports)
\part{Introduction}
\chapter{title}
Chapter heading (report/book classes)
\chapter{Light Scattering Theory}
\section{title}
Section heading
Sectioning Hierarchy: \part (-1) → \chapter (0) → \section (1) → \subsection (2) → \subsubsection (3) → \paragraph (4) → \subparagraph (5). Automatically increments numbering, updates running headers, and registers in the Table of Contents. Use \section[Short Title]{Full Title} for compact TOC entries.
\section{Methodology}
\subsection{title}
Subsection heading
\subsection{Sample Preparation}
\subsubsection{title}
Sub-subsection heading
\subsubsection{Calibration}
\paragraph{title}
Paragraph-level heading
\paragraph{Note.}
\subparagraph{title}
Sub-paragraph-level heading
\subparagraph{Remark.}
\section*{title}
Unnumbered section heading
Unnumbered Section: Suppresses section numbering and omits the heading from the Table of Contents by default (ideal for Acknowledgments, Forewords, or References).
\section*{Acknowledgments}
\appendix
Switches sectioning to appendix numbering
\appendix
\tableofcontents
Generates table of contents
\tableofcontents
\listoffigures
Generates list of figures
\listoffigures
\listoftables
Generates list of tables
\listoftables
\addcontentsline{file}{unit}{text}
Manually adds an entry to a TOC-like list
\addcontentsline{toc}{section}{References}
\addtocontents{file}{text}
Adds text directly to a TOC-like file
\addtocontents{toc}{\protect\newpage}
Math Modes & Formulas
Comprehensive syntax, arguments, options, and copyable snippets for math modes & formulas.
$ ... $
Inline math mode
The energy is $E=mc^2$.
\( ... \)
Inline math mode (alternative)
The energy is \(E=mc^2\).
$$ ... $$
Display math mode (plain TeX style)
$$E = mc^2$$
\[ ... \]
Display math mode (LaTeX style)
\[E = mc^2\]
\frac{num}{den}
Fraction
Fraction: Typesets fraction. In display math use \dfrac for full size, in inline text use \tfrac for compact size.
$\frac{1}{2}$
\dfrac{num}{den}
Display-style fraction (amsmath)
$\dfrac{1}{2}$
\tfrac{num}{den}
Text-style fraction (amsmath)
$\tfrac{1}{2}$
\sqrt{x}
Square root
$\sqrt{2}$
\sqrt[n]{x}
nth root
Radical / N-th Root: Computes radical symbol. Optional [n] specifies root degree.
$\sqrt[3]{8}$
\sum
Summation symbol
$\sum_{i=1}^{n} i$
\prod
Product symbol
$\prod_{i=1}^{n} i$
\int
Integral symbol
$\int_0^1 x^2\,dx$
\iint
Double integral (amsmath)
$\iint_D f(x,y)\,dA$
\iiint
Triple integral (amsmath)
$\iiint_V f\,dV$
\oint
Contour integral
$\oint_C \vec{F}\cdot d\vec{r}$
\lim
Limit operator
$\lim_{x\to 0} \frac{\sin x}{x}$
\limsup
Limit superior
$\limsup_{n\to\infty} a_n$
\liminf
Limit inferior
$\liminf_{n\to\infty} a_n$
\sup
Supremum operator
$\sup_{x \in S} f(x)$
\inf
Infimum operator
$\inf_{x \in S} f(x)$
\max
Maximum operator
$\max(a,b)$
\min
Minimum operator
$\min(a,b)$
\log
Logarithm operator
$\log_{10} x$
\ln
Natural logarithm operator
$\ln x$
\exp
Exponential operator
$\exp(x)$
\sin
Sine function
$\sin\theta$
\cos
Cosine function
$\cos\theta$
\tan
Tangent function
$\tan\theta$
\cot
Cotangent function
$\cot\theta$
\sec
Secant function
$\sec\theta$
\csc
Cosecant function
$\csc\theta$
\arcsin
Arcsine function
$\arcsin x$
\arccos
Arccosine function
$\arccos x$
\arctan
Arctangent function
$\arctan x$
\sinh
Hyperbolic sine
$\sinh x$
\cosh
Hyperbolic cosine
$\cosh x$
\tanh
Hyperbolic tangent
$\tanh x$
\det
Determinant operator
$\det(A)$
\dim
Dimension operator
$\dim(V)$
\gcd
Greatest common divisor operator
$\gcd(a,b)$
\deg
Degree operator
$\deg(p)$
\hom
Hom operator
$\hom(A,B)$
\ker
Kernel operator
$\ker(T)$
\Pr
Probability operator (amsmath)
$\Pr(X > 0)$
x^{a}
Superscript
$x^{2}$
x_{a}
Subscript
$x_{i}$
\overline{x}
Overline
$\overline{x}$
\underline{x}
Underline (math mode)
$\underline{x}$
\overbrace{x}
Overbrace
$\overbrace{a+b+c}^{\text{sum}}$
\underbrace{x}
Underbrace
$\underbrace{a+b+c}_{\text{sum}}$
\overrightarrow{x}
Right arrow over text (vectors)
$\overrightarrow{AB}$
\overleftarrow{x}
Left arrow over text
$\overleftarrow{AB}$
\hat{x}
Hat accent
$\hat{x}$
\widehat{x}
Wide hat accent
$\widehat{xyz}$
\bar{x}
Bar accent
$\bar{x}$
\vec{x}
Vector arrow accent
$\vec{v}$
\dot{x}
Dot accent (derivative)
$\dot{x}$
\ddot{x}
Double dot accent (second derivative)
$\ddot{x}$
\tilde{x}
Tilde accent
$\tilde{x}$
\widetilde{x}
Wide tilde accent
$\widetilde{xyz}$
\mathbb{X}
Blackboard bold (amssymb)
$\mathbb{R}$
\mathcal{X}
Calligraphic letters
$\mathcal{L}$
\mathfrak{X}
Fraktur letters (amssymb)
$\mathfrak{g}$
\mathrm{x}
Roman (upright) math text
$\mathrm{d}x$
\mathbf{x}
Bold math text
$\mathbf{v}$
\mathit{x}
Italic math text
$\mathit{abc}$
\mathsf{x}
Sans-serif math text
$\mathsf{abc}$
\mathtt{x}
Typewriter math text
$\mathtt{abc}$
\boldsymbol{x}
Bold math symbol (amsmath/bm)
$\boldsymbol{\alpha}$
\text{text}
Text inside math mode (amsmath)
$x = 5 \text{ meters}$
\left(
Auto-sized left parenthesis
$\left(\frac{a}{b}\right)$
\right)
Auto-sized right parenthesis
$\left(\frac{a}{b}\right)$
\left[
Auto-sized left bracket
$\left[\frac{a}{b}\right]$
\right]
Auto-sized right bracket
$\left[\frac{a}{b}\right]$
\left\{
Auto-sized left brace
$\left\{\frac{a}{b}\right\}$
\right\}
Auto-sized right brace
$\left\{\frac{a}{b}\right\}$
\left|
Auto-sized left vertical bar
$\left|\frac{a}{b}\right|$
\right|
Auto-sized right vertical bar
$\left|\frac{a}{b}\right|$
\big(
Manually sized parenthesis (big)
$\big(x\big)$
\Big(
Manually sized parenthesis (Big)
$\Big(x\Big)$
\bigg(
Manually sized parenthesis (bigg)
$\bigg(x\bigg)$
\Bigg(
Manually sized parenthesis (Bigg)
$\Bigg(x\Bigg)$
\nonumber
Suppresses equation numbering on a line
\begin{align}
x &= y \nonumber
\end{align}
\notag
Suppresses equation numbering (amsmath)
\begin{align}
x &= y \notag
\end{align}
\label{key}
Assigns a label for cross-referencing
Label Anchor Placement: Must be placed after (or inside) \caption{...} for figures and tables, or inside an equation, so \ref{key} retrieves the correct counter.
\label{eq:energy}
\tag{text}
Custom equation tag (amsmath)
\begin{equation}
E=mc^2 \tag{A}
\end{equation}
Tables & Floating Figures
Comprehensive syntax, arguments, options, and copyable snippets for tables & floating figures.
\hline
Horizontal line across a table
\begin{tabular}{cc}
\hline
A & B \\
\hline
\end{tabular}
\cline{i-j}
Partial horizontal line spanning columns i to j
\cline{1-2}
\multicolumn{n}{cols}{text}
Merges n columns in a table row
\multicolumn{2}{c}{Merged Header}
\multirow{n}{width}{text}
Merges n rows in a table column (multirow package)
\multirow{2}{*}{Merged Cell}
\toprule
Top rule line (booktabs)
Booktabs Heavy Top Rule: Replaces \hline at the table header top with a professional publication-grade rule.
\begin{tabular}{cc}
\toprule
A & B \\
\end{tabular}
\midrule
Middle rule line (booktabs)
Booktabs Middle Rule: Thin horizontal divider separating table headers from data rows.
\midrule
\bottomrule
Bottom rule line (booktabs)
Booktabs Heavy Bottom Rule: Clean closing horizontal rule at the table bottom.
\bottomrule
\caption{text}
Adds a caption to a figure or table
\caption{Scattering intensity vs. angle.}
\includegraphics{file}
Inserts an image (graphicx)
\includegraphics{scattering_plot.png}
\includegraphics[options]{file}
Inserts an image with sizing/rotation options
Key Image Options:
• width=0.8\textwidth (relative width)
• height=5cm (explicit height)
• scale=0.5 (scaling factor)
• angle=90 (rotation in degrees)
• keepaspectratio (prevents aspect ratio distortion)
• trim=10 20 10 20, clip (crops image boundaries).
\includegraphics[width=0.8\textwidth]{scattering_plot.png}
\centering
Centers a figure or table content
\centering
\hfill
Horizontal fill/stretch space
Left\hfill Right
\vfill
Vertical fill/stretch space
\vfill