Intro | First attempt | Text | References | Figures | Maths | Source Code | Theorems
In order to include figures, I recommend the following sequence of commands.
\begin{figure} \begin{center} \includegraphics[width=0.8\textwidth]{figfile} \end{center} \caption{A diagram showing how to include graphics.} \label{fig:1} \end{figure}
Additionally, in the preamble, you need:
\usepackage{graphicx}
This does require a bit of explanation.
First, a block enclosed by a \begin
/\end
pair is called an environment.
The example uses two environments, figure
and
center
.
figure
environmentcenter
environment\includegraphics
\caption
\label
See Figure~\ref{fig:1} on page~\pageref{fig:1}
.
The following code creates a table:
\begin{table} \begin{center} \begin{tabular}{|r||c|l|} \hline Field 1 & Field 2 & Field 3 \\ \hline\hline Data 1 & 0.5 & $\alpha$ \\ Data 2 & 2.1 & $\beta$ \\ \hline \end{tabular} \end{center} \caption{Table demo.} \label{tab:1} \end{table}
The table
environment creates a float like
figure
does, but it keeps it in separate list with
its own number sequence.
The actual table itself is made by the tabular
environment.
{|r||c|l|}
\hline
&
\\
Whereever you want the lists, issue the commands
\listoffigures \listoftables