MS-Word Macro to convert Zotero citations into clickable Hyperlinks
No doubts that Zotero is a nice piece of software but last time I used it while writing an international grant proposal (French-German ANR-DFG call) I could not find a simple way to turn Zotero's citations into clickable Hyperlinks (but many post on the forum). As I was in a hurry I had to do it manually… Not very convenient and interesting.
It is a real shame that Zotero do not provide an easy way to generate clickable citations with Hyperlinks that points the DOI address of the cited work (long live LaTex!). Hyperlinks are the root of internet and I cannot understand why such basic features are still lacking in all days softwares in this year 2019...
In order to circumvent this missing feature I wrote a MS-Word macro that operate together with modified Zotero style.
Step1:
In brief, you need to modify your preferred Zotero style in order that your citations appear between 2 text marks: "#c1#" and "#c2#" that mark respectively the
start and end of a citation. In addition, you need to modify your preferred Zotero style in order that the corresponding internet address (you want the
Hyperlink to point to) appears right after the citation between 2 text marks: "#a1#" and "#a2#" that mark respectively the start and end of an address.
For example I modified the nice "Minimal style for grant proposals" authored by Anton Crombach to support these 2 modifications:
- on line 78 I added a prefix and suffix for the bibliography layout group :
- after the bibliography layout group I added a text variable that will display the DOI between the 2 text marks discussed before:
Step2:
Use Zotero as usual to add citation to your MS-Word document. Again, as usual once at the end of your writing add the bibliography and use your preferred
Zotero style that you modified in step1 to have text marks appearing in the bibliography. In principle your bibliography should look like this:
#c1#citation1#c2##a1#address1#a2#
#c1#citation2#c2##a1#address2#a2#
…
Step3:
Unlink Citations. As usual you may want to save your work with a different filename before this step as it cannot be reversed!
Step4:
Run the following macro that will automatically recognize the citation fields and address fields and generate accordingly the hyperlinks (and remove the text marks).
Here is the link to download a 7zip archive that contain the files:
- Readme.txt : a txt file that contains the instructions.
-ZoteroToHL_macro.txt: a txt file that contain the macro for MS-Word.
-minimal-grant-proposals-for-ZoteroToHL.csl : the minimal-grant-proposals Zotero style modified to work with the MS-Word macro.
-ZoteroToHL_testfile.docx : a MS-Word file that I used to test the macro.
The link:
https://seafile.unistra.fr/f/307e02532d88453aaca2/?dl=1
The password: ZoteroToHL
It is a real shame that Zotero do not provide an easy way to generate clickable citations with Hyperlinks that points the DOI address of the cited work (long live LaTex!). Hyperlinks are the root of internet and I cannot understand why such basic features are still lacking in all days softwares in this year 2019...
In order to circumvent this missing feature I wrote a MS-Word macro that operate together with modified Zotero style.
Step1:
In brief, you need to modify your preferred Zotero style in order that your citations appear between 2 text marks: "#c1#" and "#c2#" that mark respectively the
start and end of a citation. In addition, you need to modify your preferred Zotero style in order that the corresponding internet address (you want the
Hyperlink to point to) appears right after the citation between 2 text marks: "#a1#" and "#a2#" that mark respectively the start and end of an address.
For example I modified the nice "Minimal style for grant proposals" authored by Anton Crombach to support these 2 modifications:
- on line 78 I added a prefix and suffix for the bibliography layout group :
- after the bibliography layout group I added a text variable that will display the DOI between the 2 text marks discussed before:
Step2:
Use Zotero as usual to add citation to your MS-Word document. Again, as usual once at the end of your writing add the bibliography and use your preferred
Zotero style that you modified in step1 to have text marks appearing in the bibliography. In principle your bibliography should look like this:
#c1#citation1#c2##a1#address1#a2#
#c1#citation2#c2##a1#address2#a2#
…
Step3:
Unlink Citations. As usual you may want to save your work with a different filename before this step as it cannot be reversed!
Step4:
Run the following macro that will automatically recognize the citation fields and address fields and generate accordingly the hyperlinks (and remove the text marks).
Here is the link to download a 7zip archive that contain the files:
- Readme.txt : a txt file that contains the instructions.
-ZoteroToHL_macro.txt: a txt file that contain the macro for MS-Word.
-minimal-grant-proposals-for-ZoteroToHL.csl : the minimal-grant-proposals Zotero style modified to work with the MS-Word macro.
-ZoteroToHL_testfile.docx : a MS-Word file that I used to test the macro.
The link:
https://seafile.unistra.fr/f/307e02532d88453aaca2/?dl=1
The password: ZoteroToHL
I think it would be awesome if this macro can also turn in-text-citations into clickable hyperlinks to the DOI of the item in question.
I don't know much about modifying citation styles, do you know know how could it be done to achieve that? Preferably on numerical citation styles.
Thank you once more!
Still it is weird why such a basic feature is still not implemented in Zotero.
[#c1#1#c2#]#a1#http://www.sciencedirect.com/science/article/pii/S016609340900442X#a2##a1#https://doi.org/10.1016/j.jviromet.2009.10.003#a2#
It is perhaps related to a new version of Zotero because I am using ZotoroToHtml for a few months and I did not noticed this problen before. It looks like is not working.
Any idea ?
Done:
https://forums.zotero.org/discussion/comment/347407/#Comment_347407
Sub linkNumberedReferences for numbered references
Sub linkAuthorDateReferences for author-date references
The latter currently goes to the first matching references where the bibliography contains more than one citation starting with the same name.
Can you plz make a Youtube video (how to add this Zotero macro in word) as a tutorial for this purpose. It has gone a little too technical and complex for beginners.
https://forums.zotero.org/discussion/comment/347407/#Comment_347407
because the script is for LibreOffice, not MS Office