# How do I define a phantom block?

I want to define a type of block which when it is given some text, I will print nothing but it will take exactly the same space as a normal block.

I am using white background, so I tried to just make everything white, but I cannot make the shadow white.

Edit: A minimal example is the following:

\documentclass[handout]{beamer}
\newenvironment<>{phantomblock}[1][]{%
\setbeamercolor{block title example}{fg=white,bg=white}%
\setbeamercolor{block body example}{fg=white,bg=white}%
\begin{example}#2[#1]}{\end{example}}
\begin{document}
\begin{frame}{title}
\begin{phantomblock}{test}
test
\end{phantomblock}
\end{frame}
\end{document}


Which produces:

• Have you tried putting it in the argument of \phantom{...}? – Skillmon Oct 12 at 22:11
• Please, show us, what you try so far. – Zarko Oct 12 at 22:11
• @Zarko I added it – tst Oct 12 at 22:19
• @Skillmon I did try, it doesn't work – tst Oct 12 at 22:20

The beamer specification <all:0> is probably your friend.

## Code

\documentclass{beamer}

\begin{document}

\begin{frame}{Some Title}
The text before an invisible block:
\medskip

{\itshape
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.}
%
% Invisible block; see the specification <all:0>.
% ---------------------------------------
\begin{block}{Title of this block}<all:0>
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Nulla consequat massa quis enim. Donec pede justo, fringilla vel,
aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a,
venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.
Integer tincidunt. Cras dapibus.
\end{block}
% ---------------------------------------
Some text after an invisible block.
\medskip

{\itshape
Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus.}
\end{frame}

\end{document}


## Conclusion

Now, it is easy to define this type of block. But I think it is wasting time since it suffices to add the mentioned specification to the block environment (or to any other environment accepting this kind of specifications).

But in case you really want it, you can write something like the following code.

\newenvironment{secret}[1][]%
{\begin{block}<all:0>
#1}
{\end{block}}


Now, you can call your invisible environment in a usual way \begin{secret} and \end{secret}.

• Excellent. Always my warmest regards. – Sebastiano Oct 13 at 8:17
• That is great, thanks. Could you please tell me where I can read about this specification? Is it in the beamer documentation or some package provides it? – tst Oct 13 at 13:54
• @tst: See the beamer manual (version 3.57), section 20, and look at the mode specifications. Also, this link is very usefull. – Marian G. Oct 13 at 16:35