Time for action – including a picture
We shall create a short document. Between two paragraphs, we would like to insert a picture. If there's no picture file available, we will use the demo mode of graphicx
:
- Begin a new document and load
babel
andblindtext
to print some filler text:\documentclass[a5paper]{article} \usepackage[english]{babel} \usepackage{blindtext} \usepackage[demo]{graphicx} \pagestyle{empty} \begin{document} \section{Including a picture} \blindtext
- Open a
figure
environment and declarecentering
:\begin{figure} \centering
- Use the command
\includegraphics
with the filename as the argument:\includegraphics{test}
- Declare a caption, close the
figure
environment, and end the document with filler text:\caption{Test figure} \end{figure} ...
Get LaTeX Beginners Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.