Skip to content

feat(ui): adds label for citation as requested

Dan Visel requested to merge citation-labeling into main

This is a fix for #1101 (closed) – it adds a new tag to the Citations panel of the production menu. What this does is allow the user to tag a number as a label for the citation, e.g.:

1. Visel, Dan. Paper Title. 2022

The 1 would be wrapped in this tag. What then comes out in JATS is this:

<ref id="ref1">
  <label>1</label>
  <mixed-citation>1. Visel, Dan...</mixed-citation>
</ref>

If there are more than one citation labels in a citation, only the first one is used; the others are ignored and just passed through as regular text.

This does not take the 1 out of the mixed citation – it leaves it untagged in there. The reason for this is that you could end up with situations like this:

<ref id="ref1">
  <label>1</label>
  <mixed-citation>. Visel, Dan...</mixed-citation>
</ref>

where the . wasn't part of the label and so it's orphaned. (You could put 1. or even 1. as the label.)

In the interface, this is being called "Citation label" because this is called a "label" in JATS ("label" is a generic tag in JATS – though it's not the same at the HTML one, which might cause us issues in the future.) We could call this "Citation number", though this can contain any string, or something like "1a".

Merge request reports