All the LaTeX packages, macros, and fonts that you will ever need in one file

So this is it. It’s everything that I can think of. I use this as the start of all my TeX documents. I’ll update it if I can think of anything.

%% PREAMBLE -------------------------------------------------------------------
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. This sometimes screws up the the placement of text.
%\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\geometry{landscape} % Activate for for rotated page geometry
%\geometry{margins=2in} % change margins
\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx} % add graphics capabilities
\usepackage{lineno} % To add line numbers
\usepackage{amsmath} % AMS operators and symbols
\usepackage{amssymb} % AMS operators and symbols
\usepackage{bm} % Define \bm{} to use bold math symbols
\usepackage{epstopdf} % allow use of .eps graphics with pdflatex
\usepackage{setspace} %
\usepackage{color} % Allow color support
\usepackage{subfigure} % subfigure support
\usepackage{float} %
\usepackage{placeins} %
\usepackage[bookmarks,colorlinks,breaklinks]{hyperref} % Add hyperref type links in the document, colors
\definecolor{dullmagenta}{rgb}{0.4,0,0.4} % #660066
\hypersetup{linkcolor=red,citecolor=blue,filecolor=dullmagenta,urlcolor=darkblue} % coloured links
\usepackage{natbib} % for other bibliography things
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} % convert tifs and pngs
\graphicspath{{graphics/}} % add other graphics path instead of ./

% Show labels inline for easy referencing
\usepackage[inline]{showlabels,rotating} % to show labels on equations
\renewcommand{\showlabelfont}{\scriptsize \slshape \color{red}}
{0}\showlabelfont #1

% To put little todo items
\newcommand{\todo}[1]{ \vspace{5 mm} \par
\noindent \framebox{
[c]{0.94 \textwidth}
\tt #1 \flushright ... todo
\vspace{5 mm} \par
%% SPACING --------------------------------------------------------------------
%% MACROS ---------------------------------------------------------------------
\let\vaccent=\v % rename builtin command \v{} to \vaccent{}
\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors
\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} % for greek letters
\newcommand{\uv}[1]{\ensuremath{\mathbf{\hat{#1}}}} % for unit vector
\newcommand{\abs}[1]{\left| #1 \right|} % for absolute value
\newcommand{\avg}[1]{\left< #1 \right>} % for average
\newcommand{\grad}[1]{\gv{\nabla} #1} % for gradient
\let\divsymb=\div % rename builtin command \div to \divsymb
\renewcommand{\div}[1]{\gv{\nabla} \cdot #1} % for divergence
\newcommand{\curl}[1]{\gv{\nabla} \times #1} % for curl
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} % partial derivative
\newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}} % partial double derivative
\newcommand{\diffd}{\mathrm{d}} % differential d
\newcommand{\dd}[2]{\frac{\diffd #1}{\diffd #2}} % derivative
\newcommand{\ddd}[2]{\frac{\diffd^2 #1}{\diffd #2^2}} % double derivative
\newcommand{\boldnabla}{\mbox{\boldmath$\nabla$}} % vector div
\newcommand{\bolddelta}{\mbox{\boldmath$\delta$}} % vector Laplacian
\newcommand{\conj}[1]{\overline{#1}} % overbar conjugate
\newcommand{\real}[1]{\mathrm{Re} \left[ #1 \right]} % more clear real
\newcommand{\imag}[1]{\mathrm{Im} \left[ #1 \right]} % more clear imaginary
\newcommand{\order}[1]{\mathcal O \left( #1 \right)} % order of magnitude
\newcommand{\eee}[1]{\mathrm{e}^{ #1 }} % exponential raised to
\newcommand{\ii}{\mathrm{i}} % imaginary unit i
\newcommand{\markchange}[1]{\textcolor[red]{#1}} % marks changes in text 

% FONTS -----------------------------------------------------------------------
%% Sans Serif for EVERYTHING
%% Fourier for math | Utopia (scaled) for rm | Helvetica for ss | Latin Modern for tt
%\usepackage{fourier} % math & rm
%\usepackage[scaled=0.875]{helvet} % ss
%\renewcommand{\ttdefault}{lmtt} %tt
%% Latin Modern (similar to CM with more characters)
%\usepackage{lmodern} % math, rm, ss, tt
%% Palatino for rm and math | Helvetica for ss | Courier for tt
%\usepackage{mathpazo} % math & rm
%\linespread{1.05} % Palatino needs more leading (space between lines)
%\usepackage[scaled]{helvet} % ss
%\usepackage{courier} % tt
%% Euler for math | Palatino for rm | Helvetica for ss | Courier for tt
%\renewcommand{\rmdefault}{ppl} % rm
%\linespread{1.05} % Palatino needs more leading
%\usepackage[scaled]{helvet} % ss
%\usepackage{courier} % tt
%\usepackage{euler} % math
%%\usepackage{eulervm} % a better implementation of the euler package (not in gwTeX)
%% Times for rm and math | Helvetica for ss | Courier for tt
%\usepackage{mathptmx} % rm & math
%\usepackage[scaled=0.90]{helvet} % ss
%\usepackage{courier} % tt
%% !! COMMERICAL FONT !! Lucida Bright (w/expert package)
%% FRONT MATTER ---------------------------------------------------------------
\author{Andrew A. Tchieu}
%\date{} % Activate to display a given date or no date
%% MAIN MATTER ----------------------------------------------------------------





%% BIBLIOGRAPHY ---------------------------------------------------------------


Yea, it’s super long and it looks terrible in WordPress, but I don’t care.

  1. You say you “update it if [you] can think of anything.” Here are a few suggestions: `subfigure’ is outdated. Modern alternatives are `subfig’ or `subcaption’. `color’ has long been superseded by `xcolor’. `epstopdf’ isn’t really needed any more. Modern pdflatex converts eps figures on the fly into PDF.

    Also, I can’t think of any case where I would use `float’. For defining new float environments there are a few other packages with more flexibility. (And the `H’ positioning is just wrong. There are better alternatives for non-floating figures and tables.)


  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: