Issue #139 open

Stop increasing transparency for list environments

mike_km
created an issue

Hello,

with \setbeamercovered{transparent} the transparency is increased for each new level of list environments (itemize, enumerate, and description). If a picture is used as background, some items might appear (partially) inverted, because the transparency is only simulated. To fix this, I've created a patch, which adds an additional option for \setbeamercovered. This option stops the transparency to increase after a given level.

It works for my purpose, and since I didn't test it beyond that, I consider this feature experimental!

Some remarks on the attached patch: the patch is against version 3.10 of beamer. I hope it is useful. I'm not sure about line 300 in the original of beamerbaseoverlay.sty (\gdef\beamer@pgfextension{!##2opaque}). Since I couldn't figure out what this line does, the patch may cause trouble somewhere.

Bye, Mike

Comments (3)

  1. mike_km reporter

    Hello,

    here is an MWE. I included the patched version of \beamer@startcovered, so you can view the result without applying the patch.

    The blue box simulates a background image. Without the patch, item 2.1.1 appears to be partially inverted.

    Uncomment line 66 to use the patch. You can change the number assigned to maxdepth. 0 is not recommended and 3 or higher will lead to the same result as without the patch. Only 1 and 2 will change the transparency in the example.

    Bye, Mike

    \documentclass{beamer}
    
    % patched version of \beamer@startcovered
    \makeatletter
    \def\beamer@maxcoveringdepth{100}
    
    \def\beamer@startcovered{%
      \beamer@smuggle{%
      \global\advance\beamer@coveringdepth by 1\relax%
      \beamer@actions{\pgfsys@begininvisible\aftergroup\beamer@@spacingcover}{%
         \pgfsys@endinvisible\aftergroup\beamer@@spacingcover%
         }%
      \def\opaqueness<##1>##2{%
        \only<##1>{%
          \beamer@actions{%
            \expandafter\xdef\csname beamer@oldcolorhook%
            \the\beamer@coveringdepth\endcsname{\beamer@colorhook}%
            \expandafter\xdef\csname beamer@oldpgfextension%
            \the\beamer@coveringdepth\endcsname{\beamer@pgfextension}%
            {\globalcolorstrue\colorlet{beamer@freeze\the\beamer@coveringdepth}{bg}}%
            \ifnum\beamer@coveringdepth>\beamer@maxcoveringdepth%
            \else
              \xdef\beamer@colorhook{!##2!beamer@freeze%
                \the\beamer@coveringdepth\beamer@colorhook}%
    % don't know what this is used for,
              \gdef\beamer@pgfextension{!##2opaque}%
            \fi
            \color{.}%
          }%
          {%
            \xdef\beamer@colorhook{\csname beamer@oldcolorhook%
              \the\beamer@coveringdepth\endcsname}%
            \xdef\beamer@pgfextension{\csname beamer@oldpgfextension%
              \the\beamer@coveringdepth\endcsname}%
            \color{.}%
          }}}%
      \ifnum\beamer@slideinframe<\beamer@minimum%ok, at beginning
      {%
        \beamer@saveanother%
        \advance\beamer@minimum by-\beamer@slideinframe%
        \beamer@slideinframe=\beamer@minimum%
        \beamer@uncoverbeforeactions%
        \beamer@restoreanother%
      }%
      \else%
      {%
        \beamer@saveanother%
        \advance\beamer@slideinframe by-\beamer@minimum%
        \beamer@uncoverafteractions%
        \beamer@restoreanother%
      }%
      \fi%
      \beamer@do%
      }%
    }
    
    \define@key{beamer@mixin}{maxdepth}[1]{%
      \def\beamer@maxcoveringdepth{#1}}
    
    \makeatother
    
    %%%%% without using the patch
    \setbeamercovered{transparent=50}
    
    %%%%% with patch used
    %\setbeamercovered{transparent=50,maxdepth=1}
    
    % ``background image''
    \setbeamertemplate{background canvas}{\color{blue!30!white}%
    \rule{0.33\paperwidth}{\paperheight}}
    
    \begin{document}
    \begin{frame}
    \frametitle{Example}
    \begin{itemize}[<+->]
    \item Item 1
        \begin{itemize}
        \item Item 1.1
            \begin{itemize}
            \item Item 1.1.1
            \item Item 1.1.2
            \end{itemize}
        \item Item 1.2
            \begin{itemize}
            \item Item 1.2.1
            \item Item 1.2.2
            \end{itemize}
        \end{itemize}
    \item Item 2
        \begin{itemize}
        \item Item 2.1
            \begin{itemize}
            \item Item 2.1.1
            \item Item 2.1.2
            \end{itemize}
        \item Item 2.2
            \begin{itemize}
            \item Item 2.2.1
            \item Item 2.2.2
            \end{itemize}
        \end{itemize}
    \end{itemize}
    \end{frame}
    \end{document}
    
  2. Log in to comment