When I am using \includegraphics with the draft option


the image name is shown instead of the image. Unfortunately it appears on one line without lines breaks, so that it extends to the beyond the border and becomes unreadable. Is it possible to fix this?

  • That's \texttt, most likely, this doesn't break
    – user31729
    May 30, 2016 at 20:52

1 Answer 1


A horrible hack. But, hey! It works!


 {\edef\@tempa{#3}\rlap{ \ttfamily\expandafter\strip@prefix\meaning\@tempa}}
\tl_new:N \l_breitling_filename_tl
  \tl_set:Nx \l_breitling_filename_tl { #1 }
    \tl_map_inline:Nn \l_breitling_filename_tl { ##1 \hspace{0pt} }


Small height or width and a very long name might make the file name overlap the text above and below the rectangle.

enter image description here

  • Wow, what a hack! Thank you! I wish a solution would be implemented in \includegraphics because this is really an extreme hack and obfuscating tex files. Nevertheless I think it is important because without it the draft option is useless. May 31, 2016 at 9:27

You must log in to answer this question.

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