6

I want to \uncover a citation in a particular overlay. The problem is that the bibliography's item icon (article in this case) is not set as transparent, but the text is.

How can I make the icon transparent also?

Here is the MWE:

\documentclass{beamer}

\begin{document}

\begin{frame}
\setbeamercovered{transparent}

\begin{thebibliography}{1}
\uncover<1>{
    \setbeamertemplate{bibliography item}[article]
    \bibitem{}
    \scriptsize Doe, J. (1975).
    \newblock\scriptsize Title of the first paper.
    \newblock {\em Journal.}
}
\uncover<1-2>{
    \setbeamertemplate{bibliography item}[article]
    \bibitem{}
    \scriptsize Doe, J. (1980).
    \newblock\scriptsize Title of the second paper.
    \newblock {\em Journal.}
}
\end{thebibliography}

\end{frame}

\end{document}

And here is the output:

output gif

2
  • I don't think it's possible, but I hope to be proved wrong.
    – egreg
    Dec 3, 2014 at 22:48
  • This is the case in general when you include an image. If the graphic was drawn in TeX, then the overlay specification works as expected.
    – Werner
    Dec 3, 2014 at 23:27

2 Answers 2

3

There is a related question. I think Jealie's answer seems to be what you want, but I can't get it to work.

The general problem is the way the transparency is generated. Using custom (text) symbols could be an option (since there is no problem with text) or a tikz picture. That led me to spend way too much time on recreating the article icon (even though a more minimalistic icon would probably be better) in tikz and came up with this work around:

enter image description here

Generated by:

\documentclass{beamer}

\usepackage{tikz}
\begin{document}

\begin{frame}

\setbeamercovered{transparent}

\setbeamertemplate{bibliography item}{
\begin{tikzpicture}[color=gray,scale=0.4,very thin]
\draw (0.1,0.82)--(.5,.82); %headline
\draw (0.15,0.72)--(.55,.72); %abstact
\draw (0.15,0.62)--(.55,.62);

\draw (0.08,0.48)--(.32,.48); %left column
\draw (0.08,0.38)--(.32,.38);
\draw (0.08,0.28)--(.32,.28);
\draw (0.08,0.18)--(.32,.18);
\draw (0.08,0.1)--(.32,.1);

%right column
\draw[fill=blue!70!black,draw=none] (0.4,0.5)--(.62,.5)--(.62,.4)--(0.4,0.4) --(0.4,0.5);
\draw[fill=red!70!black,draw=none] (0.4,0.4)--(.62,.4)--(.62,.3)--(0.4,0.3) --(0.4,0.4);
\draw[fill=green!70!black,draw=none] (0.4,0.3)--(.62,.3)--(.62,.2)--(0.4,0.2) --(0.4,0.3);
\draw (0.4,0.1)--(.62,.1);

%page
\draw[black,fill=yellow!40!gray,fill opacity=0.3,line width=0.4pt] (0,0) -- (0,.95) -- (0.5,.95) -- (.7,0.75) -- (.7,0) --(0,0);
\draw[black,fill=black!10!brown,join=round] (0.5,.95) -- (0.7,0.75) -- (0.5,0.75) --(0.5,.95);
\end{tikzpicture}
}
\begin{thebibliography}{1}

\uncover<1>{
    \bibitem{}
    \scriptsize Doe, J. (1975).
    \newblock\scriptsize Title of the first paper.
    \newblock {\em Journal.}
}
\uncover<1-2>{
    \bibitem{}
    \scriptsize Doe, J. (1980).
    \newblock\scriptsize Title of the second paper.
    \newblock {\em Journal.}
}

\end{thebibliography}

\end{frame}

\end{document}
1
  • Good answer and great work recreating the article's icon in tikz (+1). However, I found that there are some differences between the tikz icon and the original one, so I am still looking for a solution that works with the original icon.
    – epsilone
    Dec 4, 2014 at 9:24
3

EDIT: There are two possibilities for obtaining the desired transparency effect. The original solution making use only of the beamer code is given in Method 2. A simpler and maybe more elegant solution based on the transparent package is given as Method 1.

Method 1

Using the package transparent it is possible to create a simple transparent environment that makes text and icons transparent on the desired overlay.

The output:

Output Method 1

The code:

\documentclass{beamer}

% Required package
\usepackage{transparent}

