JATS writer: add footnote number as label in backmatter

Footnotes in the backmatter are given the footnote's number as a label.
The articleauthoring output is unaffected from this change, as footnotes
are placed inline there.

Closes: #7210
This commit is contained in:
Albert Krewinkel 2021-04-10 10:47:10 +02:00
parent 20cd33e5a4
commit 051b7ffeaf
No known key found for this signature in database
GPG key ID: 388DC0B21F631124
3 changed files with 17 additions and 12 deletions

View file

@ -436,6 +436,7 @@ inlineToJATS opts (Note contents) = do
(n, _):_ -> n + 1
[] -> 1
thenote <- inTags True "fn" [("id", "fn" <> tshow notenum)]
. (inTagsSimple "label" (literal $ tshow notenum) <>)
<$> wrappedBlocksToJATS (not . isPara) opts
(walk demoteHeaderAndRefs contents)
modify $ \st -> st{ jatsNotes = (notenum, thenote) : notes }

View file

@ -882,11 +882,12 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
<back>
<fn-group>
<fn id="fn1">
<p>Here is the footnote. It can go anywhere after the footnote reference.
It need not be placed at the end of the document.</p>
<label>1</label><p>Here is the footnote. It can go anywhere after the
footnote reference. It need not be placed at the end of the document.</p>
</fn>
<fn id="fn2">
<p>Heres the long note. This one contains multiple blocks.</p>
<label>2</label><p>Heres the long note. This one contains multiple
blocks.</p>
<p>Subsequent blocks are indented to show that they belong to the footnote
(as with list items).</p>
<p specific-use="wrapper">
@ -896,16 +897,17 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
just indent the first line of each block.</p>
</fn>
<fn id="fn3">
<p>This is <italic>easier</italic> to type. Inline notes may contain
<label>3</label><p>This is <italic>easier</italic> to type. Inline notes
may contain
<ext-link ext-link-type="uri" xlink:href="http://google.com">links</ext-link>
and <monospace>]</monospace> verbatim characters, as well as [bracketed
text].</p>
</fn>
<fn id="fn4">
<p>In quote.</p>
<label>4</label><p>In quote.</p>
</fn>
<fn id="fn5">
<p>In list.</p>
<label>5</label><p>In list.</p>
</fn>
</fn-group>
</back>

View file

@ -882,11 +882,12 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
<back>
<fn-group>
<fn id="fn1">
<p>Here is the footnote. It can go anywhere after the footnote reference.
It need not be placed at the end of the document.</p>
<label>1</label><p>Here is the footnote. It can go anywhere after the
footnote reference. It need not be placed at the end of the document.</p>
</fn>
<fn id="fn2">
<p>Heres the long note. This one contains multiple blocks.</p>
<label>2</label><p>Heres the long note. This one contains multiple
blocks.</p>
<p>Subsequent blocks are indented to show that they belong to the footnote
(as with list items).</p>
<p specific-use="wrapper">
@ -896,16 +897,17 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
just indent the first line of each block.</p>
</fn>
<fn id="fn3">
<p>This is <italic>easier</italic> to type. Inline notes may contain
<label>3</label><p>This is <italic>easier</italic> to type. Inline notes
may contain
<ext-link ext-link-type="uri" xlink:href="http://google.com">links</ext-link>
and <monospace>]</monospace> verbatim characters, as well as [bracketed
text].</p>
</fn>
<fn id="fn4">
<p>In quote.</p>
<label>4</label><p>In quote.</p>
</fn>
<fn id="fn5">
<p>In list.</p>
<label>5</label><p>In list.</p>
</fn>
</fn-group>
</back>