CSL Style modification asterisk (*) in meta-analysis references APA
Hi all,
I'm trying to get a * preceding some reference list entries (the ones that were included in a meta-analysis, not just referenced in the text).
As there seems to be no proper way to "tag" some references, I came up with the idea to use the keywords entry and do an "is numeric" check with it. Thus, I would put a number in the keywords entry for all references I want to be marked with a *. My code is as follows:
I added that as a choose-if in the bibliography section (modifying the apa6 style), but nothing happens at all.
Is my approach possible? If yes, where is my mistake? Or do you have any better ideas?
Thanks!
Code follows (I only added the
I'm trying to get a * preceding some reference list entries (the ones that were included in a meta-analysis, not just referenced in the text).
As there seems to be no proper way to "tag" some references, I came up with the idea to use the keywords entry and do an "is numeric" check with it. Thus, I would put a number in the keywords entry for all references I want to be marked with a *. My code is as follows:
I added that as a choose-if in the bibliography section (modifying the apa6 style), but nothing happens at all.
Is my approach possible? If yes, where is my mistake? Or do you have any better ideas?
Thanks!
Code follows (I only added the
<choose>
part:<bibliography hanging-indent="true" et-al-min="8" et-al-use-first="6" et-al-use-last="true" entry-spacing="0" line-spacing="2">
<sort>
<key macro="author"/>
<key macro="issued-sort" sort="ascending"/>
<key macro="title"/>
</sort>
<layout>
<group suffix=".">
<choose>
<if match="any" is-numeric="keyword">
<text value="* "/>
</if>
</choose>
<group delimiter=". ">
<text macro="author"/>
<text macro="issued"/>
<text macro="title-plus-extra"/>
<text macro="container"/>
</group>
<text macro="legal-cites"/>
<text macro="locators"/>
<group delimiter=", " prefix=". ">
<text macro="event"/>
<text macro="publisher"/>
</group>
</group>
<text macro="access" prefix=" "/>
<text macro="original-date" prefix=" "/>
</layout>
</bibliography>
Keyword isn't mapped anywhere into CSL, so you can't use that.
Extra would work ("note" in CSL), but you may need that for other purposes.
@bwiernik had advice on handling this in systematic reviews some time back, he might chime in.
<if match="any" is-numeric="keyword">
.Standard construction seems like:
<if variable="XY" match="any" is-numeric>
but currently I am in the car, so I can be wrong.I also found the discussion you mention earlier, which has details on the "note" solution (for others interested: https://forums.zotero.org/discussion/67193/inserting-asterisks-into-zotero-bibliography
The APA actually mandates (again, after a back-and-forth and with a convincing explanation) to include and *-mark references in the main manuscript section, not only in an appendix, see here: http://blog.apastyle.org/apastyle/2012/08/alert-change-in-apa-style-on-meta-analysis-references.html
<choose>
<if type="article-journal" match="any">
<text variable="publisher-place" suffix=" "/>
</if>
</choose>
In the same place as above
Otherwise, if you really want the asterisk, I would recommend either adding them manually after you unlink citations or else adding an unused CSL variable to Extra and modifying the style. For example, you could add:
keyword: *
to Extra and then modify the APA style to add
<text variable=keyword suffix=“ “/>
to the beginning of the bibliography layout.You could also use this code to use indicators other than asterisks (e.g., if you wanted to use superscript letters to indicate articles contributing effect sizes for different variables in your meta-analyses or to indicate studies that reported effect sizes versus those that only contributed reliability or other artifact values).
@bwiernik: I suppose the number of sources makes a huge difference in the appendix/asterisk debate. Mine is about 30 sources, of which a number are also cited individually anyway. And the APA blog statement that sources in appendixes usually don't get credit for having been cited made a lot of sense to me.
I also agree that the "city" tag is awkward and doesn't lend itself to use cases outside my narrow one (even though most meta-analyses I read restrict themselves to peer-reviewed articles).
keyword didn't work for me, but that might be a mendeley thing (which I am actually using, sorry I didn't mention - in my googling I found this forum much more helpful :) Mendeley stores the keywords in a separate SQL table, I don't know if it even maps to CSL, but Zotero might be different.
The note field is problematic because I use that heavily in other work flows.
With a field that works for most people, adding a style to the repositories could be helpful (unless most people go the appendix route anyways).
Again thanks for your support!
(Any solution is going to be fairly hack-y and there are already too many variations on APA in the repository, so I don’t think they would add something like that in the repository, unless @adamsmith thinks that the annote approach might be added to the main APA style? In any event, I am planning on hosting such a style on my GitHub repo.)
Add
annote: *
to the Note field in Mendeley for the items included in your meta-analysis.{:annote: *}
Amazing, thank you!!! Much better than my publication place hack :)
(for others reading this, background on the curly brackets is here: https://forums.zotero.org/discussion/47132/book-sections-have-dois-too/
Thanks so much for creating this style! However: I seem totally unable to get my zotero to read/accept it. I saved it to my destop where it is recognized as a .csl file that should be opened with zotero by default. Yet, upon double-clicking it, a dialogue box informs me that "/Users/myname/Desktop/apa-meta-analysis.csl" is not a valid style file. When actively importing it in Zotero's style manager, the message thrown is: An unexpected error occurred while installing "/Users/myname/Desktop/apa-meta-analysis.csl". Finally, when copy/pasting the file content into the Style editor, the message is: "Error parsing style:
Error: File is not valid XML".
Any and all ideas on how to fix are welcome!
https://raw.githubusercontent.com/bwiernik/zotero-tools/master/apa-meta-analysis.csl
But alas, no joy (and unless I am very mistaken, this is the exact same file as I tried to install yesterday?).
I'm using zotero for mac v 5.0.55.1. Could that matter in any way?
By now I had figured that the style installing problem was due to the following line:
<summary>APA style, with sources included in a meta-analysis indicated using the CSL 'annote' variable</description>
Making that either summary /summary or description /description fixes the file with respect to importing (although it does ask about being sure to want to import earlier version file... forgot the details but it seems to import ok after telling it to go ahead anyways).
Once imported, the bibliography list is generated according to normal APA 6 rules so that's good - yet I seem unable to get the asterisk thing to work. There are quite a few differences between the "apa-meta-analysis.csl" and the default "apa.csl' file but I figured that this is the crucial one:
<layout>
<text variable="annote" vertical-align="sup" suffix=" "/>
I've tried several potential fixes (most of them involving replacing annote with note - which I think ought to be mapped to the "Extra" field in Zotero and trying a simplified rule
"<text variable="note"/>"
inserted at different locations in the .csl file ) but I am having very little luck so far. Is that also fixed in your solution? If so, I'll stop my attempts and await the fix file - if not: any ideas?annote: *
in the extra field.
If you just want to use * in the Extra field (which I would not recommend for other reasons), indeed using
<text variable="note" vertical-align="sup" suffix=" "/>
would work.annote: *
in Extra with the style as written will yield much more consistent and reliable results.