HOWTO: edit citation styles for use in Mendeley

[Editor’s Note–We thought you’d like to know: this 2011 post is a bit dated. Find current info on Mendeley’s citation abilities here, and details about editing citation styles in the Mendeley Guides.]

Mendeley uses the Citation Style Language v1.0 to format citations and bibliographies in our Word and OpenOffice plugins. Although we provide styles for 1000+ journals, we realize this isn’t enough for everyone. If you need to customize a citation style and are not scared of editing a little XML (it’s actually not that difficult), read on…

Default styles location

After first installing Mendeley Desktop, 15 commonly used .csl files are placed in the following location: (may differ depending on your system configuration)

  • Windows

C:Program FilesMendeley DesktopcitationStyles-1.0

  • GNU/Linux with Debian packages

/opt/mendeleydesktop/share/mendeleydesktop/citationStyles-1.0

  • Generic GNU/Linux

<INSTALL_PATH>/citationStyles-1.0

  • Mac OS X

/Applications/Mendeley Desktop.app/Contents/Resources/citationStyles-1.0

Custom styles location

To search for more styles, go to the View menu and choose Citation Style -> More Styles….

These additional style files will be placed here: (may differ depending on your system configuration)

  • Windows Vista and Windows 7

C:Users<USER_NAME>AppDataLocalMendeley LtdMendeley Desktop citationStyles-1.0

  • Windows XP

C:Documents and Settings<USER_NAME>Local SettingsApplication Data
Mendeley LtdMendeley DesktopcitationStyles-1.0

  • GNU/Linux

~/.local/share/data/Mendeley Ltd./Mendeley Desktop/citationStyles-1.0

  • Mac OS X

/Users/<USER_NAME>/Library/Application Support/Mendeley Desktop/
citationStyles-1.0

Tutorial: Editing an existing style

Let’s say you’re writing a paper for a new conference, where the organizers have demanded you use the “American Sociological Association” style, but using square brackets instead or parentheses for in-line citations. So instead of this:

(Andersson et al. 2004)

You need to write this:

[Andersson et al. 2004]

Step 1: Create a new style file

Locate the asa.csl file by referring to the “Default styles location” above. Copy this file to the “Custom styles location” above.

NOTE: Never edit the installed files directly, always create a copy first.

Give the file a new name, say asa_custom.csl

Open the file in your favorite text editor (for Windows, try Notepad++) and change the 4th and 5th lines from:

<title>American Sociological Association</title>

<id>http://www.zotero.org/styles/asa</id&gt;

to:

<title>American Sociological Association (custom)</title>

<id>http://www.zotero.org/styles/asa_custom</id&gt;

(or something of your own choosing, the important thing is to ensure the id is unique. No two styles are allowed to have the same id, as Mendeley will not be able to load one of them)

Step 2: Customize the style formatting

Don’t worry about understanding everything in the CSL files right away. For now, just know that the bit describing the format of in-line citations starts with “<citation …>” and ends with “</citation>”, which is from line 120 to 130 in your asa_custom.csl file.

To change the parentheses to square brackets, change line 121 from:

<layout prefix=”(” suffix=”)” delimiter=”; “>

to:

<layout prefix=”[” suffix=”]” delimiter=”; “>

Save your edited style file.

Step 3: Use the new style in Mendeley

Restart Mendeley Desktop. Open a new Word or OpenOffice document and select “More Styles…” from the citation style drop-down box. In the dialog that appears you should select “American Sociological Association (custom)” and click Use this Style and then click Done.

Congratulations! You can now cite in your custom style. Here’s a short video showing the process.

http://www.youtube-nocookie.com/v/Rgb0Ldb6LhM?fs=1&hl=en_US&hd=1

To learn more about editing CSL files, check out the official guide as well as reading and experimenting with the styles included with Mendeley (but remember to create copies first as in step 1!) If you’d like more tutorials going into more depth on CSL, please drop us a comment below.

We plan to make the process of editing styles simpler in future, and to expand our database of downloadable citation styles.

Happy Citing!

