Is there a way to obtain a pdf file without figures and tables, while maintaining the figure numbers in the body text.
Thank you very much
Is there a way to obtain a pdf file without figures and tables, while maintaining the figure numbers in the body text.
Thank you very much
You might use the following utilizing the ifdraft package:
\documentclass[draft]{scrartcl}
\usepackage{ifdraft}
\usepackage{graphicx}
\newcommand{\tabledraft}[2]{%
\ifdraft{\refstepcounter{table}\label{#1}}{#2}%
}
\newcommand{\figuredraft}[2]{%
\ifdraft{\refstepcounter{figure}\label{#1}}{#2}%
}
\begin{document}
\figuredraft{fig:ex-a}{
\begin{figure}
\centering
\includegraphics[width=5cm]{example-image-a}
\caption{Example image a}\label{fig:ex-a}
\end{figure}
}
\tabledraft{tab:ex}{
\begin{table}
\centering
\caption{A neat table}\label{tab:ex}
\begin{tabular}{ll}
\hline
neat&table\\
being&neat\\
\hline
\end{tabular}
\end{table}
}
Some random text.
Figure \ref{fig:ex-a} is nice but table \ref{tab:ex} is even nicer.
\end{document}
With draft-option resulting in:
And without it resulting in:
This solution (using Skillmon's MWE) makes the figure or table invisible, although it actually goes through all the steps of drawing it.
\documentclass[draft]{scrartcl}
\usepackage{ifdraft}
\usepackage{graphicx}
\usepackage{environ}
\makeatletter
\ifdraft{\RenewEnviron{figure}[1][tbp]%
{\hrule height0pt \rlap{\hspace{\paperwidth}\smash{\begin{minipage}{\textwidth}%
\def\@captype{figure}\BODY\end{minipage}}}\ignorespaces}}
\ifdraft{\RenewEnviron{table}[1][tbp]%
{\hrule height0pt \rlap{\hspace{\paperwidth}\smash{\begin{minipage}{\textwidth}%
\def\@captype{table}\BODY\end{minipage}}}\ignorespaces}}
\makeatother
\begin{document}
Before text
\begin{figure}
\centering
\includegraphics[width=5cm]{example-image-a}
\caption{Example image a}\label{fig:ex-a}
\end{figure}
\begin{table}
\centering
\caption{A neat table}\label{tab:ex}
\begin{tabular}{ll}
\hline
neat&table\\
being&neat\\
\hline
\end{tabular}
\end{table}
After text.
Figure \ref{fig:ex-a} is nice but table \ref{tab:ex} is even nicer.
\end{document}
graphicx-package the optiondraftexists, which replaces all images included with it with placeholders. – Skillmon Mar 25 '17 at 12:12\ifdraftfrom that link and wrap it around all your tables and figures. This way you accomplish the stuff you want. – Skillmon Mar 25 '17 at 15:15