git.iko.soy/typeable/pandoc
on master help sign in
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

commit051b7ffeaffdaf34ed1384a239cf0179aa59b932 authorAlbert Krewinkel <albert@zeitkraut.de> dateSat 10 Apr 2021, 10:47 (6 years ago) parent20cd33e
3 files changed+17−12
src/Text/Pandoc/Writers/JATS.hs+1 test/writer.jats_archiving+8−6 test/writer.jats_publishing+8−6
src/Text/Pandoc/Writers/JATS.hs+1
@@ -436,6 +436,7 @@ inlineToJATS opts (Note contents) = do
436436 (n, _):_ -> n + 1
437437 [] -> 1
438438 thenote <- inTags True "fn" [("id", "fn" <> tshow notenum)]
439+ . (inTagsSimple "label" (literal $ tshow notenum) <>)
439440 <$> wrappedBlocksToJATS (not . isPara) opts
440441 (walk demoteHeaderAndRefs contents)
441442 modify $ \st -> st{ jatsNotes = (notenum, thenote) : notes }
test/writer.jats_archiving+8−6
@@ -882,11 +882,12 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
882882<back>
883883<fn-group>
884884 <fn id="fn1">
885− <p>Here is the footnote. It can go anywhere after the footnote reference.
886− It need not be placed at the end of the document.</p>
885+ <label>1</label><p>Here is the footnote. It can go anywhere after the
886+ footnote reference. It need not be placed at the end of the document.</p>
887887 </fn>
888888 <fn id="fn2">
889− <p>Here’s the long note. This one contains multiple blocks.</p>
889+ <label>2</label><p>Here’s the long note. This one contains multiple
890+ blocks.</p>
890891 <p>Subsequent blocks are indented to show that they belong to the footnote
891892 (as with list items).</p>
892893 <p specific-use="wrapper">
@@ -896,16 +897,17 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
896897 just indent the first line of each block.</p>
897898 </fn>
898899 <fn id="fn3">
899− <p>This is <italic>easier</italic> to type. Inline notes may contain
900+ <label>3</label><p>This is <italic>easier</italic> to type. Inline notes
901+ may contain
900902 <ext-link ext-link-type="uri" xlink:href="http://google.com">links</ext-link>
901903 and <monospace>]</monospace> verbatim characters, as well as [bracketed
902904 text].</p>
903905 </fn>
904906 <fn id="fn4">
905− <p>In quote.</p>
907+ <label>4</label><p>In quote.</p>
906908 </fn>
907909 <fn id="fn5">
908− <p>In list.</p>
910+ <label>5</label><p>In list.</p>
909911 </fn>
910912</fn-group>
911913</back>
test/writer.jats_publishing+8−6
@@ -882,11 +882,12 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
882882<back>
883883<fn-group>
884884 <fn id="fn1">
885− <p>Here is the footnote. It can go anywhere after the footnote reference.
886− It need not be placed at the end of the document.</p>
885+ <label>1</label><p>Here is the footnote. It can go anywhere after the
886+ footnote reference. It need not be placed at the end of the document.</p>
887887 </fn>
888888 <fn id="fn2">
889− <p>Here’s the long note. This one contains multiple blocks.</p>
889+ <label>2</label><p>Here’s the long note. This one contains multiple
890+ blocks.</p>
890891 <p>Subsequent blocks are indented to show that they belong to the footnote
891892 (as with list items).</p>
892893 <p specific-use="wrapper">
@@ -896,16 +897,17 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
896897 just indent the first line of each block.</p>
897898 </fn>
898899 <fn id="fn3">
899− <p>This is <italic>easier</italic> to type. Inline notes may contain
900+ <label>3</label><p>This is <italic>easier</italic> to type. Inline notes
901+ may contain
900902 <ext-link ext-link-type="uri" xlink:href="http://google.com">links</ext-link>
901903 and <monospace>]</monospace> verbatim characters, as well as [bracketed
902904 text].</p>
903905 </fn>
904906 <fn id="fn4">
905− <p>In quote.</p>
907+ <label>4</label><p>In quote.</p>
906908 </fn>
907909 <fn id="fn5">
908− <p>In list.</p>
910+ <label>5</label><p>In list.</p>
909911 </fn>
910912</fn-group>
911913</back>