# Copyright issue, replace bitmaps by empty frame

I have a thesis to submit tomorrow as .pdf. The University requires written permission from the copyright holder for every figure taken from book/journal--a thing I don't have, and I didn't know was required until today.

The images in question are .pdf, .png and .jpg, typeset with pdflatex.

Is there some kind of environment I can wrap around the \includegraphics{} that will produce a replacement of the exact same size?

Checking width and height for each and every graph (sometimes I use the [resolution=300] statement) would take quite a while.

-
[draft] option should do that. –  David Carlisle Oct 15 '12 at 11:12
Not the best approach but maybe a quick fix: Use TikZ to draw a grey box over the images. TikZ can automatically use the same size as the figures as shown here: tex.stackexchange.com/questions/9559/…. Alternatively David's suggestion which will only show the filename. –  Alexander Oct 15 '12 at 11:12
I don't understand how that will solve your problem. The thesis will be fine without the pictures? Cannot you just redraw them by yourself and cite the source (you don't reuse them so you don't need the permission)? And if you cannot do this, think it's much better to remove them completely than to replace them with empty squares. –  yo' Oct 15 '12 at 11:27
I second David; \usepackage[draft]{graphicx} will do; for the pictures you want to include anyway, just add the option draft=false to \includegraphics: \includegraphics[draft=false,...]{file} –  egreg Oct 15 '12 at 12:00
@tohecz: That's a thing I didn't want to do. Page-breaks and page numbers would change in the whole document if deleting figures completely. So if I told somebody "I wrote this and that on page X", there would be some ambiguity. And I might get permission for some of the figures later on... –  user334287 Oct 16 '12 at 10:08

The draft option to graphicx will do what you want. It will make an empty box of the exact size that would be occupied by the picture, since the dimensions are still computed from the picture after applying all the options:

\usepackage[draft]{graphicx}


If you want to include a particular picture, use the draft=false option:

\includegraphics[draft=false,<other options>]{filename}


The draft option will print the file name inside the box; if you want something else, the following patch, to be added to your preamble after loading graphicx, will do:

\usepackage{etoolbox}
\makeatletter

\tiny
\begin{tabular}{@{}l@{}}
Figure omitted due to\\
missing permission\\
% comment the following line if you don't want to show the file name
\ttfamily\expandafter\strip@prefix\meaning\@tempa
\end{tabular}}
\makeatother


I've added a possible definition of \@missingcopyright which should explain why the picture is missing; if you don't want the file name, just remove the line starting with \ttfamily. If you want no message at all, just remove \@missingcopyright from the \patchcmd line (and the definition of \@missingcopyright).

-
Beautiful solution! Saving me hours of time. Just had some trouble to get [draft]-option activated. Was conflicting with \usepackage{rotating}, so I made a modified document class (containing \usepackage[draft]{rotating} instead of \usepackage{rotating}) and using this to switch the inclusion of figures on/off. –  user334287 Oct 15 '12 at 17:53
You can simply add \PassOptionsToPackage{draft}{graphicx} before the \documentclass line. –  egreg Oct 15 '12 at 17:56