spec: Add language to handle nocite and noref cases
please see citation-style-language/test-suite#28
Cross-posted from the other thread:
Related issue: https://github.com/citation-style-language/documentation/issues/74
I think we would need to handle three cases:
nocite: uncited items that are included in the bibliography (this is pandoc'snociteor if a user used Zotero's Edit Bibliography function to add an uncited item to the bibliography)- "noref": cited items that are excluded from the bibliography using a conditional (this case). This should be allowed as many styles require it.
- "citation with no visible form": A cited item for which the citation (not bibliography) is empty. This should return an error. An item appearing in a citation must have some visible output or it can lead to problematic behavior for users, especially for word processor-based applications. This is different from
nocite.
I think this is all documentation-related clarity and could be handled in 1.0.2. Every processor already has a nocite functionality in it.
Sounds good. One remaining question for me is what we do with the example in the linked test: If you have no-ref in the bibliography for a numeric styles, what's the desired behavior?
I'm pretty sure rendering
- Reference
- Reference isn't great (which is why I think the test exists)
One remaining question for me is what we do with the example in the linked test: If you have no-ref in the bibliography for a numeric styles, what's the desired behavior?
No output in bib, but a number in the text for the citation?
No-ref wouldn't be appropriate for numeric styles; would it?
That's a good point. We discussed that issue here: https://github.com/citation-style-language/styles/pull/3005
(@adam3smith I assume that your numbered list was supposed to go 1. then 3., but markdown "fixed" that for you?)
There is a need to be able to cite noref items in numeric styles. A lot of physical science journals with numeric styles require that unpublished data and personal communications be cited parenthetically in text, with no number and no entry in the bibliography. The items in the bibliography should not skip numbers.
What about introducing a variable omit-citation-number that excludes the item from the citation numbering? For example:
<citation>
<layout>
<choose>
<if type="personal_communication">
<text variable="omit-citation-number"/>
<group prefix="(" suffix=")" delimiter=" "/>
<text macro="author-short"/>
<text macro="date-short"/>
</group>
</if>
<else>
<text variable="citation-number"/>
</else>
</choose>
</layout>
</citation>
The citation-number variable is then treated as empty for personal_communication items, and they are skipped when assigning numbers to other items.
(Just spitballing here.)
Or perhaps more simply, if an item has no printed form in the bibliography, it automatically isn't assigned a citation-number?
Strawman start of spec language:
- All cited items must result in citation and/or bibliographic output.
- Styles or users may specify that individual items or categories of items have alternate and/or more limited output than the default rules; for example, that are included in the bibliography but not cited (
no-cite), or cited but not listed in the bibliography (no-ref). - If an item is omitted from the bibliography, it shall not be assigned a
citation-number.
What about note styles though?
Also, I still think the second point connects to #71.
My suggestion
- All cited items must result in citation output. A cited item producing no citation output shall result in an exception.
- Uncited items may be added to the bibliography by providing a
nocitearray of itemids to the processor. (Wording help needed. This is essentially what citeproc-js and pandoc-citeproc do.) - Cited items may or may not result in bibliography output. Cited items may be removed from a bibliography using
chooseelements in a style or by providing anorefarray of itemids to the processor. - Cited items that produce no bibliography output shall not be assigned a
citation-number.
I'm not sure what your thinking about notes is? I think point 1 applies just as well--an item must include output in a note in a note style, otherwise there would be an empty footnote.
I don't understand what your current thinking is regarding #71.
I don't understand what your current thinking is regarding #71.
I'm still clarifying myself, which is why I've been vague, but here's a stab at an explanation.
High-Level
Both these cases and multi-section bibs involve:
- formatting exceptions based on some kind of categorization
- these categorizations are a mix of general rules that are defined in styles, and more idiosyncratic ones specific to users
Lower-Level
Both will need a mix of style-based configuration (setting up groups of references based, say, on author, or type), and user-based intervention.
On the latter, for no-cite, a user needs to be able to tag or label a reference as such. Same for multi-section bibs.
Though writing this, it occurs to me I'm a little uncertain whether the above configuration is of the reference (as I wrote), or the citation.
If in latex, I do this:
One sentence \cite{doe19}. Another sentence \nocite{doe19}.
... what happens? It'd be odd to print the first citation, it seems to me, but that's what the code suggests.