TransWikia.com

Not another beamer footnote cite minipage question

TeX - LaTeX Asked on March 6, 2021

Problem

I know similar questions have been asked many times before, but I think this case is unique (happy to be proved wrong).

I want to simply write cite{name} in my Beamer presentation, no matter if I’m in a minipage or not, and have some short info about the reference appear in the frame footnote, plus the full citation at the end of the presentation via printbibliography. I don’t want to tinker with case-specific footnotemark / footnotetext, etc. I am also interested in printing the footnote reference info inline like the para option from footmisc (to use less space). Finally, regular footnotes should be unaffected.

Question

After much effort, I have a working solution (below), but my question is: how can my solution be improved? e.g.:

  • Have I done anything "bad"?
  • Does anything break in other use cases?
  • Can we make it work with hyperref?
  • Can we use citecolor appropriately?
  • Do we care that all the citations come at the end? (I prefer it)

Thanks

Working Solution

documentclass[20pt,aspectratio=169]{beamer}
usepackage[backend=bibtex,style=authoryear]{biblatex}
addbibresource{mwe}
% SOLUTION
makeatletter
defempty{} % dummy
newcounter{cite}% count citations per frame
% prepend reset stuff to begin frame
letxbeamer@frameslidebeamer@frameslide
def beamer@frameslide{%
  letffnemptysetcounter{cite}{0}%
  xbeamer@frameslide}
% prepend footnote stuff to end frame
letxendbeamer@frameslideendbeamer@frameslide
def endbeamer@frameslide{%
  % add a footnote (no number) if ffn is not empty
  ifxffnemptyelse{defthefootnote{}footnotetext{ffn}}fi%
  xendbeamer@frameslide}
% redefine cite
renewcommand{cite}[1]{%
  % step & print the counter
  stepcounter{cite}textsuperscript{alph{cite}}
  % add to ffn: the cite counter (not footnote) and textcite (black magic)
  edeffntext{noexpandg@addto@macronoexpandffn{%
    noexpandtextsuperscript{alph{cite}}textcite{#1}enspace}}fntext}
makeatother
% EXAMPLE
begin{document}
  begin{frame}{Hello World}
    before minipagefootnote{First footnote}
    begin{minipage}{textwidth}color{red}
      inside minipage: pencite{Hello} applecite{World}
    end{minipage}
    after minipagefootnote{Second footnote}
    pineapplecite{World}
  end{frame}
  begin{frame}{References}printbibliographyend{frame}
end{document}

mwe.bib is:

@article{Hello,author={Hello},title={Hello},journal={Hello},year={1999}}
@article{World,author={World},title={World},journal={World},year={2020}}

Result

enter image description here

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP