biblatex
biblatex copied to clipboard
Inadequate vskip space between arbitrary text and bibliography heading
Below the mwe:
\documentclass{article}
\usepackage{lipsum}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{*}
\defbibnote{note1}{\lipsum[2][1-3]}
\defbibnote{note2}{\lipsum[3][1-4]}
\printbibheading
\lipsum[1]
\printbibliography[heading=subbibliography, title={Article}, prenote=note1, type=article]
\printbibliography[heading=subbibliography, title={Book}, prenote=note2, type=book]
\end{document}
As you can see there is no adequate spacing between the text following \printbibheading
and the subbibliography heading "Article"
Instead, the spacing of the subbibliography heading "Book" is correct.
One solution might be to make available an option (like postnote
) similar to the prenote
option, so that you can write the source code in the following way
...
\defbibnote{note}{Lorem ipsum...} % \printbibheading postnote
\defbibnote{note1}{\lipsum[2][1-3]}
\defbibnote{note2}{\lipsum[3][1-4]}
\printbibheading[postnote=note]
\printbibliography[heading=subbibliography, title={Article}, prenote=note1, type=article]
\printbibliography[heading=subbibliography, title={Book}, prenote=note2, type=book]
...
Also, it would be appropriate for the prenote
option to follow the language settings regarding indentation of the first paragraph (like indentfirst
option of polyglossia
).
Matteo
That's because biblatex
is a bit naughty and works in a group. In essence we end up with something like
\documentclass{article}
\begin{document}
{\section*{Foo}}
Lorem ipsum dolor sit amet consecture lorem ipsum dolor sit amet
loem ipusm dolor oppposum
\subsection*{Lorem}
Ipsum
\end{document}
where the non-standard group around the \section*
causes issues.
I don't think we can avoid the grouping in \printbibheading
, since we have to do so much local option processing.
I don't think we can avoid the grouping in
\printbibheading
, since we have to do so much local option processing.
Do you think it is unthinkable to add an option to the \printbibheading
command (like postnote
) that acts within \blx@printbibheading
? That way the text would remain within the group.
Matteo
Yeah, that would be a workaround. Have a look at https://github.com/plk/biblatex/commit/c3a329c190ed6858780c5e5fc4ffeccb5841bea9, please. I added both prenote
and postnote
for consistency with how the other commands work, but in this case they both do the same thing, because there is no bibliography in between.
Thank you, very good solution!
Last note: in my opinion it would be correct that paragraphs generated via prenote
and postnote
follow the local settings regarding indentfirst.
Matteo
prenote
and postnote
explicitly force a \noindent
, you can remove that by redefining \blx@bibnote
.
\documentclass{article}
\usepackage{lipsum}
\usepackage{indentfirst}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\makeatletter
\def\blx@bibnote#1{%
\ifdefempty#1
{}
{\begingroup
\let\newrefsection\relax
\let\newrefsegment\relax
\csuse{blx@note@#1}\par\nobreak
\endgroup}}
\makeatother
\begin{document}
\section*{Foo}
\lipsum
\subsection*{Goo}
\lipsum
\nocite{*}
\defbibnote{note0}{\lipsum}
\defbibnote{note1}{\lipsum}
\defbibnote{note2}{\lipsum}
\printbibheading[prenote=note0]
\printbibliography[heading=subbibliography, title={Article}, prenote=note1, type=article]
\printbibliography[heading=subbibliography, title={Book}, prenote=note2, type=book]
\end{document}
I don't know if it is wise to change this in the core now, even though I admit that the \noindent
might be a bit unfortunate in some situations. It is probably niche enough that those who don't want the \noindent
can remove it themselves?
Thank you for the technical solution.
I don't know if it is wise to change this in the core now, even though I admit that the
\noindent
might be a bit unfortunate in some situations. It is probably niche enough that those who don't want the\noindent
can remove it themselves?
Of course, I cannot know why the \noindent
command was added. Certainly this choice creates a typographical inconsistency within a document using babel
or polyglossia
or indentfirst
.
In my opinion, it should not be a problem to change the core now, because anyone in this particular situation will surely have solved it by adding an \indent
, like:
\defbibnote{note}{\indent Lorem ipsum...}
So this would hardly break some source code.
Of course, the ultimate decision is yours ;-)
Matteo
I am continuing this discussion for an answer to my request
in my opinion it would be correct that paragraphs generated via
prenote
andpostnote
follow the local settings regarding indentfirst.
if you think it is better not to intervene on this aspect, you can also close this issue now.