2

I am editing a book and it has quite a lot of figures....I believe this is the reason why it takes long to compile.

I have to do some editing in the text, so I do not need it to load the figures for now...is there a way to do a lean compiling?

Adriano
  • 747

2 Answers2

2

The memoir class can be loaded with the option draft. It also provides the macro \ifdraftdoc, which executes different code depending on whether you are in draft mode or not. You could write a macro making use of this to insert your figures, something along the lines of

\newcommand{\insertfigure}[1]{%
    \ifdraftdoc
         \fbox{Placeholder for figure #1}%
    \else
         \includegraphicx{#1}%
    \fi%
}
Andreas
  • 955
1

Concerning \includegraphics: Either use the draft class or graphicx package option or drop the action of \includegraphics into litter bin such that it does nothing.

The \foreach loop is just use to 'blow' up the document's size and compilation time.

\documentclass{memoir}% or \documentclass[draft]{memoir}


\usepackage{graphicx}% 
\usepackage{pgffor}


\newif\ifdropfigures  % At the time of definition it is false!
\dropfigurestrue % yes, we drop figures
%\dropfiguresfalse
\ifdropfigures
\renewcommand{\includegraphics}[2][]{%
}% Ok, `\includegraphics does nothing any longer
\fi

\begin{document}
This is the output:

\foreach \x in {1,...,1000} {%  1000 times doing nothing. 
\includegraphics[scale=0.2]{ente}
}


\end{document}
  • What about the demo option if you don't care about the size of the image? – daleif May 31 '16 at 19:44
  • @daleif: Another option, of course. I had it in mind, but the black boxes aren't really nice –  May 31 '16 at 19:58
  • Might not be, but (1) users don't have to add code, (2) it is faster than draft, as draft still have to read the image to get the dimensions (AFAIR) – daleif May 31 '16 at 20:15