Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing space before title for @article in beamer #212

Open
l1n00x opened this issue Jun 27, 2023 · 3 comments
Open

Missing space before title for @article in beamer #212

l1n00x opened this issue Jun 27, 2023 · 3 comments
Assignees
Labels
fixed in dev Issue fixed in dev
Milestone

Comments

@l1n00x
Copy link

l1n00x commented Jun 27, 2023

Hi,

somehow, when using @ article in a beamer presentation there is no space between the title entry and the dot separating the year entry and the title. This is not the case when not using beamer.

Consider

\begin{filecontents}{\jobname.bib}
	@article{test,
		author = {John Doe},
		title = {Test Title},
		pages = {229–243},
		volume = {77},
		number = {5},
		year = {2023},
		doi = {10.1348/xyz}
	}

\end{filecontents}

\documentclass{beamer}

\usepackage[
	style = apa
]{biblatex}
\addbibresource{\jobname.bib}

\setbeamercolor{bibliography entry author}{fg=black}
\setbeamercolor{bibliography entry title}{fg=black}
\setbeamercolor{bibliography entry note}{fg=black}

\begin{document}
	
\nocite{*}
\printbibliography

\end{document}

grafik

@moewew
Copy link
Contributor

moewew commented Jun 28, 2023

This is due to beamer's patches to the title bibmacro. In order to inject its block colours beamer patches some standard biblatex macros and applies some fairy dust. Unfortunately that fairy dust clashes with biblatex-apa in a visible way here.

The problem could be avoided if biblatex-apa were to use \printunit{\printdelim{nametitledelim} instead of a bare \printdelim{nametitledelim} in the bibdrivers. (Shown in the MWE for @article.)

\documentclass{beamer}

\usepackage[
  style = apa,
]{biblatex}

\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor}%
  \printunit{\printdelim{nametitledelim}}\newblock
  \usebibmacro{title}%
  \setunit{\addspace}\newblock
  \usebibmacro{apa:related}%
  \newunit\newblock
  \usebibmacro{journal+issuetitle}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \newunit\newblock
  \printfield{howpublished}%
  \newunit\newblock
  \usebibmacro{doi+url}%
  \newblock
  \usebibmacro{origyear}%
  \newunit\newblock
  \printfield{addendum}%
  \setunit{\addspace}\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{pageref}%
  \usebibmacro{annotation}%
  \usebibmacro{finentry}}

\setbeamercolor{bibliography entry author}{fg=black}
\setbeamercolor{bibliography entry title}{fg=black}
\setbeamercolor{bibliography entry note}{fg=black}

\begin{filecontents}{\jobname.bib}
@article{test,
  author = {John Doe},
  title  = {Test Title},
  pages  = {229–243},
  volume = {77},
  number = {5},
  year   = {2023},
  doi    = {10.1348/xyz},
}
\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}
\nocite{*}
\printbibliography
\end{document}

The original @article driver is

\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor}%
\printdelim{nametitledelim}\newblock
\usebibmacro{title}%
\setunit{\addspace}\newblock
\usebibmacro{apa:related}%
\newunit\newblock
\usebibmacro{journal+issuetitle}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\newunit\newblock
\printfield{howpublished}%
\newunit\newblock
\usebibmacro{doi+url}%
\newblock
\usebibmacro{origyear}%
\newunit\newblock
\printfield{addendum}%
\setunit{\addspace}\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{pageref}%
\usebibmacro{annotation}%
\usebibmacro{finentry}}

@plk I would expect \setunit or \printunit here. Is there any reason why the code just has neither?


But the beamer patches are overly reliant on biblatex's built-in punctuation tracking feature that tries to avoid double punctuation. As soon as that can no longer work, we get double the output we want.

@samcarter maybe you'd be interested in knowing about this. (I have no idea what to do about it, though.)

\documentclass{beamer}

\usepackage[
  style = authoryear,
]{biblatex}

\def\labelnamepunct{X}

\begin{filecontents}{\jobname.bib}
@article{test,
  author = {John Doe},
  title  = {Test Title},
  pages  = {229–243},
  volume = {77},
  number = {5},
  year   = {2023},
  doi    = {10.1348/xyz},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

@samcarter
Copy link

@moewew Thanks for the ping! There are a couple of other things with beamer's biblatex patches, which I'd like to fix, maybe I'll find some other approach how to sprinkle the fairy dust :)

As this looks like a bit bigger project, I don't know when I will have time to look into that, so no promises on a time line.

plk added a commit that referenced this issue Sep 2, 2023
@plk plk added the fixed in dev Issue fixed in dev label Sep 2, 2023
@plk plk added this to the 9.17 milestone Sep 2, 2023
@plk
Copy link
Owner

plk commented Sep 2, 2023

Pure oversight on my part - will be fixed in next release.

@plk plk self-assigned this Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in dev Issue fixed in dev
Projects
None yet
Development

No branches or pull requests

4 participants