关闭和打开图 2 中的图像

关闭和打开图 2 中的图像

我对图形包中的草稿命令感到困扰。

\usepackage[draft]{graphicx}

我的文档很大,所以我不想只加载图像,而是希望保留通过 href 包设置的其余文本格式。我找到了此文档,但尝试时收到错误代码。

链接 -->关闭和打开图形中的图像

谢谢你的观看!

@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}

答案1

虽然有些建议提供了避免将实际图像放入文档的方法,但其中许多建议仍然需要从磁盘读取图像或产生一些此类开销。由于希望避免访问每个图像的磁盘,因此我建议重新定义\includegraphics如下:

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

这样,在文档中就放置了一个占位符,但完全避免了在磁盘中搜索图像或其目录条目的开销。

正如我们从下面的结果中看到的,\fbox插入的不是图像,而是小图像。

\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}

在此处输入图片描述

相关内容