9

Bibliographies can be typeset in a smaller font size by redefining the \bibfont macro (if one uses natbib or biblatex) or by simply appending the definition of \thebibliography. This also works with the beamer class; however, switching to a smaller font size leaves beamer's document icons at the start of each bibitem unchanged. How can I scale those icons down to, say, 75% of their original size?

(From Removing document icons from a Bibtex bibliography in Beamer, I gather that an answer is likely to involve some clever use of \setbeamertemplate{bibliography item}.)

\documentclass{beamer}

\usepackage{etoolbox}
\apptocmd{\thebibliography}{\scriptsize}{}{}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Bli74,
  author = {Blinder, Alan S.},
  year = {1974},
  title = {The economics of brushing teeth},
  journal = {Journal of Political Economy},
  volume = {82},
  number = {4},
  pages = {887--891},
}
\end{filecontents}

\begin{document}

\nocite{*}

\bibliographystyle{plain}

\begin{frame}
\bibliography{\jobname}
\end{frame}

\end{document}

enter image description here

lockstep
  • 250,273

1 Answers1

11

Bibliography items are inserted using \pgfuseimage. You could redefine this before the bibliography and scale it the way you want to using commands from graphicx (included by beamer by default:

\renewcommand{\pgfuseimage}[1]{\includegraphics[scale=.75]{#1}}

The above scales the image to 75% of its original size.

This should be issued outside the frame environment, before calling \bibliography. Here's your complete minimal example:

enter image description here

\documentclass{beamer}% http://ctan.org/pkg/beamer

\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\apptocmd{\thebibliography}{\scriptsize}{}{}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Bli74,
  author = {Blinder, Alan S.},
  year = {1974},
  title = {The economics of brushing teeth},
  journal = {Journal of Political Economy},
  volume = {82},
  number = {4},
  pages = {887--891},
}
\end{filecontents}

\begin{document}

\nocite{*}

\bibliographystyle{plain}

\renewcommand{\pgfuseimage}[1]{\scalebox{.75}{\includegraphics{#1}}}

\begin{frame}
\bibliography{\jobname}
\end{frame}

\end{document}
Werner
  • 603,163
  • MWE needs a little change for biblatex/biber, but also works with that. I have scaled the text way more and get a big gap. Compare this \lower3.5pt\hbox{\hskip2pt\scalebox{2}{...}\hskip1pt}; by this it ispossible to move the image up and (with negative values e.g.: \hskip15pt ... \hskip-10) also closer to the text. However, this does not change the lineskip for the first line in an entry, which differs from others in elongated items. I tried [b] on scalebox,parbox but it horribly failed (crashing not only TeXstudio). Hints? – BadAtLaTeX Jan 04 '18 at 22:56
  • Ok, can confirm. Tried it several times in my use case, but could not recreate the crash with this MWE (modified). I was using MacTeX and TeXstudio and tried to compile a similar file (with biblatex, though) including \renewcommand{\pgfuseimage}[1]{\scalebox[b]{.75}{\includegraphics{#1}}} (as my naive attempt at reducing the lineskip). This led to a crash of not only the editor, but moreover I was logged out of the session and -as crazy as it sounds- it changed some JS Blocker setting in Safari. Where do I report this? – BadAtLaTeX Jan 04 '18 at 23:24
  • @gr4nt3d: If you think there is an issue with beamer, you can report it on Github. – Werner Jan 04 '18 at 23:35
  • well, I was asking which part of the process could have caused the crash (TeXstudio, pdflatex). Or could beamer alone be able to yield that? Apart from that: any hints on the lineskip? – BadAtLaTeX Jan 05 '18 at 12:51
  • Another small question concerning the scaling of the icon: As mentioned in a comment here I have used your method in combination with that biblatex code to automatically assign the icon. However, it does not scale the globe. Is there another command like \pgfuseimage that I have to replace for that? – BadAtLaTeX Jan 10 '18 at 18:35
  • 1
    @gr4nt3d: This is the code associated with bibliography items (source). Both the the book and online (globe) elements use \pgfuseimage. – Werner Jan 17 '18 at 05:58
  • I am using this modification on your code, with this preamble, to achieve the aforementioned symbol detection but merely the globes are not scaled. I have no idea why this should conflict with your solution. - edit: ok, I found a solution. I save the original command \let\oldpgfuseimage\pgfuseimage and use that one{\scalebox{.5}{\oldpgfuseimage{#1}}} instead of \includegraphics{}. – BadAtLaTeX Jan 17 '18 at 09:03