LaTeX Tricks

LaTeX Table

Adjust Column Space

Space between Rows:

Horizontal Alignmenti (requires package array)

Wide Table Option: Shrink Table to Width

Diagonal Line requires package slashbox

\begin{table}
\centering
\caption{---}
\label{tb:---}

\setlength{\tabcolsep}{5pt}
\def\arraystretch{1.2} 
\def\mc#1#2{\multicolumn{#1}{c|}{\textbf{#2}}}
\def\mb#1#2{\multicolumn{#1}{|c|}{\textbf{#2}}}
\def\mr#1#2{\multirow{#1}{*}{\textbf{#2}}}
\def\nr{---}
\begin{tabular}{|p{9mm}|m{9mm}|c|c|c|c|c|c|c|}\hline
\mb{2}{\mr{2}{\backslashbox{$k/d$}{Layers}}} & \mc{4}{\nr}   & \mc{2}{Storage}\\ \cline{3-8}
\mb{2}{}       & $m=1$ & $m=2$ & $m=3$ & $m=4$ & $B_i$ & $B$ \\ \hline\hline
$k=2$ & $d=2$  & 7     & 10    & 12    &  13   &  2    & 8   \\ \hline
\end{tabular}
$k=8$ & $d=14$ & 1     & 1     & 1     &  1    & 56    & 224 \\ \hline
\end{table}

Math Space

Vertical Space:

Before/After Math Expressions:

Iteration and Emulation Space

Heading Space

Caption Space

Vertical Space for Flating

Modify Enumeration:

LaTeX Figures & PDF Files

Wrapfigure (Required package: wrapfig)

\begin{wrapfigure}[16]{r}{0.6\textwidth}  % [16] is optional, generally works better
\vspace{-20pt}
\includegraphics[width=0.59\textwidth]{Figure} 
\caption{Figure Caption} \label{Fig:Caption}
\vspace{-20pt}
\end{wrapfigure} 

Side-by-side figures

\begin{figure}
\centerinn{figure}
\centering
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=\textwidth]{Figure-1}
\captionof{figure}{Figure 1 Caption}
\label{Figure-1-label}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=\textwidth]{Figure-1}
\captionof{figure}{Figure 2 Caption}
\label{Figure-2-label}
\end{minipage}
\end{figure}

Subfig (Required package: subfig)

\begin{figure}
\centering
\subfloat[Caption 1\label{fig1}]{
\includegraphics[width=3in]{figure1}
}
\quad
\subfloat[Caption 2\label{fig2}]{
\includegraphics[width=3in]{figure2}
}
\caption{Caption of the entire figure}
\end{figure}

Change Figure Directory:

Rename Caption:

Include PDF File (requires package pdfpages)

Over- and underbrackets

Font Packages

Using algorithmic package

Change Floatname:

Using algorithm in beamer

LaTeX Beamer

Remove beamer navigation symbols

Other Links

Vi Help