6

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}
\usetheme{Boadilla}
\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: enter image description here

tst
  • 236

1 Answers1

9

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

Code

\documentclass{beamer}

\usetheme{Boadilla}

\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}

Output

enter image description here

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}.

Marian G.
  • 1,951
  • 1
  • 9
  • 14
  • Excellent. Always my warmest regards. – Sebastiano Oct 13 '19 at 08: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 '19 at 13:54
  • 1
    @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 '19 at 16:35