# How I can speed up the compilation of a document with multiple images? [duplicate]

When I compile a large document with many images, this compilation is very slow. Exist any method that allow read ONLY (no rendering) the width and height of imagen and then simulate this image with a dummy rule. For example:

\newdimen\onlyWidth
\newdimen\onlyHeight

\begin{figure}[t]
\rule{\onlyWidth}{\onlyHeight}
\caption{any}
\end{figure}

-

## marked as duplicate by Martin Schröder, T. Verron, Guido, Claudio Fiandrino, m0nhawkJun 29 '13 at 11:31

\usepackage[draft]{graphicx}


still reads the files to determine size info but just typesets a rule.

-
Perfect, thank you very much – David Jun 28 '13 at 11:32

If you are using \includegraphics you can try to use the [draft] option in this way \includegraphics[draft]{image.jpg}. This will improve the time of compilation but I don't know if it is sufficient.

Or you can use something like this

\usepackage{calc}
\def\mygraphic{\includegraphics{...}}

\newlength\imageheight
\setlength\imageheight{\heightof{\mygraphic}}

\mygraphic % to insert the image

\vspace{\graphicheight} % a blank space of the height of your image

-
The vspace won't make the same space as the graphic as it is a vertical mode command whereas \includegraphics is a horizontal mode thing so would start a paragraph and get \parskip or \baselineskip spacing in addition to its natural height. You could use \rule instead of \vspace but that is the same (but less efficient) as using draft. – David Carlisle Jun 28 '13 at 11:31