1

I am having troubles with the draft command in the graphic package.

\usepackage[draft]{graphicx}

My document is large so I don't want just the images to load, but want to keep the rest of the text formatting I have setup through the href package. I found this document, but when I try I get an error code.

LINK --> Turning off and on images in figures

Thanks for looking!

@Book{church13,
  Title                    = {Space Debris: Models and Risk Analysis},
  Author                   = {Klinkrad, H. and Doe, J.},
  Publisher                = {Springer},
  Address                  = {Berlin},
  Year                     = {2006},
}

%Preamble
\documentclass[a4paper,12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{setspace} %Sets double space
\usepackage{csquotes} %Block Quote
\usepackage{soul} %Font effects
\setlength\headheight{14.5pt}

% Comments, Todo's, and notes package
\usepackage[utf8]{inputenc}
\newcommand{\cmmnt}[1]{} % \cmmnt{}
\usepackage[colorinlistoftodos]{todonotes} %marginpar error
    \setlength{\marginparwidth}{3.5cm}
    \extrafloats{100}
    \reversemarginpar
\usepackage{caption}
    \captionsetup{font=footnotesize,labelfont={bf,sf}}
    \usepackage{lipsum,tocloft}

% TOC, Citations, References, and Appendices
\usepackage{hyperref}
\urlstyle{same}
\hypersetup{
   colorlinks={true},
   linkcolor={blue},
   citecolor={green},
   urlcolor={black!70},
   filecolor={magenta},
   pdftitle={Sharelatex Example},
   pdfpagemode={FullScreen},}
%Warning - unsupported tocstyle code
\usepackage[tocindentauto]{tocstyle}
    \renewcommand{\thesection}{\Roman{section}} 
    \renewcommand{\thesubsection}{\arabic{subsection}.}
    \renewcommand{\thesubsubsection}{\roman{subsubsection}.}
    \makeatletter
    \def\@seccntformat#1{\llap{\csname the#1\endcsname\quad}}
    \makeatother
\usepackage{apacite} % \cite{ref1,ref2}
\usepackage[toc,page]{appendix}

% Images Bank
\usepackage[]{graphicx}
\usepackage{subcaption}
\usepackage[utf8]{inputenc}
\usepackage[export]{adjustbox}
\captionsetup[sub]{font=footnotesize,labelfont={bf,sf}}
%----------------------------------Begin Document
\begin{document}

\todo[inline, nolist, color=white]{I enabled draft mode in the document class for editing, so the images will not load. I did this because the compilation was taking forever, then timed out. But then I lost other formatting...}

\tableofcontents

\section{Introduction}
These are words \footnote{This is a footnote} \cite{church13}.

\begin{figure}[ht!]
\begin{subfigure}{0.2\textwidth}
\includegraphics[width=1\linewidth, height=5cm]{frog.jpg}
\caption{Top Layer Artwork}
\label{fig:Top Layer}
\end{subfigure}
\begin{subfigure}{0.2\textwidth}
\includegraphics[width=1\linewidth, height=5cm]{frog.jpg}
\caption{Bottom Layer Artwork}
\label{fig:Bottom Layer}
\end{subfigure}
\begin{subfigure}{0.2\textwidth}
\includegraphics[width=1\linewidth, height=5cm]{frog.jpg}
\caption{Power Layer Artwork}
\label{fig:Power Layer}
\end{subfigure}
\begin{subfigure}{0.2\textwidth}
\includegraphics[width=1\linewidth, height=5cm]{frog.jpg}
\caption{Ground Layer Artwork}
\label{fig:Ground Layer}
\end{subfigure}
\caption{Gerber file screen shots courtesy of Rice University.}
\label{fig:Artwork Image Bank}
\end{figure}
%---------------------------------------Referenc

\bibliographystyle{apacite}
\bibliography{bibliography}
%---------------------------------------Appendix

\end{document}
  • You might be able to get away with \renewcommand\includegraphics[2][]{} to suppress the images. However, that will change the document appearance significantly, in that no space will be allocated for the suppressed figures. If you want to put something in its place, you could replace the {} of the \renewcommand with, for example, {\fbox{IMAGE}}. – Steven B. Segletes Jul 11 '16 at 19:24
  • Exactly which error do you get? Why is there a bibtex entry at the start of your code? How is bibtex related to your question? Might be an idea to minimize the question a bit more. Why loafing inputenc several times with different options? Also you might want to look at the demo option for graphicx – daleif Jul 11 '16 at 19:28
  • See my answer here, perhaps it helps: http://tex.stackexchange.com/questions/304893/reserve-the-same-space-a-given-picture-would-take –  Jul 11 '16 at 19:28
  • Hm, I just tested your document and there's no error (after stripping the bib-stuff at the beginning, of course), but as @daleif stated: The preamble is a mess! –  Jul 11 '16 at 19:34
  • Seems I misread the inputenc options, sorry about that. They should not pose a problem – daleif Jul 11 '16 at 19:39
  • @StevenB.Segletes Thank you! Placing that code at the end of the \usepackage{graphicx} worked great. I am alright with the tiny blank image boxes being there instead of the formatted sizes while I'm drafting. It was just taking too long to load, but I also like being able to prominently see my citation when checking over my progress and notes. If you post your answer for this, I'll rank it up!! – Matthew Olson Jul 11 '16 at 23:08
  • As for the preamble being a mess! I have no idea what I'm really doing. The Professor I'm working with said here ya go, use this because it sooooo much better than Word; and if you need help, you can just Google it...

    So, If anyone wants to clean it up the file (including what I didn't take out), I'll be happy to let you cuz all I got is HTML knowledge from the year 2000 -- However, as long as it works, I'll be fine...

    – Matthew Olson Jul 11 '16 at 23:12

1 Answers1

1

While some of the suggestions provide ways to avoid placing the actual image into the document, a number of them still require the image to be read from the disk or some such overhead. Since the desire was to avoid accessing the disk for each image, I instead propose redefining \includegraphicsas follows:

\renewcommand\includegraphics[2][]{\fbox{Image}} 

In this way, a placeholder is placed in the document, but the overhead of searching the disk for the image or its directory entry is wholly avoided.

As we see from the result below, instead of the image, a small \fbox is inserted.

\documentclass[a4paper,12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{setspace} %Sets double space
\usepackage{csquotes} %Block Quote
\usepackage{soul} %Font effects
\setlength\headheight{14.5pt}

% Comments, Todo's, and notes package
\usepackage[utf8]{inputenc}
\newcommand{\cmmnt}[1]{} % \cmmnt{}
\usepackage[colorinlistoftodos]{todonotes} %marginpar error
    \setlength{\marginparwidth}{3.5cm}
    \extrafloats{100}
    \reversemarginpar
\usepackage{caption}
    \captionsetup{font=footnotesize,labelfont={bf,sf}}
    \usepackage{lipsum,tocloft}

% TOC, Citations, References, and Appendices
\usepackage{hyperref}
\urlstyle{same}
\hypersetup{
   colorlinks={true},
   linkcolor={blue},
   citecolor={green},
   urlcolor={black!70},
   filecolor={magenta},
   pdftitle={Sharelatex Example},
   pdfpagemode={FullScreen},}
%Warning - unsupported tocstyle code
\usepackage[tocindentauto]{tocstyle}
    \renewcommand{\thesection}{\Roman{section}} 
    \renewcommand{\thesubsection}{\arabic{subsection}.}
    \renewcommand{\thesubsubsection}{\roman{subsubsection}.}
    \makeatletter
    \def\@seccntformat#1{\llap{\csname the#1\endcsname\quad}}
    \makeatother
\usepackage{apacite} % \cite{ref1,ref2}
\usepackage[toc,page]{appendix}

% Images Bank
\usepackage[]{graphicx}
\usepackage{subcaption}
\usepackage[utf8]{inputenc}
\usepackage[export]{adjustbox}
\captionsetup[sub]{font=footnotesize,labelfont={bf,sf}}
%----------------------------------Begin Document
\renewcommand\includegraphics[2][]{\fbox{Image}} 
\begin{document}

\todo[inline, nolist, color=white]{I enabled draft mode in the document class for editing, so the images will not load. I did this because the compilation was taking forever, then timed out. But then I lost other formatting...}

\tableofcontents

\section{Introduction}
These are words \footnote{This is a footnote} \cite{church13}.

\begin{figure}[ht!]
\begin{subfigure}{0.2\textwidth}
\includegraphics[width=1\linewidth, height=5cm]{frog.jpg}
\caption{Top Layer Artwork}
\label{fig:Top Layer}
\end{subfigure}
\begin{subfigure}{0.2\textwidth}
\includegraphics[width=1\linewidth, height=5cm]{frog.jpg}
\caption{Bottom Layer Artwork}
\label{fig:Bottom Layer}
\end{subfigure}
\begin{subfigure}{0.2\textwidth}
\includegraphics[width=1\linewidth, height=5cm]{frog.jpg}
\caption{Power Layer Artwork}
\label{fig:Power Layer}
\end{subfigure}
\begin{subfigure}{0.2\textwidth}
\includegraphics[width=1\linewidth, height=5cm]{frog.jpg}
\caption{Ground Layer Artwork}
\label{fig:Ground Layer}
\end{subfigure}
\caption{Gerber file screen shots courtesy of Rice University.}
\label{fig:Artwork Image Bank}
\end{figure}
%---------------------------------------Referenc

\bibliographystyle{apacite}
\bibliography{bibliography}
%---------------------------------------Appendix

\end{document}

enter image description here