packages
Essentials
Generally useful packages that offer commonly used macros.
fancyhdr
- provides tools for constructing headers and footers with all kinds of customizable optionsgeometry
- changes page dimensions and removes the unnecessarily large default marginshyperref
- support for external hyperlinks and internal document referencesmathtools
- an extension that internally loads theamsmath
package along with various fixes and improvementsparskip
- allows for zero\parindent
and nonzero\parskip
, which makes for much more readable documents
Other Useful Packages
Packages I use depending on the type and scale of the document itself.
amssymb
- provides an extended symbol collection as a superset ofamsfonts
that includes some more obscure symbolsamsfonts
is included and loads things like\mathbb
for characters like $\mathbb{R}$- If the heirarchy of
ams
packages is confusing, check this thread out
amsthm
- enhanced version of $\LaTeX$’s\newtheorem
command for defining customizable theorem-like environmentsbiblatex
- works in tandem with a.bib
file to compile referencesbm
- bold symbols in math mode that are safer than those from\boldsymbol
booktabs
- improves the look of tablesbraket
- provides macros to typeset bra-ket notationcancel
- places lines through cancelled terms in math equationscaption
- customized captions in figure and table environments, I like my caption headings bolded for readabilityderivative
- derivatives and differentials via short, easy to remember macrosenumitem
- provides additional numbering and structuring control over the enumerate, itemize, and description environmentsesint
- useful for typesetting line and surface integralsfloat
- sometimes necessary for the placement of stubborn figures and tablesgraphicx
- allows for graphics, images, etc. to be addedmathrsfs
- provides the\mathscr
command for formal uppercase script letters like $\mathscr{P}$- The internal $\LaTeX$ script letters from
\mathcal
look like $\mathcal{P}$
- The internal $\LaTeX$ script letters from
mhchem
- typesetting for chemical molecular formulae and equationsminted
- syntax highlighting for all sorts of source code using the Pygments librarymulticol
- can be used to have multiple columns of text, I primarily use it for 2-column listsnatex
- shameless plug, who knew I would use my own packagepgfplots
- draws high-quality function plots in normal or logarithmic scaling with a user-friendly interfacesiunitx
- a comprehensive SI unit package that includes macros for scientific notationtcolorbox
- nicely formatted and customizable boxes for examples and worked problemstikz
- adds support for native diagram and graph creation
An Aside on Upright Math
I have strong opinions on clear and proper notation, and I think everyone should. One oft-overlooked aspect of writing I’ve seen in books is the tendency to strictly use italicized characters in math mode. Besides the obvious aesthetic failings, this approach tends towards a lack of clarity due to ambiguities brought upon by the sole use of italics. Below, I explain where upright characters should be used to remedy these issues.
The ground rules for using upright characters are as follows (list pulled from here):
- upright function names $(\sin{x}$, $\cos{x}$, $\ln{x}$, etc.$)$
- upright differentials $(\mathrm{d}x$ and $\int x \ \mathrm{d}x)$
- upright dimensionless numbers $(\mathrm{Re}$, $\mathrm{Pr}$, etc.$)$
- upright descriptive text
- upright descriptive variable indices (that don’t correspond to other variables)
I think the first bullet point is clear enough, and is generally well followed. After all, most commonly used functions are already defined as built-in macros within $\LaTeX$, so there’s no reason not to use them.
Typesetting differentials is mainly a matter of personal taste, but I find upright differentials to be more clear. From my cursory research, it seems like most mathematicians still prefer the italic text. Older textbooks and papers almost exclusively use italics as well. In newer texts, I have started seeing a marked increase in the upright variation, so it seems to be catching on.
Upright dimensionless numbers are more important. For instance, using $Re$ instead of $\mathrm{Re}$ to denote the Reynold’s number is unclear, since $R$ and $e$ could easily be interpreted as two separate variables. In most cases, the meaning will be clear from context, but it’s always better to adopt a standard and follow it for the sake of consistency. Descriptive text falls into the same category.
Variable indices are the most tricky to nail down. When the subscript is descriptive, like $a_\mathrm{profile}$, it should be upright. For index counters as in $\sum_i x_i$, italic is correct. Technically, according to ISO and NIST, one-letter subscripts that refer to a name, such as $k_\mathrm{B}$ for the Boltzmann constant, or $m_\mathrm{e}$ for the mass of an electron, should be upright. However, the American Physical Society recommends all single-letter subscripts to be italic. I’ve seen both in books and in papers, but I prefer the APS guidelines. To make upright subscripts less of a pain, I found a neat little command on StackExchange at some point, which I’ve included in my package.
By the way, if you’re following the official ISO standards, even the imaginary unit $i$, Euler’s number $e$, and $\pi$ should be upright. This practice is absolutely atrocious and I don’t recommend following it.