Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Chapter 4: Lists, tables, figures

Section 4.3: Figures

As explained in § 4.2 above, Tables and Figures float to a vacant part of the page, as they are not part of your normal text, but illustrative objects that you refer to.

If you haven’t already read the sidebar ‘Terminology for tables and figures’ above and § 4.2.1 above, please read them now before going any further.

To create a figure, use the figure environment. Like Tables, they automatically get numbered, and they MUST include a \caption (with a \label after it, if needed for cross-referencing). Like Tables, it is conventional to centre the material, but that is a personal choice.

\begin{figure}
\caption{Total variable overhead variance (after 
         \textcite[p.191]{bull}}
\label{workeff}
\centering
\fbox{\includegraphics[width=.75\columnwidth]{diagram}}
\end{figure}

Figure 4.3: Total variable overhead variance (after Bull (1972, p 191))

diagram

You can see that the structure is very similar to the table environment, but in this case we have a graphic included with the \includegraphics command. Here, it’s also enclosed in an \fbox, which places a frame box around it (see § 4.6.2 below). Details of including graphics with the graphicx package are in the next section because they can occur in many places, not just Figures. Details of the bibliographic citation mechanism used in the caption are will be covered in § 5.3.2 below.

Figures can contain text, diagrams, pictures, or any other kind of illustration, even a tabular environment — LATEX is agnostic on this point, so Tables can contain an image (of a table, presumably) and Figures can contain a tabulation. What matters is that you describe them properly.

The content of the Figure could of course also be textual, in the form of lists, paragraphs, or other blocks of text. For drawings, LATEX has a very simple drawing environment called picture, which lets you create a very limited set of lines and curves, but for a diagram of any complexity, you can use any normal vector drawing program (see § 4.4.3 below), save the image as a PDF vector image, and include it in your Figure with \includegraphics as illustrated.

Much more common is to create your diagrams within the LATEX document using TikZ, which is a TEX interface to the Portable Graphics Format (PGF) graphics language. TikZ is much more powerful than the picture environment, but it’s a whole language of its own, so it needs learning. (I used it to create the labelling on the image in Figure 1.4 above.) The manual is in the tikz package, and there is a self-help blog at https://latexdraw.com and extensive help via the TEX Stackexchange.