1

I am using this answer to define a DeclareCiteCommand which prints a bibkey as a footnote of a frame. I would like to add the keyentry so that the number is displayed as well.

MWE:

\documentclass[10pt]{beamer}
    \usepackage[english]{babel}
    \usepackage{tikz}
    \usepackage[%
          autocite=footnote,
          maxnames=2,
          autolang=hyphen,
          hyperref=true,
          abbreviate=true,
          doi=false,
          backend=bibtex]{biblatex}
    %minimum bib file
    \usepackage{filecontents}
        \begin{filecontents}{\jobname.bib}
        @Article{Doe2019,
            author  = {Doe, Jhon and Doe2, Jhon2},
            title   = {Some journal article},
            journal = {Fancy Journal},
            year    = {2019},
            volume  = {56},
            number  = {3},
            pages   = {1-99},
        }
        \end{filecontents}
    \addbibresource{\jobname.bib}         

    %cite command to get abbreviated citation in frame
    \DeclareCiteCommand{\citeframe}
    {\usebibmacro{prenote}}
    {\printtext[beamercolorauthor]{%
            \printnames[family]{labelname}%
            \setunit{\addcomma\space}}%
        \printtext[beamercolornote]{%
            \printfield{journaltitle}%
            \setunit{\addspace}%
            \printtext[parens]{%
                \printdate}}}
    {\multicitedelim}
    {\usebibmacro{postnote}}

    %tikz command to get footnote with source (could be defined in a general cite command if a newline could be define between each citations when multiple citation per frame)
    \newcommand{\rightsource}[1]{%
        \begin{tikzpicture}[remember picture,overlay]
        \node[xshift=-0.5cm,yshift=0.3cm,above left] at (current page.south east) {\footnotesize %
            \begin{tabular}{r}#1\end{tabular}};
        \end{tikzpicture}
    }

    \begin{document}
    \begin{frame}
        \frametitle{Introduction}
        this relies on this article \cite{Doe2019}

        \rightsource{\citeframe{Doe2019}}   
    \end{frame} 
    \end{document}

output: MWE output

desired output (here I added the number manually but I want it automatic): desired output

I have tried adding \thefield{entrykey} after the prenote, as seen for articles, but I get undefined control sequence error in beamer... I am more used to TikZ or article class, but I am not a superuser, so please give explicit explanations for any advanced function so that I might be able to do more than copy/paste! :)

NB: I defined a \citeframe command to add keynumber in text and a \rightsource to add abbreviated citation as a footnote, but if you know how to get both with only one function (by changing cite for example) that would be all the better. Just beware that there could be multiple citations in one frame, then each citation should be displayed per line in the footnote.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.