Testing variable value
I'm developing a citation style for my group's internal wiki. Everything is pretty much working but I can't seem to figure out how write a conditional based on the value of a variable.
For instance, for all articles from "arXiv", I want the page number to be formatted like this:
[[arxiv>page #]].
I figure it is probably something like:
<choose>
<if container-title="arXiv" match="any">
<text variable="page" prefix="[[arxiv>" suffix="]]"/>
</if>
</choose>
but that doesn't seem to work.
Is there any way to do this?
Forgive me if this is obvious.
Thanks for your help
For instance, for all articles from "arXiv", I want the page number to be formatted like this:
[[arxiv>page #]].
I figure it is probably something like:
<choose>
<if container-title="arXiv" match="any">
<text variable="page" prefix="[[arxiv>" suffix="]]"/>
</if>
</choose>
but that doesn't seem to work.
Is there any way to do this?
Forgive me if this is obvious.
Thanks for your help
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
You can only test for a type, the presence of a variable (i.e. if variable="container-title"), as well as conditions like position, disambiguate, and locator.
Can't think of a good solution to this, either.
Oh well, I'll roll with what I have. Having to manually edit the citation later isn't that big of a deal.
thanks for your help!
[[doi>DOI]] will automatically provide the link: http://dx.doi.org/DOI
Articles on arXiv don't have DOIs but you can link to them by article number and the wiki is setup to resolve:
[[arxiv>article #]] to http://arxiv.org/abs/article #
I have been storing the article # in the pages field in Zotero.
Can you point me to an example?
Also, what wiki software?
As for Zotero, I've modified the Chicago Manual of Style style-file to return what I want based on DOI. Now I can drag and drop from zotero straight into the wiki and have it formatted how I want:
* Baek, Minnhagen, Bernhardsson, Choi, and Kim. "Flow improvement caused by agents who ignore traffic rules." Physical Review E (Statistical, Nonlinear, and Soft Matter Physics) **80** 1: 016111-5 (2009). [[DOI>10.1103/PhysRevE.80.016111]].
While articles from arXiv come out like:
* Bazant, Kilic, Storey, and Ajdari. "Towards an understanding of nonlinear electrokinetics at large applied voltages in concentrated solutions." arXiv: 0903.4790 (2009).
but I'd like them to come out as:
* Bazant, Kilic, Storey, and Ajdari. "Towards an understanding of nonlinear electrokinetics at large applied voltages in concentrated solutions." arXiv: 0903.4790 (2009) [[arxiv>0903.4790]].
then doing an
if value="DOI" ... else "repository" ...
type statement.
I've done something similar for creating links in a rough html style giving priority to a DOI link, or if no DOI, using a URL.
it would be
if variable="DOI"...
/if
else-if variable="archive"
/else-if
the problem with these hacks, of course, is that people would have to insert the arXiv manually into there references, which is a little besides the point - especially since we don't have batch editing yet -
with batch editing this would be easy.
Is there any chance progress has been made?
I would also like to create a conditional
<if container-title="...">
then...
Thanks!
Author, Title, Journal Volume (Year) Pages
But for articles published in JINST and a few others from that family (JHEP, JCAP, JSTAT) the format is
Author, Title, Year Journal Volume Pages
Thanks
Street v Mountford, [1985] 2 Weekly Law Reports 877 (HL).
Barrett v. Enfield L.B.C., (1999) 49 B.M.L.R. 1 (HL).
Discriminating between the two forms is not possible in Zotero currently. For legal support, Multilingual Zotero has implemented a "Year as Vol." field (mapping to the CSL collection-number variable), which allows us to pull it off.
If you post your use case to the Changes to Fields and Item Types thread, there is a fair chance that the "Year as Vol." field (or some other solution to the problem) will make it into Zotero 4.1.
I'll see what I can post in Changes to Fields and Item Types.
Thanks for the help!
Author [...] Place published: Publisher.
For a certain type the format should instead be
Author [...] Publisher.
Is it possible?