please help with style modification
Hejhej!
Starting from this style http://www.zotero.org/styles/angewandte-chemie I would like to introduce a weblink. The style should give the DOI if available or the website.
I tried to put
<choose>
<if variable="DOI">
<text variable="DOI" prefix="direct link: http://dx.doi.org/"/>
</if>
<else>
<text term="direct link: " suffix=" "/>
<text variable="URL"/>
</else>
right before
<citation>
<option name="collapse" value="citation-number"/>
<sort>...
and loaded the style in Zotero (latest stable Firefox, OpenOffice and Zotero addons).
The bibliography didn't change though :-(
Also tried to delete the section
<choose>
<if variable="page" match="none">
<choose>
<if variable="DOI">
<text variable="DOI" prefix="DOI "/>
</if>
</choose>
<choose>
<if type="webpage">
<text variable="URL" prefix="can be found under "/>
</if>
</choose>
</if>
</choose>
which was above my addition, but no results again.
Could anyone give me a tip how to insert this little DOI/URL choise into the style? Thanks!
Starting from this style http://www.zotero.org/styles/angewandte-chemie I would like to introduce a weblink. The style should give the DOI if available or the website.
I tried to put
<choose>
<if variable="DOI">
<text variable="DOI" prefix="direct link: http://dx.doi.org/"/>
</if>
<else>
<text term="direct link: " suffix=" "/>
<text variable="URL"/>
</else>
right before
<citation>
<option name="collapse" value="citation-number"/>
<sort>...
and loaded the style in Zotero (latest stable Firefox, OpenOffice and Zotero addons).
The bibliography didn't change though :-(
Also tried to delete the section
<choose>
<if variable="page" match="none">
<choose>
<if variable="DOI">
<text variable="DOI" prefix="DOI "/>
</if>
</choose>
<choose>
<if type="webpage">
<text variable="URL" prefix="can be found under "/>
</if>
</choose>
</if>
</choose>
which was above my addition, but no results again.
Could anyone give me a tip how to insert this little DOI/URL choise into the style? Thanks!
<text term="direct link: " suffix=" "/>
isn't valid (nor is it a good idea to use).
Remove it and instead add prefix to the URL:
<text variable="URL" prefix="direct link: "/>
also, your added section needs a closing </choose>
Deleting the other section should be fine.
However, I was able to solve the problem by replacing the I delted before (see first post) with:
<choose>
<if variable="DOI">
<text variable="DOI" prefix="direct link: http://dx.doi.org/"/>
</if>
<else>
<if type="webpage">
<text variable="URL" prefix="direct link: "/>
</if>
</else>
</choose>
Now the DOI is inserted right after the prefix, so that it becomes a clickable link. I am still trying to get it to 'code' the choise: IF DOI, ELSE URL. Will post my findings, am still grateful for help ;-)
The code above shouldn't work correctly - it misses and <choose> </choose> (for the if type=webpage)
you might get lucky and have it work but it's not recommended.
Why do you even need that?
Could you describe more specifically what you're trying to do?
- insert the DOI number IF it is in the citation's data
- ELSE insert URL
- do nothing if both are inavailable
Your suggestion about "<text variable="URL" prefix="direct link: "/>" didn't work unfortunately. Yes, I added </choose> ;-)
<if type="webpage">
with<if variable="URL">
(or just remove that if block completely if the only line you have there is<text variable="URL" prefix="direct link: "/>
because it should fail gracefully).but I think the second suggestion - taking out the <if type> and </if> entirely makes more sense anyway.
<choose>
<if variable="DOI">
<text variable="DOI" prefix="direct link: http://dx.doi.org/"/>
</if> ---> prints the DOI number into a clickable link
<else>
<text variable="URL" prefix="direct link: "/>
</else> ---> prints the URL only if no DOI is available
</choose>
If I leave out any IF or ELSE now, both DOI and URL are printed, which makes the citation list a bit fuller than my supervisor accepts ;-D
the ELSE part can also be replaced with
<if variable="URL">
<text variable="URL" prefix="direct link: "/>
</if>
OK now: never change a running system (right before handing in your Master thesis) ;-D
Thanks for your help/Takk for hjelpen :-)