Reference Hub

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

Document Structure & Preamble

Comprehensive syntax, arguments, options, and copyable snippets for document structure & preamble.

Command Mandatory { }

\documentclass{class}

Declares the document class (article, report, book, letter, beamer, etc.)

💡 Deep Dive Explanation & Options

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.

Example Code
\documentclass{article}
Command Mandatory { }

\usepackage{package}

Loads a package

Example Code
\usepackage{amsmath}
Command Mandatory { } Optional [ ]

\usepackage[options]{package}

Loads a package with options

Example Code
\usepackage[utf8]{inputenc}
Environment Mandatory { }

\begin{document}

Starts the document body

Example Code
\begin{document}
Command Mandatory { }

\end{document}

Ends the document body

Example Code
\end{document}
Command Mandatory { }

\title{text}

Sets the document title

Example Code
\title{A Study of Light Scattering}
Command Mandatory { }

\author{text}

Sets the document author(s)

Example Code
\author{Deb}
Command Mandatory { }

\date{text}

Sets the document date

Example Code
\date{\today}
Command

\maketitle

Typesets the title block

Example Code
\maketitle
Command Mandatory { } Optional [ ]

\newcommand{\name}[n]{def}

Defines a new command with n arguments

Example Code
\newcommand{\vect}[1]{\mathbf{#1}}
Command Mandatory { } Optional [ ]

\renewcommand{\name}[n]{def}

Redefines an existing command

Example Code
\renewcommand{\arraystretch}{1.5}
Command Mandatory { }

\providecommand{\name}{def}

Defines a command only if not already defined

Example Code
\providecommand{\eps}{\varepsilon}
Command Mandatory { }

\newenvironment{name}{begin}{end}

Defines a new environment

Example Code
\newenvironment{note}{\begin{quote}\itshape}{\end{quote}}
Command Mandatory { }

\renewenvironment{name}{begin}{end}

Redefines an existing environment

Example Code
\renewenvironment{abstract}{\small}{}
Command Mandatory { }

\input{file}

Inserts contents of another file

Example Code
\input{chapter1}
Command Mandatory { }

\include{file}

Includes another file (starts new page)

Example Code
\include{chapter2}
Command Mandatory { }

\includeonly{file1,file2}

Restricts which \include files are processed

Example Code
\includeonly{chapter1,chapter3}
Command

\newpage

Starts a new page

Example Code
\newpage
Command

\clearpage

Flushes floats and starts a new page

Example Code
\clearpage
Command

\cleardoublepage

Clears page, ensures next page is odd-numbered

Example Code
\cleardoublepage
Command

\pagebreak

Suggests a page break

Example Code
\pagebreak
Command

\nopagebreak

Suggests no page break

Example Code
\nopagebreak
Command

\linebreak

Suggests a line break

Example Code
\linebreak
Command

\nolinebreak

Suggests no line break

Example Code
\nolinebreak
Command Mandatory { }

\pagestyle{style}

Sets the page style (plain, empty, headings, fancy)

Example Code
\pagestyle{fancy}
Command Mandatory { }

\thispagestyle{style}

Sets page style for current page only

Example Code
\thispagestyle{empty}
Command Mandatory { }

\pagenumbering{style}

Sets page numbering style (arabic, roman, alph)

Example Code
\pagenumbering{roman}
Document Hierarchy & Sectioning

Document Hierarchy & Sectioning

Comprehensive syntax, arguments, options, and copyable snippets for document hierarchy & sectioning.

Command Mandatory { }

\part{title}

Top-level sectioning (books/reports)

Example Code
\part{Introduction}
Command Mandatory { }

\chapter{title}

Chapter heading (report/book classes)

Example Code
\chapter{Light Scattering Theory}
Command Mandatory { }

\section{title}

Section heading

💡 Deep Dive Explanation & Options

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.

Example Code
\section{Methodology}
Command Mandatory { }

\subsection{title}

Subsection heading

Example Code
\subsection{Sample Preparation}
Command Mandatory { }

\subsubsection{title}

Sub-subsection heading

Example Code
\subsubsection{Calibration}
Command Mandatory { }

\paragraph{title}

Paragraph-level heading

Example Code
\paragraph{Note.}
Command Mandatory { }

\subparagraph{title}

Sub-paragraph-level heading

Example Code
\subparagraph{Remark.}
Command Mandatory { }

\section*{title}

Unnumbered section heading

💡 Deep Dive Explanation & Options

Unnumbered Section: Suppresses section numbering and omits the heading from the Table of Contents by default (ideal for Acknowledgments, Forewords, or References).

Example Code
\section*{Acknowledgments}
Command

\appendix

Switches sectioning to appendix numbering

Example Code
\appendix
Command

\tableofcontents

Generates table of contents

Example Code
\tableofcontents
Command

\listoffigures

Generates list of figures

Example Code
\listoffigures
Command

\listoftables

Generates list of tables

Example Code
\listoftables
Command Mandatory { }

\addcontentsline{file}{unit}{text}

Manually adds an entry to a TOC-like list

Example Code
\addcontentsline{toc}{section}{References}
Command Mandatory { }

\addtocontents{file}{text}

Adds text directly to a TOC-like file

Example Code
\addtocontents{toc}{\protect\newpage}
Math Modes & Formulas

Math Modes & Formulas

Comprehensive syntax, arguments, options, and copyable snippets for math modes & formulas.

Math Mode

$ ... $

Inline math mode

Example Code
The energy is $E=mc^2$.
Math Mode

\( ... \)

Inline math mode (alternative)

Example Code
The energy is \(E=mc^2\).
Math Mode

$$ ... $$

Display math mode (plain TeX style)

Example Code
$$E = mc^2$$
Math Mode Optional [ ]

\[ ... \]

Display math mode (LaTeX style)

Example Code
\[E = mc^2\]
Math Mode Mandatory { }

\frac{num}{den}

Fraction

💡 Deep Dive Explanation & Options

Fraction: Typesets fraction. In display math use \dfrac for full size, in inline text use \tfrac for compact size.

Example Code
$\frac{1}{2}$
Math Mode Mandatory { }

\dfrac{num}{den}

Display-style fraction (amsmath)

Example Code
$\dfrac{1}{2}$
Math Mode Mandatory { }

\tfrac{num}{den}

Text-style fraction (amsmath)

Example Code
$\tfrac{1}{2}$
Math Mode Mandatory { }

\sqrt{x}

Square root

Example Code
$\sqrt{2}$
Math Mode Mandatory { } Optional [ ]

\sqrt[n]{x}

nth root

💡 Deep Dive Explanation & Options

Radical / N-th Root: Computes radical symbol. Optional [n] specifies root degree.

Example Code
$\sqrt[3]{8}$
Math Mode

\sum

Summation symbol

Example Code
$\sum_{i=1}^{n} i$
Math Mode

\prod

Product symbol

Example Code
$\prod_{i=1}^{n} i$
Math Mode

\int

Integral symbol

Example Code
$\int_0^1 x^2\,dx$
Math Mode

\iint

Double integral (amsmath)

Example Code
$\iint_D f(x,y)\,dA$
Math Mode

\iiint

Triple integral (amsmath)

Example Code
$\iiint_V f\,dV$
Math Mode

\oint

Contour integral

Example Code
$\oint_C \vec{F}\cdot d\vec{r}$
Math Mode

\lim

Limit operator

Example Code
$\lim_{x\to 0} \frac{\sin x}{x}$
Math Mode

\limsup

Limit superior

Example Code
$\limsup_{n\to\infty} a_n$
Math Mode

\liminf

Limit inferior

Example Code
$\liminf_{n\to\infty} a_n$
Math Mode

\sup

Supremum operator

Example Code
$\sup_{x \in S} f(x)$
Math Mode

\inf

Infimum operator

Example Code
$\inf_{x \in S} f(x)$
Math Mode

\max

Maximum operator

Example Code
$\max(a,b)$
Math Mode

\min

Minimum operator

Example Code
$\min(a,b)$
Math Mode

\log

Logarithm operator

Example Code
$\log_{10} x$
Math Mode

\ln

Natural logarithm operator

Example Code
$\ln x$
Math Mode

\exp

Exponential operator

Example Code
$\exp(x)$
Math Mode

\sin

Sine function

Example Code
$\sin\theta$
Math Mode

\cos

Cosine function

Example Code
$\cos\theta$
Math Mode

\tan

Tangent function

Example Code
$\tan\theta$
Math Mode

\cot

Cotangent function

Example Code
$\cot\theta$
Math Mode

\sec

Secant function

Example Code
$\sec\theta$
Math Mode

\csc

Cosecant function

Example Code
$\csc\theta$
Math Mode

\arcsin

Arcsine function

Example Code
$\arcsin x$
Math Mode

\arccos

Arccosine function

Example Code
$\arccos x$
Math Mode

\arctan

Arctangent function

Example Code
$\arctan x$
Math Mode

\sinh

Hyperbolic sine

Example Code
$\sinh x$
Math Mode

\cosh

Hyperbolic cosine

Example Code
$\cosh x$
Math Mode

\tanh

Hyperbolic tangent

Example Code
$\tanh x$
Math Mode

\det

Determinant operator

Example Code
$\det(A)$
Math Mode

\dim

Dimension operator

Example Code
$\dim(V)$
Math Mode

\gcd

Greatest common divisor operator

Example Code
$\gcd(a,b)$
Math Mode

\deg

Degree operator

Example Code
$\deg(p)$
Math Mode

\hom

Hom operator

Example Code
$\hom(A,B)$
Math Mode

\ker

Kernel operator

Example Code
$\ker(T)$
Math Mode

\Pr

Probability operator (amsmath)

Example Code
$\Pr(X > 0)$
Math Mode Mandatory { }

x^{a}

Superscript

Example Code
$x^{2}$
Math Mode Mandatory { }

x_{a}

Subscript

Example Code
$x_{i}$
Math Mode Mandatory { }

\overline{x}

Overline

Example Code
$\overline{x}$
Math Mode Mandatory { }

\underline{x}

Underline (math mode)

Example Code
$\underline{x}$
Math Mode Mandatory { }

\overbrace{x}

Overbrace

Example Code
$\overbrace{a+b+c}^{\text{sum}}$
Math Mode Mandatory { }

\underbrace{x}

Underbrace

Example Code
$\underbrace{a+b+c}_{\text{sum}}$
Math Mode Mandatory { }

\overrightarrow{x}

Right arrow over text (vectors)

Example Code
$\overrightarrow{AB}$
Math Mode Mandatory { }

\overleftarrow{x}

Left arrow over text

Example Code
$\overleftarrow{AB}$
Math Mode Mandatory { }

\hat{x}

Hat accent

Example Code
$\hat{x}$
Math Mode Mandatory { }

\widehat{x}

Wide hat accent

Example Code
$\widehat{xyz}$
Math Mode Mandatory { }

\bar{x}

Bar accent

Example Code
$\bar{x}$
Math Mode Mandatory { }

\vec{x}

Vector arrow accent

Example Code
$\vec{v}$
Math Mode Mandatory { }

\dot{x}

Dot accent (derivative)

Example Code
$\dot{x}$
Math Mode Mandatory { }

\ddot{x}

Double dot accent (second derivative)

Example Code
$\ddot{x}$
Math Mode Mandatory { }

\tilde{x}

Tilde accent

Example Code
$\tilde{x}$
Math Mode Mandatory { }

\widetilde{x}

Wide tilde accent

Example Code
$\widetilde{xyz}$
Math Mode Mandatory { }

\mathbb{X}

Blackboard bold (amssymb)

Example Code
$\mathbb{R}$
Math Mode Mandatory { }

\mathcal{X}

Calligraphic letters

Example Code
$\mathcal{L}$
Math Mode Mandatory { }

\mathfrak{X}

Fraktur letters (amssymb)

Example Code
$\mathfrak{g}$
Math Mode Mandatory { }

\mathrm{x}

Roman (upright) math text

Example Code
$\mathrm{d}x$
Math Mode Mandatory { }

\mathbf{x}

Bold math text

Example Code
$\mathbf{v}$
Math Mode Mandatory { }

\mathit{x}

Italic math text

Example Code
$\mathit{abc}$
Math Mode Mandatory { }

\mathsf{x}

Sans-serif math text

Example Code
$\mathsf{abc}$
Math Mode Mandatory { }

\mathtt{x}

Typewriter math text

Example Code
$\mathtt{abc}$
Math Mode Mandatory { }

\boldsymbol{x}

Bold math symbol (amsmath/bm)

Example Code
$\boldsymbol{\alpha}$
Math Mode Mandatory { }

\text{text}

Text inside math mode (amsmath)

Example Code
$x = 5 \text{ meters}$
Math Mode

\left(

Auto-sized left parenthesis

Example Code
$\left(\frac{a}{b}\right)$
Math Mode

\right)

Auto-sized right parenthesis

Example Code
$\left(\frac{a}{b}\right)$
Math Mode Optional [ ]

\left[

Auto-sized left bracket

Example Code
$\left[\frac{a}{b}\right]$
Math Mode

\right]

Auto-sized right bracket

Example Code
$\left[\frac{a}{b}\right]$
Math Mode Mandatory { }

\left\{

Auto-sized left brace

Example Code
$\left\{\frac{a}{b}\right\}$
Math Mode

\right\}

Auto-sized right brace

Example Code
$\left\{\frac{a}{b}\right\}$
Math Mode

\left|

Auto-sized left vertical bar

Example Code
$\left|\frac{a}{b}\right|$
Math Mode

\right|

Auto-sized right vertical bar

Example Code
$\left|\frac{a}{b}\right|$
Math Mode

\big(

Manually sized parenthesis (big)

Example Code
$\big(x\big)$
Math Mode

\Big(

Manually sized parenthesis (Big)

Example Code
$\Big(x\Big)$
Math Mode

\bigg(

Manually sized parenthesis (bigg)

Example Code
$\bigg(x\bigg)$
Math Mode

\Bigg(

Manually sized parenthesis (Bigg)

Example Code
$\Bigg(x\Bigg)$
Math Mode

\nonumber

Suppresses equation numbering on a line

Example Code
\begin{align}
x &= y \nonumber
\end{align}
Math Mode

\notag

Suppresses equation numbering (amsmath)

Example Code
\begin{align}
x &= y \notag
\end{align}
Math Mode Mandatory { }

\label{key}

Assigns a label for cross-referencing

💡 Deep Dive Explanation & Options

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.

Example Code
\label{eq:energy}
Math Mode Mandatory { }

\tag{text}

Custom equation tag (amsmath)

Example Code
\begin{equation}
E=mc^2 \tag{A}
\end{equation}
Tables & Floating Figures

Tables & Floating Figures

Comprehensive syntax, arguments, options, and copyable snippets for tables & floating figures.

Command

\hline

Horizontal line across a table

Example Code
\begin{tabular}{cc}
\hline
A & B \\
\hline
\end{tabular}
Command Mandatory { }

\cline{i-j}

Partial horizontal line spanning columns i to j

Example Code
\cline{1-2}
Command Mandatory { }

\multicolumn{n}{cols}{text}

Merges n columns in a table row

Example Code
\multicolumn{2}{c}{Merged Header}
Command Mandatory { }

\multirow{n}{width}{text}

Merges n rows in a table column (multirow package)

Example Code
\multirow{2}{*}{Merged Cell}
Command

\toprule

Top rule line (booktabs)

💡 Deep Dive Explanation & Options

Booktabs Heavy Top Rule: Replaces \hline at the table header top with a professional publication-grade rule.

Example Code
\begin{tabular}{cc}
\toprule
A & B \\
\end{tabular}
Command

\midrule

Middle rule line (booktabs)

💡 Deep Dive Explanation & Options

Booktabs Middle Rule: Thin horizontal divider separating table headers from data rows.

Example Code
\midrule
Command

\bottomrule

Bottom rule line (booktabs)

💡 Deep Dive Explanation & Options

Booktabs Heavy Bottom Rule: Clean closing horizontal rule at the table bottom.

Example Code
\bottomrule
Command Mandatory { }

\caption{text}

Adds a caption to a figure or table

Example Code
\caption{Scattering intensity vs. angle.}
Command Mandatory { }

\includegraphics{file}

Inserts an image (graphicx)

Example Code
\includegraphics{scattering_plot.png}
Command Mandatory { } Optional [ ]

\includegraphics[options]{file}

Inserts an image with sizing/rotation options

💡 Deep Dive Explanation & 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).

Example Code
\includegraphics[width=0.8\textwidth]{scattering_plot.png}
Command

\centering

Centers a figure or table content

Example Code
\centering
Command

\hfill

Horizontal fill/stretch space

Example Code
Left\hfill Right
Command

\vfill

Vertical fill/stretch space

Example Code
\vfill