8

I need a command that replaces its contents by white space of the same size. Unlike \phantom it should work paragraphs and/or images. It should do more or less the same as the \visible command of the beamer package when applied to a non-specified overlay number.

Looking at the source of the beamer package did not help me because I could not isolate my issue from the rest.

Any suggestions?

David Carlisle
  • 757,742

1 Answers1

12

You can put paragraphs and other vertical constructs in a parbox nested inside phantom so

\noindent
\phantom{%%% remove to make visible
\begin{minipage}{\textwidth}
.....
\end{minipage}%
}%%% remove to make visible

But as with all phantoms note that this freezes the contents in a box so that all white space is frozen to its natural size, and no page breaking will occur, so the spacing is not the same if the construct was not used at all, however if you just remove the two lines marked in the block above, leaving the minipage then you can switch between visible and non-visible form without affecting the position of any other text in the document.

David Carlisle
  • 757,742