LaTeX packages

95 packages: what each one is for, its main commands and a complete example.

abstract
Changes the layout of the abstract environment (heading font, text font, indents) and provides onecolabstract for a full-width abstract in a two-column document.
acronym
Manages acronyms without an external program: \acro defines them in the acronym environment, and \ac prints the long form at the first use and the short form afterwards.
algorithm2e
Typesets pseudocode in a numbered algorithm float, with commands such as \KwIn, \For, \While, \If and \Return.
algpseudocode
Typesets pseudocode in the algorithmic environment with commands such as \State, \If ... \EndIf, \For ... \EndFor and \Function.
amsmath
Adds the display environments align, gather and cases, the matrix environments, and commands such as \text, \dfrac and \DeclareMathOperator.
amssymb
Adds about 200 math symbols and the alphabets \mathbb and \mathfrak, for example \mathbb{R}, \leqslant, \nmid and \therefore.
amsthm
Defines theorem environments in three styles with \theoremstyle and \newtheorem, and adds the proof environment with an end-of-proof mark.
appendix
Provides the appendices environment and options that add the word "Appendix" to headings and an "Appendices" entry to the table of contents.
array
Extends the column argument of tabular and array: m{...} and b{...} columns, >{...} and <{...} for code around every cell, and \newcolumntype.
babel
Adapts a document to its language: hyphenation, generated words such as "Contents" and "Figure", and the date format. \selectlanguage and \foreignlanguage switch between languages.
biblatex
Creates citations and the bibliography from a .bib file with the program Biber: \addbibresource, \parencite, \textcite and \printbibliography.
blindtext
Inserts dummy text in the language of the document with \blindtext, and a complete test document with headings and lists with \blinddocument.
bm
Provides \bm, which sets any math symbol in bold and keeps its shape, including Greek letters and operators.
bookmark
Replaces the bookmark code of hyperref: the PDF outline is correct after one run, and \bookmarksetup sets its style, numbering and open levels.
booktabs
Draws the horizontal rules of a table with correct thickness and spacing: \toprule, \midrule and \bottomrule.
calc
Allows arithmetic in \setlength, \setcounter and the length arguments of boxes: \setlength{\x}{\textwidth - 2cm}, plus \widthof{text} for the width of a text.
cancel
Strikes through parts of a formula with a diagonal line: \cancel, \bcancel, \xcancel and \cancelto.
caption
Changes the look of figure and table captions with \captionsetup and adds \caption* and \captionof.
chemfig
Draws structural formulas of molecules with \chemfig: atoms, single, double and triple bonds at chosen angles, rings and reaction schemes.
circuitikz
Draws electrical circuits: components such as R, C, L and V are placed on a path with to[...] inside a circuitikz environment.
cleveref
Writes the kind of object in front of a reference: \cref{fig:setup} prints "fig. 1" and handles several labels at once.
colortbl
Colours table rows, columns, single cells and rules: \rowcolor, \columncolor, \cellcolor and \arrayrulecolor.
csquotes
Sets the quotation marks of the document language with \enquote and formats longer quotations with \blockquote and displayquote.
dcolumn
Provides the column type D, which aligns the numbers of a table column at the decimal marker.
draftwatermark
Prints a text watermark such as "DRAFT" behind the content of every page; text, size, angle and colour are set with \DraftwatermarkOptions.
enumitem
Sets labels, spacing and indents of itemize, enumerate and description through options such as label, noitemsep, leftmargin and resume.
etoolbox
Programming tools for the preamble: flags with \newtoggle and \iftoggle, tests such as \ifstrequal and \ifdef, hooks such as \AtBeginEnvironment, and \patchcmd for changing existing commands.
eurosym
Prints the euro sign with \euro and amounts with \EUR{...}, from a font of its own with the official shape of the sign.
fancyhdr
Defines the header and footer of a page in three parts each (left, centre, right) with \fancyhead and \fancyfoot.
fancyvrb
Provides the Verbatim environment with options for line numbers, frames, font size and line ranges, and \VerbatimInput for files.
float
Adds the placement [H], which sets a figure or table exactly where it stands in the source, and defines new float types with \newfloat.
fontawesome5
Provides the icons of Font Awesome 5 as text characters: \faIcon{name}, or one command per icon such as \faGithub and \faEnvelope.
fontenc
Selects the font encoding for pdfLaTeX. \usepackage[T1]{fontenc} switches to fonts that contain accented letters as single characters.
fontspec
Loads OpenType and TrueType fonts by name in LuaLaTeX and XeLaTeX: \setmainfont, \setsansfont, \setmonofont and \newfontfamily.
footmisc
Changes numbering and layout of footnotes through package options such as perpage, bottom, hang, symbol and multiple.
forest
Draws trees from bracket notation: [parent [child] [child]] inside a forest environment.
geometry
Sets the paper size and the page margins with options such as margin=2.5cm, left, top and a4paper.
glossaries
Manages a glossary and a list of acronyms: terms are defined once with \newglossaryentry or \newacronym, used with \gls and listed with \printglossaries.
graphicx
Includes image files with \includegraphics and sets their size, rotation and cropping through options such as width, angle and trim.
hyperref
Turns cross-references, citations, the table of contents and URLs into clickable links and writes bookmarks and metadata into the PDF; \href, \url and \hypersetup are its main commands.
ifthen
Provides the conditional \ifthenelse{test}{true}{false} with tests for numbers, strings, lengths and flags, and the loop \whiledo.
imakeidx
Creates an index from \index entries with \makeindex and \printindex, runs MakeIndex during the compilation and supports several indexes in one document.
inputenc
Tells pdfLaTeX in which encoding the source file is saved. \usepackage[utf8]{inputenc} has been the default since 2018 and is no longer needed.
lineno
Prints line numbers in the margin of the text with \linenumbers, as journals ask for in manuscripts under review.
lipsum
Inserts paragraphs of the dummy text "Lorem ipsum" with \lipsum, for testing a layout before the real text exists.
listings
Typesets source code with syntax highlighting, line numbers and captions, without an external program: the lstlisting environment, \lstinline and \lstinputlisting, configured with \lstset.
lmodern
Switches the document to Latin Modern, the vector version of the Computer Modern fonts with the full T1 character set.
longtable
Provides the longtable environment for tables that continue over several pages, with a head and foot that repeat on every page.
makecell
Provides \makecell for line breaks inside a table cell and \thead for column headings with their own font.
marginnote
Places notes in the page margin with \marginnote, also in places where \marginpar fails: inside figures, footnotes and boxes.
mathtools
Extends amsmath with \DeclarePairedDelimiter, the dcases environment, \coloneqq, matrix columns with a chosen alignment and an option that numbers only the equations you reference.
mdframed
Draws a frame with an optional background around text that may run over several pages: the mdframed environment and \newmdenv.
mhchem
Typesets chemical formulas and reaction equations from plain input with \ce, for example \ce{2H2 + O2 -> 2H2O}.
microtype
Evens out justified text with character protrusion and font expansion; loading the package without options switches both on.
minted
Highlights source code with the Python library Pygments: the minted environment, \mintinline and \inputminted. It needs a compile run with shell escape.
multicol
Sets part of a page in two to ten columns with the multicols environment and balances the columns at its end.
multirow
Provides \multirow, a table cell that spans several rows, with its text centred vertically across them.
natbib
Adds author-year citations to the BibTeX workflow: with the option round, \citet prints Knuth (1984) and \citep prints (Knuth, 1984).
nicefrac
Provides \nicefrac{1}{2} for small diagonal fractions such as ½ in running text and in formulas.
nomencl
Builds a list of symbols: \nomenclature{symbol}{description} records an entry where the symbol is introduced, and \printnomenclature prints the sorted list.
parskip
Separates paragraphs by vertical space instead of a first-line indent; the options skip and indent set both values.
pdflscape
Provides the landscape environment: its content is set on landscape pages, and a PDF viewer shows these pages turned.
pdfpages
Inserts whole pages of another PDF file into the document with \includepdf, one or several per sheet.
pgfgantt
Draws Gantt charts for project plans: \ganttbar, \ganttgroup and \ganttmilestone inside a ganttchart environment.
pgfplots
Draws function plots, data plots and bar charts with axes, ticks and a legend: \addplot inside an axis environment.
physics
Shortens physics notation: derivatives with \dv and \pdv, Dirac notation with \bra and \ket, brackets that size themselves with \qty, and vector operators such as \grad.
pifont
Prints the symbols of the Zapf Dingbats font by number with \ding, for example check marks, crosses, arrows and circled digits.
placeins
Provides \FloatBarrier, a point that no figure or table can float past, and an option that puts such a barrier before every \section.
ragged2e
Sets ragged text that still hyphenates words (\RaggedRight, \Centering, \RaggedLeft) and returns to justified text with \justifying.
rotating
Turns a figure or table with its caption by 90° on a page of its own (sidewaysfigure, sidewaystable) and rotates text by any angle.
scrlayer-scrpage
Defines headers and footers for KOMA-Script and standard classes with \ihead, \chead, \ohead, \ifoot, \cfoot and \ofoot.
setspace
Sets the line spacing of the text with \onehalfspacing, \doublespacing and \setstretch.
siunitx
Typesets numbers and physical quantities with consistent spacing and units: \qty, \num, \unit, and the table column S that aligns numbers at the decimal marker.
soul
Underlines, strikes out, highlights and letterspaces text that still breaks across lines: \ul, \st, \hl, \so and \caps.
subcaption
Places several images or tables in one float, each with its own caption (a), (b), through the environments subfigure and subtable.
subfiles
Splits a document into files that compile on their own with the preamble of the main file: \subfile in the main file and the class subfiles in each part.
svg
Includes SVG files with \includesvg by calling Inkscape during the LaTeX run to convert them to PDF.
tabularx
Sets a table to a width you choose, for example \textwidth: the column type X takes the space that is left and wraps its text.
tabulary
Sets a table to a target width and gives each L, C, R or J column a width in proportion to the amount of text in it.
tcolorbox
Draws coloured boxes with a frame, a background and an optional title: the tcolorbox environment and \newtcolorbox for box types of your own.
textcomp
Provides text symbols such as \texteuro, \textdegree, \textmu and \textcopyright. Since the LaTeX release of February 2020 these commands work without the package.
threeparttable
Sets footnotes directly below a table and limits them and the caption to the width of the table: the environments threeparttable and tablenotes and the command \tnote.
tikz
Draws vector graphics from commands in the document: lines and shapes with \draw, labelled boxes with \node, inside a tikzpicture environment.
tikz-cd
Draws commutative diagrams: objects in a grid inside tikzcd, connected with \arrow and labelled in quotes.
titlesec
Changes font, numbering layout and spacing of \chapter, \section and the lower headings with \titleformat and \titlespacing.
tocloft
Controls fonts, indents, dot leaders and spacing in the table of contents, list of figures and list of tables through lengths and commands named \cft....
todonotes
Marks open tasks in a draft: \todo puts a coloured note in the margin, \listoftodos collects all notes, \missingfigure holds the place of a figure.
ulem
Underlines and strikes out text in several styles that break across lines: \uline, \uuline, \uwave, \sout, \xout, \dashuline and \dotuline.
unicode-math
Sets formulas in an OpenType math font chosen with \setmathfont and accepts Unicode characters such as α, ∑ and ≤ in the source. Needs LuaLaTeX or XeLaTeX.
url
Typesets web addresses, e-mail addresses and file paths with \url and \path: special characters are typed as they are, and long addresses break across lines.
verbatim
Reimplements the verbatim environment and adds \verbatiminput for whole files and the comment environment for text that LaTeX should skip.
wrapfig
Lets text flow around a narrow figure or table at the edge of the page: the environments wrapfigure and wraptable.
xcolor
Provides colour for text, backgrounds and boxes: \textcolor, \colorbox, \definecolor, and mixtures written as blue!30.
xfrac
Provides \sfrac{1}{2} for diagonal fractions such as ½, with sizes and spacing set per font family.
xparse
Defines commands with stars, several optional arguments and default values through \NewDocumentCommand. Since the LaTeX release of October 2020 these commands work without the package.