I want to add an empty figure in a document with added captions .. etc, so that I can add the figures later. Is there a direct way to do this? For example insert a white box with a big X across it or something?
2 Answers
- Based on Example images in LaTeX?.
- The MWE package provides example pictures.
- Another possibility is the
demo
option of thegraphicx
package which includes a black square. - I prefer ways that use the 'normal'
\includegraphics
command since it means less change when you include the actual content later. On the other hand, the\missingfigure
command in the other answer shows very clear that something has to be done (which is good depending on the use case).
\documentclass{article}
\usepackage{graphicx}
\usepackage{float}
\begin{document}
Text before.
\begin{figure}[H]
\centering
\includegraphics[width=50mm,height=20mm]{example-image-a}
\caption{Caption}
\end{figure}
Text after.
\end{document}
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{float}
\begin{document}
Text before.
\begin{figure}[H]
\centering
\includegraphics[width=150mm,height=20mm]{}
\caption{Caption}
\end{figure}
Text after.
\end{document}
-
2
-
A couple of other ways.
\documentclass{article}
\usepackage{graphicx}
\usepackage{todonotes}
\begin{document}
\begin{figure}
\centering
% \missingfigure is from todonotes
\missingfigure[figwidth=\linewidth,figcolor=white]{Some text if needed}
\caption{Bla}
\end{figure}
\begin{figure}
\centering
\framebox[7cm]{\scalebox{15}{X}}
\caption{Bla}
\end{figure}
\end{document}