Cell Citation Style with groff

This blog post will give you a quick example on how to customize the citations style with groff by implementing the style of the Journal Cell. If you want more information on customization options I highly recommend the refer manpage.

Groff uses GNU refer as a preprocessor for bibliograhic processing. You can write a codeblock that will be interpreted by refer by starting with .R1 and ending with .R2. Here you can specify what labels in the text and the actual citation in the References section should look like.

The bibliography database should also use refer format. For more information check out the refer manpage. Here is an example:

%K brueser2021
%A Christian Brüser
%A Jan Keller-Findeisen
%A Stefan Jakobs
%D 2021
%T The TFAM-to-mtDNA ratio defines inner-cellular nucleoid populations with distinct activity levels
%J Cell Reports
%N 37

The groff code using ms macros should look like this:

.R1
database reference.bib
abbreviate %A
reverse %A
accumulate
move-punctuation
.R2

.TL
Example: Implementing the Cell Citation Style with groff
.AU
belago
.NH
Results
.PP
A population of inactivated mtDNA is maintained by condensation through the DNA-binding protein TFAM.
.[
brueser2021
.]

To compile the code run the following command:

refer cell-citation.ms | groff -ms -Tpdf -Kutf8 > cell-citation.pdf

Alternatively you can also invoke refer with the -R option when running groff.