7
...
\usepackage{graphicx}
...
\begin{center}
\includegraphics[width=7cm]{demo.png}
\end{center}
...

And output...

enter image description here

But, that I want below the picture. Not \usepackage[draft]{graphicx}, not shown image border. Like phantom. Save the sizes picture. That is, there is a image but whole white image. Is it possible?

enter image description here

1 Answer 1

9

Why not using \phantom, in a wrapper command named, say \phantomgraphics?

I've added a \ifphantomgraphics conditional to enable or disable the phantom feature. Just say \phantomgraphicsfalse to disable all up-coming phantoms and really use \includegraphics....

The draft key feature is really nice, but unfortunately it draws a frame and prints the file name -- which is not wanted here.

\documentclass{article}

\newif\ifphantomgraphics
\phantomgraphicstrue
\usepackage{graphicx}

\newcommand{\phantomgraphics}[2][]{%
  \ifphantomgraphics
  \leavevmode\phantom{\includegraphics[#1]{#2}}%
  \else
  \includegraphics[#1]{#2}%
  \fi
}

\usepackage{multicol}
\usepackage{blindtext}

\begin{document}

\begin{multicols}{2}
\blindtext
\phantomgraphics[scale=0.5]{ente}%
\hrule
\columnbreak

\blindtext
\phantomgraphicsfalse
\phantomgraphics[scale=0.5]{ente}%
\hrule
\end{multicols}

\end{document}

enter image description here

Other possibility: Hook into \includegraphics and add a phantom key etc.

From a little conversation with egreg in chat (http://chat.stackexchange.com/transcript/message/29085859#29085859)

The adjustbox package adds a phantom key to \includegraphics.

\documentclass{article}

\usepackage[export]{adjustbox}
%\usepackage{graphicx}

\usepackage{multicol}
\usepackage{blindtext}

\begin{document}

\begin{multicols}{2}
\blindtext
\includegraphics[width=2cm,phantom]{ente}%
\hrule
\columnbreak

\blindtext
\includegraphics[width=2cm]{ente}%
\hrule
\end{multicols}

\end{document}
2
  • Perfect working... @Christian Hupfer
    – Özgür
    Apr 18, 2016 at 8:46
  • 1
    @Özgür: You're welcome as usual. Happy TeXing!
    – user31729
    Apr 18, 2016 at 8:51

You must log in to answer this question.

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