When producing a document in LaTeX (articles, papers, report, thesis) you will almost surely need to include some figures.
In this very short guide I just want to collect some useful tips to produce these figures and to include them properly in you LaTeX document. According to the kind of figure you need, some appropriate applications will be suggested.
Including figures in LaTeX
Independently on how you generate your figures, you will have to include them properly in your LaTeX document. The good thing is that including a figure doesn't not rely on the type of figure, so you only have to learn this thing once.
The following lines do the job:
\begin{figure}
\centering
\includegraphics[width=8cm]{nomefile}
\caption{This is you caption}
\label{This is a label}
\end{figure}
while this line has to be added at the very beginning of your LaTeX document:
\usepackage{graphicx}
Some tips
While you already know enough to include a figure in your document, here are some tips that may help your job.
Keep your figures in a folder
It's a good idea to keep all your figures in a separate subfolder, so that you know where important stuff is. For example if you have a subfolder called "figures" you may want to add this line right after the \usepackage line
\graphicspath{{figures/}}
In this way you can include all the figures just with their filename, without repeating the path every time.
Avoid extensions in filenames
When specifying the filenames, avoid the extension! This way, the correct extension will be appended. For example, if you're converting your document in pdf with the dvips command, a .eps file will be looked for. Instead, if you use pdflatex, a .png or a .pdf file will be included.
Define a new command
You can decide to define a new command at the beginning of your document or in an auxiliary file to simplify the insertion of figures. For example
\newcommand{\fig}[3]
%1=nomefile 2=width 3=caption
{\begin{figure}
\centering
\includegraphics[width=#2\columnwidth]{figures/#1}
\caption{#3}
\label{#1}
\end{figure}
}
This way you can insert every figure with a single line like
\fig{filename}{0.5}{This is the caption.}
and you will have the figure called filename inserted in the document, with a width equal to half of the column (or page) width, and with the given caption. A label equal to the filename will be set too.
Creating your figures
Here is a list of figures you may want to create, together with the best application to do that, according to my opinion.
- Photo or raster pictures with Gimp
- Vector images or drawings with Inkscape
- Block diagrams with Diagraph
Click on any of these three links to read more about them!
I hope you liked this page!
If you think it did help you, why don't you buy me a spritz ? ;-)

