1

I know in Latex there are draft class that can be used as a trick for speed up compilation time. In this class, there are no image that loaded to compilation result. But is there any possibility to implement the same thing to only one frame in beamer. I mean how to make latex compiler not to loaded graphic image within specific frame, or to load only image in specific frame and to ignore the others?

0

2 Answers 2

2

Here is a simple solution using the draft option of graphicx package. The \setdraftmode (respectively \unsetdraftmode) macro activates (respectively deactivates) the draft mode.

\documentclass{beamer}
\usepackage{graphicx}
\let\origincludegraphics\includegraphics
\newcommand\draftincludegraphics[2][]{\origincludegraphics[draft,#1]{#2}}
\def\setdraftmode{\let\includegraphics\draftincludegraphics}
\def\unsetdraftmode{\let\includegraphics\origincludegraphics}

\begin{document}

\setdraftmode

\begin{frame}
  \frametitle{First frame}
  \includegraphics[width=.7\linewidth]{example-image-a}
\end{frame}

\unsetdraftmode

\begin{frame}
  \frametitle{Second frame}
  \includegraphics[width=.7\linewidth]{example-image-a}
\end{frame}

\end{document}

enter image description here

2

Have a look at the following. If draft is set in the global options, just the filename is printed. If draft is not set, the image is included.

Remark: I am not sure how I can forward image options (width, height) to the command.

\documentclass[12pt,draft]{beamer}
\usepackage{graphicx}
\usepackage{ifdraft}

\newcommand{\draftinclude}[1]{
\ifdraft{%
#1}%
{\includegraphics{#1}}}

\begin{document}

\frame{
\frametitle{Test}

\draftinclude{gls.png}

}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .