The second important object for scientific reports is figures. It may be data graphs, advanced infographics or even pictures. They can all be handled effectively by the figure environment, often assisted by additional packages. I recommend the graphicx package that I will use in the following example.
The figure is a float for LaTeX, similar to tables. It can support labels and captions as well. A list of figures can be printed at the beginning of the report we are describing with the command \listoffigures. Here are some examples on how to use figures.
\usepackage{graphicx}
...
\includegraphics[width=60mm]{uoa_logo}
...
I have defined the use of package graphicx in the preamble, then at the point I want to add an image file (here "uoa_logo.png" skipping the extension .png) I use the command \includegraphics[width=60mm]{uoa_logo}, setting the width of the image equal to 60mm. With this package, I can include PDF, JPG and PNG images in the document. If I need to include Encapsulated PostScript Images (EPS), then I need to load a different package in the preamble (\usepackage{epsfig}) that has its own properties.
I have used no alignment and also skipped entirely the float \begin{figure}. This simply means I will add the picture in the document, but I can not further manipulate it (rotate it, mirror it, add a caption etc).
A useful tip when trying to decide what width is appropriate for the particular image is to take advantage of the silently defined parameter \textwidth. LaTeX lets you use a multiplication factor to set legths required in objects, such as texwidth, margins etc. A simple way to that is:
\includegraphics[width=0.8\textwidth]{uoa_logo} ← 80% of the textwidth
or
\includegraphics[width=0.4\textwidth]{uoa_logo} ← 40% of the textwidth
This option is particularly useful when you have a document and for some reason you change its style (your publisher requires e.g. B5 paper instead). You stop depending on particular dimensions of the page you have defined and you present your image according to the document itself. Truly unique!
There are several other options for figure manipulation: borders, trimming, clipping, rotating and many more. See the links for more resources.
Our last example will give a general way to include figures in your thesis:
\begin{figure}[h!]
\centering
\includegraphics[width=0.5\textwidth]{uoa_logo}
\caption{A picture of the Univ. of Athens logo}
\label{fig:uoa_logo}
\end{figure}
In the above rather general example, we have also included a caption to be placed under the image (\caption{...} follows \includegraphics{...}) and a label so that we could refer to this image in the text with any further effort. The way to do that is the same with tables: at the point you would like to have a reference add the following command (given here in an example text paragraph)
[...] the head of Athena depicted in Fig.~\ref{fig:uoa_logo} was carved on a ring found during a recent archaeological mission [...] more data about the mission are included in table~\ref{tab:uoa_logo_data} [...]
On last tip: I use the character ~, which represents a blank space for LaTeX between Fig. and \ref{...} for two reasons. First, the obvious one is that I need a space inbetween. The second reason is that LaTeX considers this combo Fig.~\ref{fig:uoa_logo} as one word and will keep it together during hyphenation. This is similar to the \mbox{...} command that keeps its arguments together.
|