Skip to main content
Citation Styler Logo - Cite in a breeze with Citation styles for Zotero

Creating and customising your own citation style for Zotero: a step-by-step guide

How to edit a CSL citation style for Zotero and Mendeley

You have a citation guide from your university or publisher, but none of the existing styles in Zotero or Mendeley really fit?
With CSL citation styles (‘Citation Style Language’), you can customise existing templates to suit your needs. In this article, I will show you step by step how to edit a CSL style, what typical pitfalls there are, and when a made-to-measure citation style is worth it.

Is it possible to create a citation style from scratch?

In short: in theory, yes; in practice, nobody does it. A CSL style is an XML file containing several hundred lines, and even a simple style has to cover dozens of source types – books, anthologies, journal articles, websites, legislation, interviews. Starting from scratch means writing all of that yourself.

The usual approach is therefore a different one: you look for the style that most closely matches your requirements, and make specific changes to what doesn’t fit. The result is still your own style – it is given its own name, its own ID, and is stored as a separate file in Zotero. It’s just that the starting point is different.

This guide explains exactly how to do this.

What are CSL citation styles?

The Citation Style Language (CSL) is an XML-based programming language and a open-source library, which now provides more than 10,000 citation styles.

The advantage:

  • The public format (in stark contrast to EndNote or Citavi) has resulted in CSL being supported by a number of programmes, including Zotero, Mendeley, Papers, RefWorks, PaperPile and more.
  • Furthermore, the community has also provided a number of tools to simplify working with CSL.
  • In addition, you can of course modify existing templates for your own use.

Customising CSL citation style in Zotero – step by step

Below you can see a typical way of adapting an existing style to your specifications.

1. Find the right style to use as a template

The first step is to find a style that comes as close as possible to your guidelines – then you will have less to change in the code later on.

  • Open the Zotero Style Repository or the style settings in Zotero.
  • Search for keywords such as ‘Harvard’, the name of your university or your field of study.
  • Alternatively, you can also find something suitable with the "Search by Example" tool
  • Compare one or two test sources in the bibliography with your guide and choose the style that fits best.

You can use this style as a basis for your customisations.

2. Download the CSL file and open it in Style Editor.

Once you have found a basic style, you need the .cslfile.

  • Download the style from the repository or export it from Zotero.
  • Open the integrated Style Editor in Zotero (Settings → Citations → Styles → ‘Edit Style’).
  • Alternatively, you can also open the .cslfile in a text editor, like VS Code or Notepad++, or use the VisualEditor for CSL

In the Style Editor, you will see the CSL code: at the top, the metadata for the style (name, ID, author, etc.), and below that, the actual formatting rules for citations and the bibliography.

CSL Style Editor in Zotero
CSL Style Editor in Zotero (Tools → Developer → Style Editor)

3. Frequent adjustments to the CSL code

In practice, it is almost always a matter of the same adjustments:

  • Order in the bibliography – e.g. ‘Author – Year – Title – Publisher’ instead of ‘Author – Title – Publisher – Year’.
  • Format of the authors – e.g. ‘surname, initials’ instead of full first name, or the use of ‘et al.’ for three or more persons.
  • Year date – in round brackets, without brackets or in another position.
  • Italics – whether magazine titles or book titles should be set in italics.
  • Punctuation – which full stops, commas or colons are used between the elements.

All of this can be customised in the CSL code – provided you find the right places and know the structure of the style. Usually, you edit the ‘citation’ and ‘bibliography’ sections, where the output of the references is defined.

The following are helpful in this regard: Step-by-Step Instructions from the Zotero documentation, as well as the 'CSL specification', to understand CSL and use it correctly.

CSL Specifications website
CSL Specifications website

4. Test style: try it out in Word or LibreOffice

After every major change, you should test the style in a real document.

  1. Save the edited style in the editor and activate it in Zotero.
  2. Create a short test document in Word or LibreOffice with a few different sources (book, journal article, anthology, internet source, etc.).
  3. Insert citations and create a bibliography.
  4. Compare the output line by line with the official guidelines from your university or publisher.

Only when the most important source types are displayed correctly is it worthwhile to use the style permanently.

Common problems when editing CSL styles

When editing a CSL style, many people stumble at similar points:

  • XML errors – Even one forgotten closing tag is enough for Zotero to reject the style or not format references at all.
  • Changes do not take effect everywhere – Adjustments often only apply to certain document types (e.g. journal articles) because other types have their own rules in the code.
  • Differences between Word and LibreOffice – Depending on the word processor, fields are interpreted slightly differently.
  • Cryptic validator messages – the official CSl validator helps with testing, but the error messages are written more for developers than for stressed-out students.
  • 'disambiguation' – Two sources by the same author from the same year – when should they be cited as (Müller 2020a) and (Müller 2020b), and when should the first name be included instead? This is governed by the style guide, and the variant required by your guide often differs from the standard.
  • Language and date formats – A style guide intended for use in German still uses ‘ed.’ instead of ‘Hrsg.’ or writes month names in English. And, depending on the type of source, date formats sometimes have to be defined more than once.

If this is your first time working with XML, troubleshooting can quickly take several hours – especially if your guide contains many special cases (e.g. online sources, legal texts, multiple editors).

Please note: LLMs, although tempting, are not yet able to implement citation styles in a complex manner. Students have told me that they lost marks for incorrect citations because a citation style created by ChatGPT produced incorrect output.


Customise yourself or tailor-made citation style?

Whether you edit your style yourself or prefer to leave it to me depends primarily on time, nerves and the complexity of the guidelines.

It is worth customising yourself if ...

  • your guide deviates only slightly from an existing style.
  • you are interested in technology and have some time to experiment.
  • you are mainly writing a one-off piece of work and minor deviations are acceptable.

A Your Custom Citation Style ist sinnvoll, wenn …

  • the guidelines provided by your university or publisher are very detailed and strict.
  • you are about to submit your thesis and do not have time for trial and error.
  • you want to write several papers or publications in the same style and want maximum certainty.

Customised citation style: How I can help you

If you don't have the time or inclination to familiarize yourself with CSL, XML code, and validator messages, I'll take care of it for you.

With my 'Your Custom Citation Style' service I create a verified CSL citation style based on your university or publisher guidelines, test it in Zotero and make any necessary adjustments – so you can focus on your content instead of formatting.

➜ All information & enquiries: Your Custom Citation Style

Further reading

Blog - IndigoPhoenix plugin

The future after Juris-M: A plugin brings legal citations back to Zotero

The Zotero fork Juris-M no longer synchronises and is considered abandoned. However, there are new developments: a new plugin is bringing jurisdictions, legal styles and parallel citations back to the current version of Zotero – still in alpha, but at an astonishing pace. What Juris-M users should know and do now.

© Citation Styler. All rights reserved. 2026