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.

%\documentclass[a4paper,11pt]{amsart}
\documentclass[a4paper,10pt]{article}
%% 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} % http://www.ctan.org/pkg/setspace
\usepackage{color} % Allow color support
\usepackage{subfigure} % subfigure support
\usepackage{float} % http://www.ctan.org/tex-archive/macros/latex/contrib/float/
\usepackage{placeins} % ftp://ftp.ctan.org/tex-archive/macros/latex/contrib/placeins/placeins.txt
\usepackage[bookmarks,colorlinks,breaklinks]{hyperref} % Add hyperref type links in the document, colors
\definecolor{dullmagenta}{rgb}{0.4,0,0.4} % #660066
\definecolor{darkblue}{rgb}{0,0,0.4}
\hypersetup{linkcolor=red,citecolor=blue,filecolor=dullmagenta,urlcolor=darkblue} % coloured links
\usepackage{natbib} % for other bibliography things
\bibpunct{(}{)}{;}{a}{,}{,}
\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}}
\renewcommand{\showlabelsetlabel}[1]{
\begin{turn}
{0}\showlabelfont #1
\hspace{15pt}
\end{turn}
}

% To put little todo items
\newcommand{\todo}[1]{ \vspace{5 mm} \par
\noindent \framebox{
\begin{minipage}
[c]{0.94 \textwidth}
\tt #1 \flushright ... todo
\end{minipage}
}
\vspace{5 mm} \par
}
%% SPACING --------------------------------------------------------------------
%\doublespacing
%\linenumbers
%% 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{\eq}[1]{Equation~(\eqref{eq:#1})}
\newcommand{\fig}[1]{Figure~\ref{fig:#1}}
\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
%\renewcommand{\familydefault}{\sfdefault}
%\usepackage{sfmath}
%% 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
%\usepackage[T1]{fontenc}
%
%% 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
%\normalfont
%\usepackage[T1]{fontenc}
%
%% 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)
%\normalfont
%\usepackage[T1]{fontenc}
%
%% Times for rm and math | Helvetica for ss | Courier for tt
%\usepackage{mathptmx} % rm & math
%\usepackage[scaled=0.90]{helvet} % ss
%\usepackage{courier} % tt
%\normalfont
%\usepackage[T1]{fontenc}
%
%% !! COMMERICAL FONT !! Lucida Bright (w/expert package)
%\usepackage[T1]{fontenc}
%\usepackage[expert,vargreek,altbullet]{lucidabr}
%% FRONT MATTER ---------------------------------------------------------------
\title{Title}
\author{Andrew A. Tchieu}
%\date{} % Activate to display a given date or no date
%% MAIN MATTER ----------------------------------------------------------------
\begin{document}
\maketitle
%\begin{abstract}
%\end{abstract}

%\section{Introduction}

%\section{Formulation}

%\section{Results}

%\section{Discussion}
%\cite{zannetti:ejmb2005a}
%\cite{kivotides:el2004b}

%% BIBLIOGRAPHY ---------------------------------------------------------------
%\bibliographystyle{plain}
%\bibliographystyle{plainnat}
%\bibliography{/Users/atchieu/Dropbox/Library/library}

\end{document}

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

About these ads
  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.)

    Regards

  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: