Editing/adapting a citation style (generally) and adding reference URLs
1. To adapt an existing citation style in Zotero:
Open Zotero, or open the styles menu directly from your word processing program via the Zotero plug-in (extension) icons in your menu bar.
Go to settings (via "edit" if you are doing this from Zotero).
In the Zotero settings window, click on the "Cite" icon at the top.
Select the style that you wish to adapt/edit.
Click on the button "Citation style editor".
You will then see the script that produces the citation and reference styles in a text document.
Adapt the script as desired (the Zotero citation script language is basically XML, and you can find tutorialsonline, for example at https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step)
Before saving the new script it's vital that you rename it at the top of the script [as explained on the page linked above — D.S.] otherwise Zotero will automatically overwrite it with the existing template script when updating its citation styles library.
[removed — D.S.]
Now save the script via "Save as..." in your user Zotero styles folder. This is usually found via the following path on your computer: This PC > Users > YourUserName > Zotero > styles
Make sure that the file name suffix (file type) is .csl It may well be that your computer does not automatically recognize the file type and automatically add the .csl when you save, so you must check this, otherwise the file will not be recognized by Zotero.
2. Adding the URL data field from your library entries to the reference format. If you have URLs in your references in your reference library in Zotero, and want to add them at the end of each references:
Go to the following place in the script of the citation style that you are using:
This is basically the macro that looks for a DOI in your references, and if it finds it, adds it at the end of the reference format.
If you want Zotero to add your URLs, then insert the following three lines after the
Your final script, at that point, should look like this:
Re-name and save the script (citation style), as in point 1. above.
Open Zotero, or open the styles menu directly from your word processing program via the Zotero plug-in (extension) icons in your menu bar.
Go to settings (via "edit" if you are doing this from Zotero).
In the Zotero settings window, click on the "Cite" icon at the top.
Select the style that you wish to adapt/edit.
Click on the button "Citation style editor".
You will then see the script that produces the citation and reference styles in a text document.
Adapt the script as desired (the Zotero citation script language is basically XML, and you can find tutorialsonline, for example at https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step)
Before saving the new script it's vital that you rename it at the top of the script [as explained on the page linked above — D.S.] otherwise Zotero will automatically overwrite it with the existing template script when updating its citation styles library.
[removed — D.S.]
Now save the script via "Save as..." in your user Zotero styles folder. This is usually found via the following path on your computer: This PC > Users > YourUserName > Zotero > styles
Make sure that the file name suffix (file type) is .csl It may well be that your computer does not automatically recognize the file type and automatically add the .csl when you save, so you must check this, otherwise the file will not be recognized by Zotero.
2. Adding the URL data field from your library entries to the reference format. If you have URLs in your references in your reference library in Zotero, and want to add them at the end of each references:
Go to the following place in the script of the citation style that you are using:
<macro name="access">
<choose>
<if variable="volume"/>
<else-if variable="DOI">
<text variable="DOI" prefix="doi:"/>
</else-if>
</choose>
</macro>
This is basically the macro that looks for a DOI in your references, and if it finds it, adds it at the end of the reference format.
If you want Zotero to add your URLs, then insert the following three lines after the
</else-if>
step above: <else>
<text variable="URL"/>
</else>
Your final script, at that point, should look like this:
<macro name="access">
<choose>
<if variable="volume"/>
<else-if variable="DOI">
<text variable="DOI" prefix="doi:"/>
</else-if>
<else>
<text variable="URL"/>
</else>
</choose>
</macro>
Re-name and save the script (citation style), as in point 1. above.
<id>
has to be changed if you don't want the style to be overwritten. This is all explained on the official instructions that you link to, so it's better not to duplicate that here.)