3

I have a problem related to this question -- I'd like to put the bibliography outside of a block in Beamer. Based on the above solution, I have something that almost works, except that I'd like to modify the content of the bibliography but can't seem to figure out a way to do that. Right now I have:

\documentclass{beamer}
\usetheme{Berlin}

\usepackage{csquotes}   
\usepackage[style=numeric-comp, backend=biber, citetracker=true, sorting=none]{biblatex}

\makeatletter
\renewcommand\@makefnmark{\hbox{\@textsuperscript{\normalfont[\@thefnmark]}}}
\renewcommand\@makefntext[1]{{\normalfont[\@thefnmark]}\enspace #1}
\makeatother

\DeclareCiteCommand{\footfullcitetext}[\mkbibfootnotetext]
  {\usebibmacro{prenote}}
  {\usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}


\addbibresource{mwe}

\begin{document}

\begin{frame}{Beamer frame}

\begin{beamerboxesrounded}[]{Beamer rounded box}
    \begin{itemize}
        \item Bullet 1 \footnotemark
        \item Bullet 2 
    \end{itemize}
\end{beamerboxesrounded}

\footfullcitetext{LaTeX}

Outside 

\end{frame}
\end{document}

In the footnote, it shows "[1] Leslie Lamport. LaTeX – A Document Preparation System. Addison-Wesley, 1985." How can I make it something like "[1] Lamport (1985)" instead?

Alternately, is there an easier way to do bibliography such that I have something like "This is based on previous work [1]." in the content (within blocks) of the slides and just the authors and year in the footnote?

ceiling cat
  • 2,167
  • Related: http://tex.stackexchange.com/questions/39919/biblatex-authoryear-icomp-brackets-around-the-year-in-footnotes – lockstep Jul 05 '13 at 06:50

1 Answers1

2

The "full" citation in the footnote is generated by the code

\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}

in \footfullcitetext. For a shorter citation this can be replaced by:

\printnames{labelname}\setunit{\addnbspace}\printfield[parens]{year}

Note that these short labels are open to ambiguity if a group of authors publish multiple works in the same year. To eliminate ambiguities, load biblatex with labelyear=true (or labeldate=true with version 2.6+) and use

\printtext[parens]{\printfield{labelyear}\printfield{extrayear}}

You've adopted the second alternative provided in the linked solution, where:

  • footnote citations outside blocks must be added manually,
  • recurrent citations must be tracked manually,
  • regular footnotes aren't permitted.

So to address your second question, adapt the first alternative provided. Here is an example.

\documentclass{beamer}
\usepackage[style=numeric-comp,citetracker=true,sorting=none]{biblatex}
\usepackage{hyperref}

\usetheme{Berlin}
\setbeamertemplate{bibliography item}[text]
\renewcommand{\bibfootnotewrapper}[1]{#1}

\makeatletter
\let\cbx@citehook=\empty
\newtoggle{cbx@blockcite}

\renewcommand{\@makefntext}[1]{%
  \noindent\normalfont\ifundef{\thefootnote}{}{\@thefnmark~}#1}

\DeclareCiteCommand{\sfcite}[\cbx@superscript]%
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \ifciteseen
     {\ifnumequal{\value{page}}{\csuse{cbx@page@\thefield{entrykey}}}
       {}
       {\ifnumequal{\value{framenumber}}{\csuse{cbx@frame@\thefield{entrykey}}}
          {\usebibmacro{sfcite}}
          {}}}
     {\usebibmacro{sfcite}}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\newbibmacro*{sfcite}{%
  \csnumgdef{cbx@page@\thefield{entrykey}}{\value{page}}%
  \csnumgdef{cbx@frame@\thefield{entrykey}}{\value{framenumber}}%
  \xappto\cbx@citehook{\noexpand\cbx@footnotetext{\thefield{entrykey}}}}

\DeclareCiteCommand{\cbx@footnotetext}[\let\thefootnote\relax\mkbibfootnotetext]
  {}
  {\printfield[brackets]{labelnumber}%
   \setunit{\addnbspace}%
   \printnames{labelname}%
   \setunit{\addnbspace}%
   \printfield[parens]{year}}
  {\multicitedelim}
  {}

\newrobustcmd*{\cbx@superscript}[1]{%
  \mkbibsuperscript{\mkbibbrackets{#1}}%
  \iftoggle{cbx@blockcite}
    {}
    {\cbx@citehook%
     \global\let\cbx@citehook=\empty}}

\def\cbx@beg@hook{\global\toggletrue{cbx@blockcite}}

\def\cbx@end@hook{%
  \cbx@metabox{%
    \global\togglefalse{cbx@blockcite}%
    \cbx@citehook%
    \global\let\cbx@citehook=\empty}}

\def\cbx@metabox#1{\edef\theprevdepth{\the\prevdepth}\nointerlineskip
  \vbox to0pt{#1\vss}\prevdepth=\theprevdepth}

\BeforeBeginEnvironment{block}{\cbx@beg@hook}
\AfterEndEnvironment{block}{\cbx@end@hook}

\BeforeBeginEnvironment{beamerboxesrounded}{\cbx@beg@hook}
\AfterEndEnvironment{beamerboxesrounded}{\cbx@end@hook}

\makeatother

\addbibresource{biblatex-examples.bib}
\begin{document}
\begin{frame}{First Frame}
\begin{itemize}[<+->]
  \item First citation.\sfcite{reese} Recurrent citation.\sfcite{reese}
  \item Second citation.\sfcite{springer} Recurrent citation.\sfcite{springer}
\end{itemize}
\end{frame}
\begin{frame}{Second Frame}
\begin{beamerboxesrounded}[]{Beamer rounded box}
  Recurrent citation.\sfcite{reese} New citation.\sfcite{companion}
\end{beamerboxesrounded}
New citation.\sfcite{bertram} Recurrent citation.\sfcite{bertram,companion}
Vanilla footnote.\footnote{Footnote text}
\end{frame}
\begin{frame}
  \printbibliography
\end{frame}
\end{document}

enter image description here

Given that you're making the footnote citations "short", consider using the author-year style instead:

\usepackage[style=authoryear-comp,maxcitenames=1,uniquename=false]{biblatex}
Audrey
  • 28,881
  • Thanks so much! It's much easier to have some code to work with. I have tried the first alternative in the other post but without success. The main reason I think is that, instead of block, I have beamerboxesrounded, which uses minipage and made this really complicated. Eventually I still have to give up using beamerboxesrounded because I couldn't get everything to work at the same time. Btw, I think uniquenames in your last line should be uniquename. – ceiling cat Jul 06 '13 at 17:12
  • @ceilingcat Ah, I've overlooked a few things here. Sorry. The hooks can be added to other environments. I'll make an edit in a bit. – Audrey Jul 06 '13 at 17:23