0

Adding

\DeclareDatamodelFields[type=field,datatype=literal]{cstatement}
\AtEveryBibitem{[\printfield{cstatement}]}

to biblatex.cfg is almost what I want. For every bibtex entry with a keyword cstatement="This is a foo", this code casuse biblatex to print in the bibliography entrpy with "This is a foo" just beforehand.

But what I actually need is for this new entry to appear just after the entry, as in an annotated bibliography. The ``addendum'' entry is also almost what I want but, but not quite because 1) i want to use this custom keyword and 2) i'd like more control over the formatting. Namely, I'd like the literal text in cstatement to appear like

\item [bibentry here]\\\ \\[cstatement literal text here]

where the \\\ \\ causes there to be a blank line between the cstatement's text and the bibentry. (The newline shouldn't be there unless cstatement exists.) This should work on any bibtex entry type (article, inproceedings, etc.)

Any advice would be appreciated.

1 Answers1

1

I would issue a \par before the field. Then you can control the distance between the actual entry and the annotation with \bibparsep. A very simple way to add something to the end of the bibliography entry is by redefining the bibmacro finentry that all good bibliography styles should use.

In the example here I used the field annotation instead of cstatement, but if you declare the field in a data model file, you can simply exchange all mentions of annotation for cstatement.

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

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

\setlength{\bibparsep}{.5\baselineskip}

\renewbibmacro*{finentry}{%
  \setunit{\finentrypunct\par}%
  \printfield{annotation}%
  \finentry}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{appleby,
  author     = {Humphrey Appleby},
  title      = {On the Importance of the Civil Service},
  date       = {1980},
  annotation = {This is a foo},
}
\end{filecontents}

\addbibresource{\jobname.bib}

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

Annotated bibliography entry.

moewe
  • 175,683
  • Two follow-up questions: (1) Is it possible to extend this code so that each annotation text will be preceded by some text specified in this four-liner? (2) Is there a chance to extend this code so that it works for a new field name that I define on my own? (Rather than 'annotation', which seems to exist already.) [asking here in case both is easy -- otherwise I will write a new post.] – Prof.Chaos Jul 19 '21 at 02:13
  • 1
    @Prof.Chaos (1) \DeclareFieldFormat{annotation}{Text preceding annotation: #1} (though ideally that would be done with a bibstring: \NewBibliographyString{annintro}\DefineBibliographyStrings{english}{annintro = {introduction for annotation},}\DeclareFieldFormat{annotation}{\bibstring{annintro}\addcolon\space #1}). (2) New fields can be added as explained in https://tex.stackexchange.com/q/163303/35864. – moewe Jul 19 '21 at 04:16