BibTeX, biblatex and biberExtra blank page before References when the last page is full - APA6 A4 template, Xetex

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
ocoolio
Posts: 3
Joined: Fri Aug 31, 2018 10:56 am

Extra blank page before References when the last page is full - APA6 A4 template, Xetex

Post by ocoolio »

I badly need your expert help, tried to find solutions to no avail.

In a simple document when the last line of the last page is full, LaTeX will render a blank page before inserting the references. If the last page is not full, there is no blank page.

I think I haven't used anything special so I have no idea what this is and how to fix it.

Help please!

Full sample on Overleaf https://www.overleaf.com/read/gxwqhdvwkfnv


Command used for PDF generation: latexmk -pdf -xelatex

Code: Select all

\documentclass[a4paper,man,floatsintext,biblatex-apa,oneside]{apa6}
    \usepackage[american]{babel}
    \usepackage{csquotes}
    \usepackage[style=apa,sortcites=true,sorting=nyt,backend=biber]{biblatex}
    \usepackage[colorlinks,citecolor=blue,urlcolor=blue,linkcolor=blue]{hyperref}
    \DeclareLanguageMapping{american}{american-apa}

    \usepackage{fontspec}
    \setmainfont{Times New Roman}

    \addbibresource{a.bib}

    \title{Title}
    \shorttitle{shortTitle}
    \author{Me}
    \affiliation{Piglet}

    \begin{document}

    \maketitle

    \parencite{vanmerrienboerTransferParadoxEffects1997} word word word 
    word word word word word word word word word word word word word word 
    ... until the page fills up ...
    word word word word word word word word word word word word word word 
    \printbibliography
    \end{document}
Image

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Extra blank page before References when the last page is full - APA6 A4 template, Xetex

Post by Stefan Kottwitz »

Welcome to the forum!

A quick solution would be adding heading=bibnumbered:

Code: Select all

\printbibliography[heading=bibnumbered]
Stefan
LaTeX.org admin
ocoolio
Posts: 3
Joined: Fri Aug 31, 2018 10:56 am

Extra blank page before References when the last page is full - APA6 A4 template, Xetex

Post by ocoolio »

hey Stefan, thanks heaps for such a quick response!

Your solution is almost perfect but it changes the "Refereces" heading to bold and that is not APA compliant.

Any other suggestions perhaps?

Thanks!

EDIT: meanwhile, it seems I got the perfect response on the Stackexchange forum, in case someone finds this thread.
https://tex.stackexchange.com/questions ... 4-template
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Extra blank page before References when the last page is full - APA6 A4 template, Xetex

Post by Stefan Kottwitz »

That's easy to change too. Anyway, I guess that's the best (of moewe):

Code: Select all

\AtEndPreamble{%
  \defbibheading{bibliography}{\clearpage\section*{\normalfont\refname}}%
}
Or, after \begin{document} but before the bibliography

Code: Select all

\defbibheading{bibliography}{\clearpage\section*{\normalfont\refname}}%
Especially because \clearpage forces printing the remaining figures and tables before the bibliography starts. That's desirable.

Stefan
LaTeX.org admin
ocoolio
Posts: 3
Joined: Fri Aug 31, 2018 10:56 am

Extra blank page before References when the last page is full - APA6 A4 template, Xetex

Post by ocoolio »

Can you please explain the difference between the AtEndPreamble and the other approach? I think it's a noob question but I'm really interested :)
Thanks again Stefan!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Extra blank page before References when the last page is full - APA6 A4 template, Xetex

Post by Stefan Kottwitz »

\AtEndPreamble is hook command for executing code right at the end of the preamble, so one can override document class definitions. But I think it's from the etoolbox package, so it's required to load etoolbox. The other quick approach is simply placing that definition yourself. :-) I guess apa6.cls already loads etoolbox implicitly, my remark was for the case it won't or it's not installed or another reader stumbles across it later.

Stefan
LaTeX.org admin
Post Reply