如何重新定义 graphicx 包的草稿模式,使其不绘制图形边框,而只绘制图像路径?我想打印不带图片的文档,然后粘贴照片。
答案1
盒子绘制依赖于相当复杂的命令\Gin@setfile
;然而一些补丁可以“轻松”应用:
\documentclass{article}
\usepackage[draft]{graphicx}
% Let's patch \Gin@setfile rather than copying its definition and change it
\usepackage{etoolbox}
\makeatletter
\patchcmd\Gin@setfile{\vrule\hss}{\vrule\@width\z@\hss}{}{}
\patchcmd\Gin@setfile{\hss\vrule}{\hss\vrule\@width\z@}{}{}
\patchcmd\Gin@setfile{\hrule\@width}{\hrule\@height\z@\@width}{}{}
\patchcmd\Gin@setfile{\vss\hrule}{\vss\hrule\@height\z@}{}{}
\makeatother
\begin{document}
\includegraphics{filename}
\end{document}