How can I use Citation Style Language(CSL) in LaTeX Bibliography? It seems fantastic, there is 2,803 Citation Style right now in Zotero Style Repository.

The Citation Style Language (CSL) is an XML format for describing the formatting of in-text citations, notes and bibliographies. CSL offers:

  • An open format that may be used by any application
  • The ability to write compact and robust styles
  • Extensive support for style requirements
  • Automatic style localization
  • Easy distribution and updating of styles
  • A fast growing library with thousands of freely available styles

There is in fact a tool to use CSL when compiling LaTeX documents. Pandoc accepts a --csl=<csl file> argument, and it will use the supplied CSL style to format your bibliography.

For example:

pandoc --bibliography=refs.bib --csl=mystyle.csl -o out.pdf doc.tex

Will happily generate out.pdf file via LaTeX using the bibtex file refs.bib and CSL file mystyle.csl, from source doc.tex, which presumably has a \thebibliography or some citations in there somewhere.

  • 1
    This is a great idea for many use cases. However, Pandoc uses only a subset of LaTeX and when converting from raw TeX, the internal document model doesn't even support some basic LaTeX environments like \includegraphics. – Arthur Apr 4 '15 at 11:36
  • 6
    @Arthur sorry, but that's incorrect. Pandoc passes the LaTeX through either XeTeX or PDFTeX, and supports whatever they do as long as your output is in a format that doesn't require additional transformation by Pandoc. I've used \includegraphics before via Pandoc, since the Pandoc markdown format doesn't support image transforms. – alyu Apr 5 '15 at 0:36
  • 2
    I should have been more specific. See this issue on the Pandoc GitHub; specifying width/height is not supported which, to my mind, means \includegraphics is not fully supported. – Arthur Apr 6 '15 at 18:13
  • 3
    @Arthur, I believe that issue only applies to converting from latex to non-latex output formats. So if .pdf or .tex is your output format, then those specifications are respected. – askewchan Sep 27 '15 at 1:47
  • @Arthur You can simply use latex includegraphics in your source and pandoc will include that in the tex intermediate step, then you can choose to compile pdf or whatever, no issue. – Zelphir Kaltstahl Nov 2 '16 at 9:57

In one word: no.

Bruce D'Arcus, the original creator of CSL, has repeatedly said that he would like to see an implementation of CSL for LaTeX (to be more precise: he often talked about LuaLaTeX) and that such a thing wouldn't be too difficult to achieve in theory (see this and the following posts for example), but so far, no one has been interested in doing it (the post I linked to dates back to 2008!).

In my opinion, CSL for LaTeX would be extremely useful. CSL is getting more and more traction (there are about half a dozen of implementations ATM), and although it's not quite as powerful as biblatex (but what is?), it's very versatile, and, most important, truly system-agnostic.

It would be the first solution to offer bibliography styles which work equally for a LaTeX and a variety of word processors and is really able to deal with complex styles.

  • 5
    What you mean from: "although it's not quite as powerful as biblatex ...", I think they are not comparable, indeed BibLaTeX may use CSL files to style its output. – PHPst Oct 10 '12 at 16:28
  • I mean, among other things, that biblatex has a more exhaustive data model, allows (in combination with biber) for more complex sorting and offers more fine-grained typographic control. And no, CSL files are completely useless for biblatex. – Simifilm Oct 10 '12 at 20:26
  • "...CSL files are completely useless for biblatex. " ???????? – PHPst May 9 '13 at 9:24
  • 1
    Yes, they are. CSL files need a CSL processor which biblatex is not, which, as I wrote in my answer, doesn't exist (yet) for LaTeX. – Simifilm May 9 '13 at 15:50
  • 2
    Turning biber into a CSL processor would mean rewriting it from scratch. biker was designed for handling biblatex's styles, there's nothing in the program which helps you with CSL at the moment. Adding a CSL processor to it, doesn't really make a lot of sense anyway, you could just write a new program. – Simifilm Nov 21 '13 at 7:00

I've created a Guile Scheme program that can parse a .aux file and produce a .bbl via the Juris-M or Zotero reference manager along with the Better BibTeX for Zotero plugin, modified to provide a bbl format output from its "schomd" interface.

See: https://github.com/KarlHegbloom/zotero-texmacs-integration

It is incomplete. The script in the top directory will run and produce a .bbl as long as you have Juris-M or Zotero and the version of Better BibTeX for Zotero installed that supports it. I've used it to produce a bibliography in Bluebook format (US legal writing). Eventually I will have support in TeXmacs similar to what's in the OpenOffice pluginfor Zotero, so it will handle formatting the in-document citations as well as the bibliography.

  • This looks very interesting. Will it handle citations too? (As you know surely , the rules for creating and referencing shorthands for subsequent in legal articles can be cumbersome to do correctly and automatically.) – jon Mar 28 '16 at 2:29
  • Not quite yet. I'm too busy preparing documents right now to stop and finish. After I'm done with this lawsuit and I have a little more time for it I plan to finish the support. I've decided that what I will do is clone the Open Office plug-in that's written in JavaScript inside Juris-M and Zotero, modify it to talk to code that I will write inside of texmacs. – Karl M Hegbloom Mar 28 '16 at 15:59

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.