67 thoughts on “HOWTO: edit citation styles for use in Mendeley

  1. William,
    re “suggestions about how we can improve things”

    I am a Mendeley user but it does seem unfair that Mendeley (and Papers and anyone else who uses CSL) benefits from all the effort Zotero and Zotero’s community put into supporting and advancing CSL without (seemingly) contributing much yourself. Leading the development of an open-source CSL editor would have been a great contribution but that project seems to have died (or severely stalled). In lieu of this, why not pay a modest amount to someone suitable (e.g. an computer science undergrad) to write styles requested in Mendeley feedback forum and contribute them to the shared CSL repository?

  2. osm – in the current release, we use the styles from here: http://citationstyles.org

    Let me assure you the project hasn’t died. It’s like most anything else worth doing – 90% of the effort goes into getting the functionality working, and the other 90% goes to finishing the polish and details of that last 10% 😉 For what it’s worth, it’s a subject of weekly discussion among the developers.

  3. William – thanks for the update on the csl editor.

    Are you sure about Mendeley desktop is using the repository at citationstyles.org?
    citationstyles.org/styles links to here: https://github.com/citation-style-language/styles. The example I gave earlier (styles with neuroscience in name) still holds: 6 through mendeley desktop (0.9.9.2) vs 10 in the list linked to from citationsyles.org/styles (which seems to be the repository that the zotero browsing interface access).

  4. Hi osm,

    We host styles from a local copy of the github repository. Currently that local copy is out of date. Getting it updated on a regular basis is on our TODO list.

  5. Hi

    I’m trying to use the Journal of Organic Chemistry or Journal of the American Chemical Society citation styles, but instead of using a semicolon to separate each authors name, it is only putting a semicolon between the last two authors names and nothing between the rest, does anyone know how i change this?

    Many Thanks
    Collette

  6. In addition to my last post, I get this issue when I use any of the ACS Journals as my citation style.
    Collette

  7. Collette – This is a bug in the 3rd party component that Mendeley uses to render the citations (cireproc-js): http://forums.zotero.org/discussion/19070/semicolon-as-author-delimiter-citation-processor-bug/

    As you can see from the link above, the bug in the processor seems to have been fixed, but based on past form I expect it will be a while before it finds itself in a Mendeley update. It would be nice if Mendeley would incorporate citeproc-js updates more regularly than they have been doing in the past.

  8. Thanks very much! For the future database, I strongly recommend making it user-based, so we all can contribute!

  9. I wonder how I call the variables ‘department’, ‘type’ and ‘university’ in the reference?

  10. Hi everybody! I do really urgently need some help!
    I changed a Citation Style, changed the name and the ID and did anything I had to…
    the problem is: once I add it to my citationStyles-1.0 folder, it does not appear in Mendeley’s Citation list… instead there is an empty line which definetly belongs to the style (I tried it out) can please anybody help? need to finish my thesis and nothing works…
    here is the style: https://gist.github.com/1217713
    and here is the validation:
    http://validator.nu/?doc=https%3A%2F%2Fgist.github.com%2Fraw%2F1217338%2F62387312d736b888a9e5b6d447ce07f889e05399%2Fmartyna.csl&charset=UTF-8&schema=https%3A%2F%2Fgithub.com%2Fcitation-style-language%2Fschema%2Fraw%2Fv1.0%2Fcsl.rnc&laxtype=yes
    Thanks a lot!!

  11. Hi i need to use Vancouver style with abbreviation of journals.

    e.g.Parkin DM, Clayton D, Black RJ, Masuyer E, Friedl HP, Ivanov E, et al. Childhood leukaemia in Europe after Chernobyl: 5 year follow-up. Br J Cancer 1996;73:1006-12.

    this is the format to be used,

  12. Hi i need to use Vancouver style with abbreviation of journals.

    e.g.Parkin DM, Clayton D, Black RJ, Masuyer E, Friedl HP, Ivanov E, et al. Childhood leukaemia in Europe after Chernobyl: 5 year follow-up. Br J Cancer 1996;73:1006-12.

    this is the format to be used, need help

  13. Is there a way to change the font and paragraph spacing the bibliography with method.

    Each time a refresh the bibliography it reverts to times new roman and the old paragraph spacing and font size.

    I am using the Harvard CSI and have tried looking at the file in notebook and I can’t find anything on font.

    Cheers

Comments are closed.