andras-simonyi / citeproc-el

A CSL 1.0.2 Citation Processor for Emacs.
GNU General Public License v3.0
85 stars 9 forks source link

Bibliography without newlines #93

Open Quintus opened 2 years ago

Quintus commented 2 years ago

Dear Andras,

I am currently working on an entry for a judicial commentary. I am on these versions:

Org mode version 9.5 (release_9.5-225-g494c20 @ /home/quintus/.emacs.d/org-mode/lisp/)
Citeproc @ abf3e45946598dffebfba6d6bd9a8cda46815765

In the kind of literature this work is for it is common to use short citations in footnotes, and provide the full bibliographic information at the start of the commentary’s chapter. This full bibliography is printed in small font and without any newlines; its entries are in surnames’ alphabetical order and separated by semicola, and surnames are italicised. Since commentary books tend to be large volumes, this is probably due the publisher’s desire to save paper.

Looking at the CSL 1.0.1 specification I found the delimiter attribute, which I thought would fit if used on the <layout/> element within <bibliography/>. However, when I tried:

<bibliography><layout delimiter="; ">...</layout></bibliography>

Then the result was that within each line the entries were separated by semicola instead of commas, but the newlines between the bibliography entries were still there. So my expectation that the delimiter just defaults to a newline character for bibliographies was refuted and it is used for something else, or this may be a bug in citeproc. Maybe the newline is hardcoded somewhere in org or in citeproc? Is there another way to replace it with a semicolon?

-quintus

andras-simonyi commented 2 years ago

This is an interesting problem. I think the CSL specification doesn't allow using the delimiter attribute on the layout element for the bibliography, it's only for inside the citation element where it can specify the delimiter between cites. In fact I've checked this with the CSL validator (https://validator.citationstyles.org/) and it signals an error for styles with this type of attribute:

Lines 31-33: Attribute “delimiter” not allowed on element “layout” from namespace “http://purl.org/net/xbiblio/csl” at this point.

Consequently, using it for specifying delimiters between bibliography items would require an extension of the standard, although this type of formatting info might have a better place among the attributes of the bibliography element -- it'd be interesting to know what @bdarcus and @denismaier think about this.

Within the context of citeproc-el, the way formatted bibliography items are put together is currently specified on the formatter level (see the BIB slot of citeproc-formatter structs), so one way of approaching this problem could be to write custom formatters for the required formats that use semicolon between bib items.

BTW, since the the formatting functions (in the BIB slots) are parametrized by a bibliography formatting alist coming from the CSL style (containing bibliography attributes like line-spacing, entry-spacing etc.), the current machinery would make it trivial to accommodate a CSL extension allowing the specification of the bib item delimiter.

denismaier commented 2 years ago

There's an open issue about this: https://github.com/citation-style-language/schema/issues/386