Did you know — you can now use CSL reference styles in LaTeX

(I like this so much that I’ll repost it here after writing about it on the Overleaf blog!)

It’s now possible to use Citation Style Language stylesheets (.csl files) to format citations and reference lists in LaTeX documents! Make sure your LaTeX packages are reasonably up-to-date for this to work.

You can find .csl styles here (let’s use uoy-archaeology-jsm.csl as an example); and put it in the same folder as your .tex file. Load the citation-style-language package in the preamble:

\cslsetup{style = uoy-archaeology-jsm}
... This combination of data from multiple sources may present problems 
in the categorisation and comparison of sites across the region as a 
whole, in particular the Scottish region where few radiocarbon dates are
available and many site not been classified by date 

Then after compiling with latex/pdflatex/xelatex, instead of running bibtex to process the citations and .bib file, run the citeproc-lua command instead. Follow up with the usual one or two more runs of latex/pdflatex/xelatex, and watch your citations and references appear. A .bbl file will be generated, which you can include in your manuscript submissions to journals.

But if you’re compiling with LuaLaTeX, things will “just work” with just a single compile.

This will be useful if your institution or journal requires a particular reference style that doesn’t have a corresponding BibTeX or biblatex style file, but does have a CSL style file.

Citations not starting from [1]?

So you’re writing your thesis, and you’ve made very sure to use \bibliographystyle{IEEEtran}, or another style that numbers your citations sequentially throughout your thesis. Of course you would then expect that the first citation in your first chapter is [1], right? Right? So why does it not start from [1] in your own thesis; the first citation is some random number [16] or something??

The most likely cause is that you’ve used a \cite{...} somewhere in your \section, \subsection etc., or in a \caption{...}. So the compiler would see these \cite first when they appear in the table of contents, list of figures and tables: and you would likely see your citations [1], … [16] appearing in those lists.

Citations not starting from [1]
Citations not starting from [1] in “main text” despite using IEEEtran bibliography style
A quick solution to get around this is to load \usepackage{notoccite} in your preamble: this would ensure that the sequential numbering of citations will not start in \tableofcontents, \listoffigures, \listoftables.

Demo using notoccite package
Sample code and output when using notoccite with citations

Happy LaTeXing!