Sunday, June 24, 2012

Mendeley Bibliography Vancouver format

For some reason, the Vancouver format given by Mendeley does not seem to be exactly Vancouver at all. I had to make drastic changes to the CSL file to tailor it to a journal's requests.

In any case, I made these changes to the original Vancouver:
A) square brackets in bibliography and in text
B) et. al. beyond 3 authors
C) et. al. italicized
D) remove website, access dates and some other junk
E) journal abbreviations

Let me document how I made those changes.

NOTE THAT for all changes to occur, Mendeley has to be closed and reopened. If you are using the Microsoft Word plugin, Word does NOT need to be closed, only Mendeley, then just click "Refresh" in the plugin in Word.

1) Start "Mendeley Desktop", press Ctrl+Shift+D, click on "Open data directory".
2) That will lead you to this folder "C:\Users\<.username>.\AppData\Local\Mendeley Ltd\Mendeley Desktop\citationStyles-1.0". (Replace <.username>. with your username)
--- Note that this is where Mendeley will look to find your edited versions. The default citation styles (those installed from Mendeley) are stored in another folder - "C:\Program Files\Mendeley Desktop\citationStyles-1.0". For a detailed description (especially on OS-specific issues), look here.

3) Copy Vancouver.csl from the default citation style folder to this folder, and name it Vancouver_new.csl in this folder. Open in a text editor. The Citation Style Format is in XML format, so preferably have an editor that preserves formatting (not Notepad).

4) Go to container <.info>. (somewhere on line 3), under tag "'"\<.title>."'" (line 4), change that to """Vancouver_new""".<./title\>.<./info>.

5) To use square brackets in both text and biblio, go to about line 132 and 168, change """(""" and """)""" to """[""" and """]""" respectively. The first one changes the brackets in the text, and the second in the biblio. So if you require any other variations, you know where to change.

6) To change to et. al. beyond 3 authors, go to line 136, change both the numbers after """et-al-min=""" and """et-al-use-first""" to 3. I read on some forums, sometimes this doesn't work. So play around with the numbers. Having both as 3, worked for me though.

7) To italicize et al. in the biblio, look under the macro container for """author""" or """author-short""". The command tag """et-al""" is provided by """Name""" (or cs:name), so you need to look for a line something like this:
<.blockquote class="""tr_bq""">.
 <.span style="""font-family: "'"Courier New"'", Courier, monospace;""">.<.name sort-separator=""" """ initialize-with="""""" name-as-sort-order="""all""" delimiter=""", """ delimiter-precedes-last="""always"""/>.<./span>.<./blockquote>.

and insert this line AFTER this """name""" tag:
<.span style="""font-family: "'"Courier New"'", Courier, monospace;""">.<.et-al font-style="""italic"""/>.<./span>.

So finally it should end up looking something like this:

<.blockquote class="""tr_bq""">.
<.span style="""font-family: "'"Courier New"'", Courier, monospace;""">.<.macro name="""author""">.
<.names variable="""author""" suffix=""". """>.
<.span class="""Apple-tab-span""" style="""white-space: pre;""">. <./span>.     <.name sort-separator=""" """ initialize-with="""""" name-as-sort-order="""all""" delimiter=""", """ delimiter-precedes-last="""always"""/>.
<.span class="""Apple-tab-span""" style="""white-space: pre;""">. <./span>. <.et-al font-style="""italic"""/>.
<.span class="""Apple-tab-span""" style="""white-space: pre;""">. <./span>. <.label form="""short""" prefix=""", """ text-case="""lowercase"""/>.
<.substitute>.
<.names variable="""editor"""/>.
<./substitute>.
<./names>.
<./macro>.<./span>.<./blockquote>.

8) Removing all those what I call "junk",  requires going to the container """bibliography""". Remove things like these: <.span style="""font-family: "'"Courier New"'", Courier, monospace;""">.<.text macro="""accessed-date""" prefix=""" """/>.<./span>..

Similarly, junk are also found within the """journal-title""" container, such as <.span style="""font-family: "'"Courier New"'", Courier, monospace;""">.<.text term="""internet""" prefix=""" [""" suffix="""]""" text-case="""capitalize-first"""/>.<./span>.

Remove as many of these as you want.

9) Journal abbreviations. Procedure on how to do this is found here. I provide a more succinct description here.

--- Ctrl+Shift+D, click "Open data directory"
--- Create a folder called "journalAbbreviations"
--- Within this folder, create a plain text file called "default.txt". This is a tab-delimited 2-column text file. First column is the full journal name or the name it is printed in your bibliography (case-sensitive, e.g. American Journal of Human Genetics and American journal of human genetics, are 2 DIFFERENT THINGS, so you need to have 2 lines for these). 2nd column is the journal abbreviation.

--- A great start for "default.txt" is found here. Right-click and save as "default.txt".
--- In Mendeley Desktop, when you change to a new style, the default.txt file will be read and the abbrevations will be used since the Vancouver style specifies form="short" for "author".<./title>.<./info>.


*EDIT: If 'refresh' doesn't work, try switching to other styles and then switch back.

ADD1) If you want to get rid of et. al. in the bibliography, set et-al-min = 3 and et-al-first = 1

2 comments:

amit said...

Thanks for great information you write it very clean. I am very lucky to get this tips from you.


Cold Storage Vancouver

Anonymous said...

Oh, I see this the best way to cite our papers manually. But in manually citation can't remember in which style of citation I will do. So, I found some Vancouver style citation generator this tool cite papers automatically in every style.