3

If I compile the following

\documentclass{beamer}
\usepackage[style=verbose]{biblatex}

\usepackage{filecontents}% to embed the file myreferences.bib in your .tex file \begin{filecontents}{myreferences.bib} @article{foo12, year = {2012}, title = {Title}, author = {H Miller}, journal = {Journal} } \end{filecontents} \addbibresource{myreferences.bib} \AtEveryCitekey{ \clearfield{pages} \clearfield{issn} \clearfield{doi} \clearfield{address} \clearfield{volume} \clearfield{isbn} \clearfield{series} \clearfield{number} \clearfield{note} }

\begin{document}

\begin{frame} Some text.\footnote{Some text in a footnote.} Some more text.\footcite{foo12} \end{frame}

\begin{frame} \printbibliography \end{frame}

\end{document}

I get a big space between footnote label 2 and the citation. If I remove the \AtEveryCitekey block, the space goes away, and the two footnotes are aligned. Is this a bug? How can I get rid of the space while keeping the \AtEveryCitekey?

(Example adapted from here)

1 Answers1

4

As explained in What is the use of percent signs (%) at the end of lines? (Why is my macro creating extra space?), TeX normally treats line ends just like spaces. Within \AtEveryCitekey spaces are relevant (essentially \AtEveryCitekey is like a \newcommand/\renewcommand on an internal macro that is called whenever biblatex processes a citation), so every line end ends up giving you a space in the citation output.

The solution is to hide the end of lines with %.

\documentclass{beamer}
\usepackage[style=verbose]{biblatex}

\AtEveryCitekey{% \clearfield{pages}% \clearfield{issn}% \clearfield{doi}% \clearfield{address}% \clearfield{volume}% \clearfield{isbn}% \clearfield{series}% \clearfield{number}% \clearfield{note}% }

\begin{filecontents}{\jobname.bib} @article{foo12, year = {2012}, title = {Title}, author = {H Miller}, journal = {Journal} } \end{filecontents} \addbibresource{\jobname.bib}

\begin{document}

\begin{frame} Some text.\footnote{Some text in a footnote.} Some more text.\footcite{foo12} \end{frame}

\begin{frame} \printbibliography \end{frame}

\end{document}

2 H Miller. “Title”. In: Journal (2012).

moewe
  • 175,683