Jordi Pla

LaTeX Recipes

For a complete Manual of Style: The Chicago Manual of Style.


Create spaces to align in math mode:

% Create a box with same height, depth, and width as subformula.
% Zero witdh box with same height and depth as subformula.
% Zero height and depth box, and same width as subformula.

Bold vectors and matrices:


booktabs for clean and nice-looking tables.

% Needs: \usepackage{booktabs}
		           & \multicolumn{2}{c}{Data}  \\
		Name       & A Column & Another column \\
		Some data  &       10 &             95 \\
		Other data &       30 &             49 \\
		Different stuff & 99 & 12 \\
	\caption{Some data.}

siunitx package to format numbers, currencies, units, etc:

% Needs: \usepackage{siunitx}
	round-mode = places,
	round-precision = 3

Cost: \SI{100}{\$}.
Display percentage: \SI{50}{\percent}.
Rounding numbers: \num{1.23456}.

Speed up compilation

The include command can be used to compile a subset of files. Cleans pages before and after including the code.

Note: It is not possible to nest includes.

% ---

The input command can also be used. It is a lower-level command, but works in nested files.


Microtype tries to enhance the appearance and readability of the document while exhibiting a minimum degree of visual obtrusion.

\usepackage[activate={true, nocompatibility},
            final,         % Use draft to disable.
            tracking=true, % Letter-spacing.
            kerning=true,  % Adjust spacing of of scpecial characters.
            spacing=true,  % Enable spacing between characters.
            %stretch=10,   % Default stretch can blur the text.
            %shrink=10,    % Default shrink can blur the text.
\SetTracking{encoding={*}, shape=sc}{50} % Just personal preference.

Note: It is recommended to disable protrusion in TOC, LOF and LOT.

\microtypesetup{protrusion=false} % disable protrusion
\tableofcontents % print Table of Contents
\microtypesetup{protrusion=true} % enable protrusion again

Allow equations to be copied (from StackExchange):

% Needs: \usepackage{accsupp}