

Generating citations and bibliographies with CSL and citeproc-java
source link: https://michelkraemer.com/generating-citations-and-bibliographies-with-CSL-and-citeproc-java/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Generating citations and bibliographies with CSL and citeproc-java
I was recently writing a scientific document with AsciiDoc. As usual my toolchain was AsciiDoc → DocBook → FO → PDF. It really worked quite well until I came to the point where manually adding citations and editing the bibliography by hand became really complex and I suddenly found myself yearning for more automation.
I asked Google what I could do and Google told me about BibTeX and all that stuff. There even was a tool called asciidoc-bib by Peter Lane that was able to read BibTeX files to generate citations and bibliographies and then put them into an AsciiDoc source file. I tested this tool for a while and contributed one or two commits via GitHub. However, I was not yet convinced by the flexibility and maturity of asciidoc-bib by that time, so I started looking for ways how to extend it.
Enter the Citation Style Language (CSL). CSL is an XML-based description of citation styles and bibliographies that’s maintained by a number of people from the scientific community. They say it’s “by academics, for academics”. I really loved the idea of having a more modern alternative to BibTeX and natbib which I never found particularly mind-blowing by the way.
I started with extending asciidoc-bib with support for a library called citeproc-ruby by Sylvester Keil. citeproc-ruby is a so-called CSL processor. That means it reads CSL styles and transforms them to citations and bibliographies. However, I still found asciidoc-bib too cumbersome to use, in particular since it was written in Ruby and my toolchain was based on Java.
So I asked Google again, if they could tell me something about CSL and Java, but they said they didn’t know very much about that. That was when I finally decided to write my own CSL processor for Java.
citeproc-java
Today I’m pleased to announce the first release of citeproc-java, a CSL processor for Java! An (almost) complete documentation is available at the following site:
http://michel-kraemer.github.io/citeproc-java/
I have to be honest with you guys. I didn’t implement the whole CSL specification myself. Instead I tried to incorporate existing code as much as possible. citeproc-java uses the great citeproc-js by Frank G. Bennett, Jr. internally. It is therefore fully CSL 1.0.1-compliant. Apart from that, it offers some cool additional features such as BibTeX import as well as export to AsciiDoc and FO.
For convenience I uploaded citeproc-java and the CSL styles and locales to Maven central. Please see the installation instructions for more information:
http://michel-kraemer.github.io/citeproc-java/download/
citeproc-java’s BibTeX to CSL mapping is based on the one used in the Docear software. It has been converted to Java by permission from the Docear authors, in particular Joeran Beel. The BibTeX converter imports author names using the name parser from the citeproc-ruby project. It has been converted to Java by permission from Sylvester Keil. Thank you very much for that!
Although citeproc-java is a very young project and this is the very first release, I consider it rather stable already—not least because it uses citeproc-js under the hood. Nevertheless, development of citeproc-java has just begun and I’m sure there are great features to come. If you want to participate, don’t hesitate to fork my GitHub repository and send me pull requests:
https://github.com/michel-kraemer/citeproc-java
Finally, big thanks go to the CSL community for the great work and support!
License
citeproc-java is licensed under the Apache License, Version 2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Recommend
-
80
org-ref: citations, cross-references, indexes, glossaries and bibtex utilities for org-mode Overview of org-ref for export to PDF via LaTeX.
-
41
Bibtex-completion, helm-bibtex, ivy-bibtex Helm-bibtex: Ivy-bibtex: Helm-bibtex and ivy-bibtex allow you to search and manage your BibTeX bibliography. They both share the same generic backend, bibtex-completion, but one uses...
-
6
Well, that didn't work — For research citations, no replication is no problem Looking back at big replication projects, finding they don't seem to have mattered. ...
-
9
Human Google: Ruth Freitag, Isaac Asimov, And Bibliographies You don’t often turn on a light and think, “That power company is sure on the ball!” You generally only think of them when the ligh...
-
10
Making it easier for others to cite your work GitHub now has built-in support for ...
-
6
Journal Club Highlighting recent, timely papers selected by Academy member labs Is scientific progress waning? Too many new papers may mean novel ideas rarely rack up citations ...
-
14
Microsoft is making citations easier with the Edge browserMicrosoft wants to make it easier for students to add citations to their research papers with a new feature for the Edge browser. Adding proper citations to a paper can b...
-
5
citeproc-el A CSL 1.01 Citation Processor for Emacs. Table of Contents Introduction citeproc-el is an Emacs Lisp library for rendering citations and bibliographies in styles described in the C...
-
4
Command line tool for citations and bibliographies « Michel KrämerCommand line tool for citations and bibliographiesI was working very hard on the new version of citeproc-ja...
-
14
A lawyer used ChatGPT and now has to answer for its ‘bogus’ citations / A filing in a case against Colombian airline Avianca cited six cases that don’t exist, but a lawyer working for the plaintiff told the court Chat...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK