# Beamer: double uncover hides instead of watermarks

When I make a presentation with nested enumerations where each enumeration needs to be animated, the inner enumeration is completely hidden from the slide until its parent becomes visible, while the other items are only watermarked. Is there a way all the items are watermarked until they become active?

Code:

\begin{frame}{Test}
\begin{enumerate}[<+->]
\item Item1
\item Item2
\begin{enumerate}[<+->]
\item Item2A
\item Item2B
\end{enumerate}
\item Item3
\end{enumerate}
\end{frame}

-
Can you try putting \setbeamercovered{transparent} after \begin{document} ? – percusse Apr 15 '12 at 20:30
I have done that, it doesn't seem to solve the problem. – Willem Van Onsem Apr 15 '12 at 21:56
They are not invisible they are too dim. I can see them on my screen. But still, I don't have a fix. – percusse Apr 15 '12 at 22:09
I agree it's a detail, it however makes the audience starts focusing on the list of subitems that become less dim. Thats of course not the intention. :D – Willem Van Onsem Apr 15 '12 at 23:38

You can use \only to change the transparency level for the nested environment:

\documentclass{beamer}

\setbeamercovered{transparent}

\begin{document}

\begin{frame}{Test}
\begin{enumerate}[<+->]
\item Item1
\item Item2
\only<1->{\setbeamercovered{transparent=100}}
\only<2->{\setbeamercovered{transparent=15}}
\begin{enumerate}[<+->]
\item Item2A
\item Item2B
\end{enumerate}
\item Item3
\end{enumerate}
\end{frame}

\end{document}


An image of the first frame:

The code can be automated with the help of the etoolbox package:

\documentclass{beamer}
\usepackage{etoolbox}

\setbeamercovered{transparent}

\makeatletter
\BeforeBeginEnvironment{enumerate}{\ifnum\@enumdepth=1
\only<1->{\setbeamercovered{transparent=100}}%
\only<\theenumi->{\setbeamercovered{transparent=20}}%
\fi
}
\makeatother

\begin{document}

\begin{frame}{Test}
\begin{enumerate}[<+->]
\item Item1
\item Item2
\item Item3
\begin{enumerate}[<+->]
\item Item3A
\item Item3B
\item Item3C
\end{enumerate}
\item Item4
\end{enumerate}
\end{frame}

\end{document}


The first frame:

-
That solves the problem! I will probably use this code because the deadline is within 2 days. However I had hoped for a more elegant solution :s. For instance in this sample one needs to calculate when a item will become visible. – Willem Van Onsem Apr 16 '12 at 21:03
@CommuSoft: I've updated my answer with an automated version. – Gonzalo Medina Apr 16 '12 at 21:28
Note that in your automated version you used 20 instead of 15. (It doesn't seem to make a difference in the output ...) – Hendrik Vogt Sep 25 '12 at 16:02
This solution works great with \setbeamercovered{transparent}, but not with \setbeamercovered{dynamic} (or highly dynamic). – Hendrik Vogt Sep 25 '12 at 16:03

As percusse noted in his comment, the subitems are not invisible but just much dimmer than the items. I don't think that this is the intended behaviour! What happens here is that the nested enumerates give you nested actionenvs, and each action environment level gives a dimming of 85%.

To fix this, it's best to get rid of the nesting of action environments. From Gonzalo's answer I took the idea to use \BeforeBeginEnvironment and \AfterEndEnvironment from the etoolbox package. The code below works with nested enumerate, itemize and description. The following output is created with \setbeamercovered{highly dynamic} instead of \setbeamercovered{transparent}, just to demonstrate that this also works.

\documentclass{beamer}
\usepackage{etoolbox}
%\setbeamercovered{transparent}
\setbeamercovered{highly dynamic}
\makeatletter
\newcommand*\fix@beamer@close{%
\ifnum\beamer@trivlistdepth>0
\beamer@closeitem
\fi
}
\newcommand*\fix@beamer@open{%
\ifnum\beamer@trivlistdepth>0
\gdef\beamer@closeitem{}%
\fi
}
\BeforeBeginEnvironment{enumerate}{\fix@beamer@close}
\AfterEndEnvironment{enumerate}{\fix@beamer@open}
\BeforeBeginEnvironment{itemize}{\fix@beamer@close}
\AfterEndEnvironment{itemize}{\fix@beamer@open}
\BeforeBeginEnvironment{description}{\fix@beamer@close}
\AfterEndEnvironment{description}{\fix@beamer@open}
\makeatother
\begin{document}
\begin{frame}{Test}
\begin{enumerate}[<+->]
\item Item1
\item Item2
\begin{itemize}%[<+->]
\item Item2A
\item Item2B
\end{itemize}
\item Item3
\end{enumerate}
\end{frame}
\end{document}


Note that you don't need the [<+->] in the inner enumerate or itemize environment. (By default, the [<+->] of the outer environment is used.)

-