1

I'm using biblatex to produce an annotated reading list. For longer annotations the formatting options available inside the annotation field are limited. Currently I'm using \par to get a new paragraph in the annotation in the reading list. Is it possible to get normal paragraphs working (<CR><CR>) inside the annotation? This would make external annotation files much more flexible.

2

Biber parses all new-line characters into normal spaces (as does BibTeX, I think), so you can't get a new paragraph with a blank line in the .bib file. \par seems the simplest option.

But I would say that the .bib file might simply not be the best place to write long annotations about your entries.

If you want to add larger annotations to your .bib entries it might be more convenient to use an external .tex file to store these annotations (where you can use blank lines for \par). See also How to embed a review in biblatex?, §3.13.8 External Abstracts and Annotations and §4.11.3 External Abstracts and Annotations of the biblatex manual.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, loadfiles, backend=biber]{biblatex}

\renewbibmacro{finentry}{%
  \setunit{%
    \finentrypunct
    \renewcommand*{\finentry}{}%
    \par}%
  \usebibmacro{annotation}%
  \finentry
}

\begin{filecontents}{\jobname.bib}
@book{appleby,
  author     = {Humphrey Appleby},
  title      = {On the Importance of the Civil Service},
  date       = {1980},
}
\end{filecontents}
\begin{filecontents}{bibannotation-appleby.tex}
Lorem ipsum \[x^2+y^2=z^2\] that was mathy.
Also $a+b=c$ and so forth.
Just a few words to make the next
paragraph stand out properly.

We can even have a new paragraph.
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}


\begin{document}
\cite{sigfridsson,appleby}
\printbibliography
\end{document}

Entry with long annotation and new paragraph


For a heavier paragraph markup you can either customise

\setlength{\bibparsep}{0.5\baselineskip plus 2pt}

or just change the paragraph settings before you print annotation (normally you would probably not set both \parskip and \parindent to non-zero values, but this is just for demonstration purposes)

\renewbibmacro{finentry}{%
  \setunit{%
    \finentrypunct
    \renewcommand*{\finentry}{}%
    \par}%
  \setlength{\parskip}{0.5\baselineskip plus 2pt}%
  \setlength{\parindent}{1em}%
  \usebibmacro{annotation}%
  \finentry
}

(I'm not too fond of having formatting settings like this just in a bibmacro, but that was the easiest way to get them right since they act on paragraphs.)

5
  • Thanks, external files is better. But, as far as I understand, this will still not produce proper paragraphs, i.e. indented first line or with a blank line. – Hans Chr Aug 28 '20 at 17:54
  • @HansChr It does produce proper paragraphs, but the default setup (\parindent, \parskip) in a bibliography list is so that new paragraphs aren't that easy to spot. If you want all bib paragraphs to be more visible try something like \setlength{\bibparsep}{0.5\baselineskip plus 2pt}. Alternatively, you can modify \parindent and \parskip directly before you print the annotation. – moewe Aug 28 '20 at 18:00
  • @HansChr See the edit for what I meant. – moewe Aug 28 '20 at 18:07
  • Thanks! Just what I was looking for. – Hans Chr Aug 28 '20 at 18:29
  • @HansChr If the answer worked for you, you may want to consider upvoting and/or accepting it to mark the question as resolved. See tex.stackexchange.com/help/someone-answers – moewe Aug 29 '20 at 5:10

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.