7 Floating material
On packages
The LaTeX kernel is rather limited: to get around that we load packages:
\usepackage[⟨options⟩]{⟨package⟩}
or
\usepackage{⟨package1⟩,⟨package2⟩,…}
We have already seen the lipsum package!
Documentation for packages is available in exactly the same way as for
classes.
Including external images
- Load the graphicx package to include graphics;
- Use \includegraphics to actually place the image;
- Image formats: pdf, png, jpg;
- Images in eps format ‘auto-converted’ to pdf;
- File extension should be omitted.
Graphics can also be ‘drawn’ in LaTeX using the TikZ package: a course in
itself!
Floating figures
A floating figure …
\begin{figure}[htbp]
\centering
\includegraphics{myimage}
\caption{A Sample Figure}
\label{fig:sample}
\end{figure}
…needs a cross-reference
as is show in Figure~\ref{fig:sample}
Tables
- The floating environment for a table is called table;
- However, the content can be anything!
- Use the tabular environment to make tables;
- Load the booktabs package for rules.
Tables
A simple table
\begin{table}
\centering
\caption{A caption}
\label{tab:example}
\begin{tabular}
{lcr}
\toprule
Heading &
Another one &
A third \\
\midrule
a &
b &
c \\
d &
e &
f \\
\multicolumn{3}{c}{Wide text}
\\
\bottomrule
\end{tabular}
\end{table}