% Create transparent environment
\newenvironment<>{transpenv}{\bgroup\only#1{\transparent{0.2}}}{\egroup}

\begin{document}

\begin{frame}

\setbeamercovered{transparent}

\begin{thebibliography}{1}

% Normal article entry
\setbeamertemplate{bibliography item}[article]
\bibitem{}
\scriptsize Doe, J. (1975).
\newblock\scriptsize Title of the first paper.
\newblock {\em Journal.}

% Transparent article entry on overlay 2
\begin{transpenv}<2>
\setbeamertemplate{bibliography item}[article]
\bibitem{}
\scriptsize Doe, J. (1980).
\newblock\scriptsize Title of the second paper.
\newblock {\em Journal.}
\end{transpenv}

% % BOOK % %        

% Normal book entry

\setbeamertemplate{bibliography item}[book]
\bibitem{}
\scriptsize Doe, J. (2000).
\newblock\scriptsize {\em Title of the first book.}
\newblock Editorial.

% This changes the transparency of the text
\begin{transpenv}<2>
\setbeamertemplate{bibliography item}[book]
\bibitem{}
\scriptsize Doe, J. (2010).
\newblock\scriptsize {\em Title of the second book.}
\newblock Editorial.
\end{transpenv}

% % ONLINE % %

% Normal web entry
\setbeamertemplate{bibliography item}[online]
\bibitem{}
\scriptsize Doe, J. (2001).
\newblock\scriptsize {\em Title of the first website.}
\newblock The website.

% This changes the transparency of the text
\begin{transpenv}<2>
\setbeamertemplate{bibliography item}[online]
\bibitem{}
\scriptsize Doe, J. (2014).
\newblock\scriptsize {\em Title of the second website.}
\newblock The website.
\end{transpenv} 

\end{thebibliography}

\end{frame}

\end{document}

Method 2

After some research on the beamer's source I found a satisfying solution, since the transparent icons for the bibliography are indeed available here. For example, the transparent beamericonarticle.pdf is beamericonarticle.20.pdf.

So the idea is to use \uncover for the transparency of the text and select the appropiate icon on each overlay. This is a little tricky if you want to be coherent with beamer's original display and alignment of bibliography icons, so you need to mimick exactly what it does. This is the reason of the new commands \iconarticle, \iconbook, \icononline and their transparent versions \iconarticletransparent, \iconbooktransparent, \icononlinetransparent.

The output:

Output Method 2

The code:

\documentclass{beamer}

% Commands to center properly the figures (codes constructed from the information in beamerinnerthemedefault.sty and beamerbaseauxtemplates.sty)
\newcommand{\iconarticle}{\lower3.5pt\hbox{\hskip2pt\includegraphics[width=11pt,height=14pt]{{beamericonarticle}.pdf}}}
\newcommand{\iconarticletransparent}{\lower3.5pt\hbox{\hskip2pt\includegraphics[width=11pt,height=14pt]{{beamericonarticle.20}.pdf}}}
\newcommand{\iconbook}{\lower2pt\hbox{\includegraphics[width=14pt,height=12pt]{{beamericonbook}.pdf}}}
\newcommand{\iconbooktransparent}{\lower2pt\hbox{\includegraphics[width=14pt,height=12pt]{{beamericonbook.20}.pdf}}}
\newcommand{\icononline}{\lower2pt\hbox{\includegraphics[width=14pt,height=14pt]{{beamericononline}.pdf}}}
\newcommand{\icononlinetransparent}{\lower2pt\hbox{\includegraphics[width=14pt,height=14pt]{{beamericononline.20}.pdf}}}

\begin{document}

\begin{frame}

\setbeamercovered{transparent}

\begin{thebibliography}{1}

% % ARTICLE % %

% Normal article entry
\setbeamertemplate{bibliography item}[article]
\bibitem{}
\scriptsize Doe, J. (1975).
\newblock\scriptsize Title of the first paper.
\newblock {\em Journal.}

% This chooses the icon (transparent or not)
\only<1>{\setbeamertemplate{bibliography item}{\iconarticle}}
\only<2>{\setbeamertemplate{bibliography item}{\iconarticletransparent}}

% This changes the transparency of the text
\uncover<1>{
\bibitem{}
\scriptsize Doe, J. (1980).
\newblock\scriptsize Title of the second paper.
\newblock {\em Journal.}
}

% % BOOK % %        

% Normal book entry
\setbeamertemplate{bibliography item}[book]
\bibitem{}
\scriptsize Doe, J. (2000).
\newblock\scriptsize {\em Title of the first book.}
\newblock Editorial.

% This chooses the icon (transparent or not)
\only<1>{\setbeamertemplate{bibliography item}{\iconbook}}
\only<2>{\setbeamertemplate{bibliography item}{\iconbooktransparent}}

% This changes the transparency of the text
\uncover<1>{
\bibitem{}
\scriptsize Doe, J. (2010).
\newblock\scriptsize {\em Title of the second book.}
\newblock Editorial.
}

% % ONLINE % %

% Normal web entry
\setbeamertemplate{bibliography item}[online]
\bibitem{}
\scriptsize Doe, J. (2001).
\newblock\scriptsize {\em Title of the first website.}
\newblock The website.

% This chooses the icon (transparent or not)
\only<1>{\setbeamertemplate{bibliography item}{\icononline}}
\only<2>{\setbeamertemplate{bibliography item}{\icononlinetransparent}}

% This changes the transparency of the text
\uncover<1>{
    \bibitem{}
    \scriptsize Doe, J. (2014).
    \newblock\scriptsize {\em Title of the second website.}
    \newblock The website.
}

\end{thebibliography}

\end{frame}

\end{document}
1
  • Nice. Seems like a good workaround +1
    – jens_bo
    Dec 4, 2014 at 11:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .