This article explains how to create a CSL style that allows the “et al.” abbreviation to appear selectively—in inline citations, in the bibliography, or both. I wrote this because I couldn’t find a clear, standards-compliant explanation online—aside from some hacks, there seems to be no resource that shows how to achieve this within the CSL 1.0.2 specification. This is a complete, standards-compliant guide to selectively enabling or disabling ‘et al.’ in CSL, distinguishing between inline citations and bibliography output.
As I am about to use this occasion to vent a little over the CSL standard, if you’re interested in the [pretty trivial] solution, please scroll to the bottom of the article. Instructions are clear and concise.
Now, CSL…
For those unfamiliar with it (99.999999% of humanity), CSL stands for Citation Style Language and it is used to describe how to format inline citations and bibliography in a scientific (or otherwise) article. For some reason unbeknownst to me, publishers of scientific papers just love to have their own little standard and whoever wants to publish there must follow their rules or risk rejection.
Sometimes it is about clarity of citation that is tailored for specific nuances of the field, and I would say that fewer than two hundred different citation styles clearly do have an advantage by being stubborn about how many authors can be named in a citation and where the “et al.” abbreviation will eat the less fortunate co-authors, or whether it is important that a year of publication goes before the number of the page(s) containing the particular reference.
For the thousands of other citation styles (over 9000!), it’s hard not to feel that someone is obsessively sticking to tiny formatting rules that few readers notice or appreciate. On the bright side, at least you can name the style after your institution.
It is what it is – there’s an absolutely insane number of styles that a scientific article can be written in, and scientists know really well how much time it takes out of productive article writing just to get the references and bibliography right, so that the paper won’t be returned because of a technicality.
To tackle this, there are software solutions that automate working with citations and essentially free the scientist from dull and tedious formatting. Those tools (there are several good ones) use and more or less adhere to the CSL style standard. This makes life easier to both users of the tool and the unfortunate soul who has to code and maintain the software.
I have mixed feelings about CSL standard. I can clearly see both good and bad aspects of it, so let’s briefly discuss them.
Goodies
CSL is an XML standard. It’s not too complicated, but it can become quite convoluted. Important: it is fully human-readable and can be manipulated using any text tool. It does not require specialized software to work with (although there is a rather nice visual tool for editing the style), and each element of the XML is (eventually) recognizable. It could be written in any other format, I guess, but I see no reason to switch to, for example, JSON format – it would become less readable; and God forbid that anyone decides to create systemd CSL.service!
It is just fine in its current format. Chill and readable.
Another great thing: CSL is agnostic to the software used, and doesn’t care about styling – apart from some very basic formatting, everything else is left to the software. This ensures that the style should render the same on many different platforms; it is up to the text editing software to garble the output.
Badies
CSL is a standard set in stone and changes over decades. Last update (v1.0.2) was introduced in 2022. to replace the previous 2012. version. The next change will happen eventually, I guess around 2032.
Why is it bad? Well, the changes happen much more quickly than once in a decade; a good example are sets of data that are now ubiquitous but can’t really find a proper, unique place in the standard.
And CSL is very, very rigid. It’s not bad, that rigidity (reflecting the rigidness of the publisher who would reject a paper because bibliography formatting has some slight mistakes) does have its place: a standard that would allow just about anything is no standard. By sticking to the rigid rules of CSL we can be sure that those 10000 different styles will stay in the herd.
This creates a good anchor for software: knowing that there’s this one standard and that it has those rules and limitations would ease the development of software. That’s good.
What is not good is that there are more modern elements of citation or bibliography that would sometimes even be imposed upon authors, but the style cannot cover them.
For example, there’s a certain government down under that likes their online publications to have a URL to the relevant material linked into the title of the reference. Well, this is not in CSL’s department and cannot be solved by changes in the style. However, it is a real-world problem that has to be addressed somehow. My solution was to create a special CSL style and couple it with Word macro that would merge URL with the title of the reference. It works but it is not the prettiest solution.
Also, working with anything that is out of the predefined set of terms and variables is a major pain. It is not impossible, but it is really, really limited. Whereas the built-in terms and variables can be checked for value in case that there are multiple values, the unknown variable (not defined by the standard) can only be checked for existence. This limits what is possible to do with non-standard metadata but still leaves the tiny opening for the style editor to crudely handle any metadata that is not defined by the standard. It’s not pleasant but it works. I’ve created a number of such styles for clients who need to implement non-standard metadata into their bibliographies.
If there’s one thing that would make it so much easier, it would be adding the ability to work with custom terms and variables that are not defined in the style.
Yes, it pollutes the style and makes it less rigid (and theoretically more prone to errors as well as less interoperable).
Interoperability is a thing: currently a style can be easily exchanged between different applications, and adding custom things could diminish this interoperability. However, the pressure to work outside of the scope of predefined terms and variables is felt, so the solution to this problem should be found, lest all of the software manufacturers diverge greatly and eventually destroy interoperability.
I can’t say much against CSL, but its rigidity and very slow pace of adapting to the realities of the field do make things harder for everyone. And sometimes it’s very frustrating trying to circumvent its rigid boundaries in order to get that specific, non-standard piece of information out and in the right place.
—- Solution starts here —-
If you’ve skipped the above (and rightfully so), here’s the short recap of the problem: CSL allows specifying a maximum number of authors to display, after which it uses an abbreviation. This is done to keep citations neat and readable as some papers can have tens of authors; the problem is that in current standard, if a style does use abbreviation in one part, it has to use it in the other part as well: you cannot have inline citations (the ones that go into the article itself) omit “et al.” if you decide to use it in the bibliography (the thing that usually goes at the end of the article, and honestly – very few people actually read).
I’ve stumbled upon a request from a client to have a style for SmartCite that goes against that: a style that would not show abbreviation in the inline citation but still use it in the bibliography.
So, how do we create something that looks like this?

There’s a method that could be used to limit the number of authors shown in an inline citation:
<names variable="author" et-al-min="2" et-al-use-first="1">
Variable “author” is holding names of all authors; attributes “et-al-min” and “et-al-use-first” control how many authors are needed in order for abbreviation “et al.” to show up, and how many authors are to be cited before abbreviation, starting from the first author, respectively.
Sometimes, for some software that might work: if there’s just one author in the inline citation, the software will omit the abbreviation – and that’s not in accordance with the standard.
There’s a method that would allow us to create inline citations without the abbreviation and still stay within the standard; it might not be what the standard creators had in mind, but for all purposes it should be “legal” – and it should be universal, applicable to any software that sticks to the CSL specification.
The hack is in slight abuse of localization features of the CSL standard: creation of an empty term that we will use to replace the standard “et al.” term. If you’ve read my rant at the beginning of this article you will know that CSL is deliberately a very rigid standard that requires strict hierarchy and offers very little space for “creativity”. Yet there’s a chink in its armor: because it has to be multilingual, it must allow for terms to be changed to accommodate local language. This opens up a possibility to manipulate the “et al.” text: to translate it to another language (“et d’autres” for French articles scientifiques) or (drum roll) to turn it into an empty string (totally Ok with the standard).
A term has to be defined within the localization context of the XML, but from then on it can be used anywhere in the style. The little trick looks like this:
<locale xml:lang="en">
<terms>
<!-- Create a term that is basically an empty string -->
<term name="et-al-nope"></term>
</terms>
</locale>
Here we’ve defined a new term that will be used for the selected language (en). There’s nothing between term tags, exactly as we want it.
Now, another small step is to insert this term into the context of either an inline citation or the bibliography; in our case – the author macro created specifically for inline citations.
<macro name="author-short-in-citation">
<names variable="author" >
<name form="short" name-as-sort-order="first" delimiter=", "/>
<!-- Here we replace et-al with an empty string -->
<et-al term="et-al-nope"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
</substitute>
</names>
</macro>
The trick is to replace the standard et-al term with our own et-al-nope term which is just an empty string. This is allowed by the standard.
For bibliography we should create a different author macro that does not contain this hack; bibliography will therefore display “et al.”
All that is left is to make sure that inline citations use the right author macro:
<!-- Citation layout -->
<citation disambiguate-add-year-suffix="true" et-al-min="2" et-al-use-first="1">
<sort>
<key macro="author-short-in-citation"/>
<key variable="issued" sort="descending"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group>
<text macro="author-short-in-citation"/>
<text macro="year-in-citation" prefix=", "/>
</group>
</layout>
</citation>
And that’s about it. It’s simple, it’s standard, it should work everywhere.
Here’s a simple demo style for you to play with:
Views: 67


Comments, rants and vents