Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--reference-section-title does not work with --to=jats+element_citations #9021

Closed
castedo opened this issue Aug 24, 2023 · 1 comment
Closed
Labels

Comments

@castedo
Copy link
Contributor

castedo commented Aug 24, 2023

REPO STEPS:

With input-with-heading.md

pandoc -t jats+element_citations --citeproc -s --metadata reference-section-title=References input-with-heading.md

GOT:

...
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
...
<back>
<ref-list>
  <ref id="ref-degroot_probability">
    <element-citation>
      <person-group person-group-type="author">
        <string-name>DeGroot</string-name>
      </person-group>
      <article-title>Probability</article-title>
      <year iso-8601-date="2002">2002</year>
    </element-citation>
  </ref>
</ref-list>
</back>
</article>

EXPECTED:

...
<ref-list>
  <title>References</title>
  <ref id="ref-degroot_probability">
...

...
which is the output when -t jats is the output type rather than -t jats+element_citations.

Pandoc version

$ pandoc --version
pandoc 3.1.6.2-nightly-2023-08-24
...
@castedo
Copy link
Contributor Author

castedo commented Oct 26, 2023

@jgm I currently have a gross work around to this issue:

https://gitlab.com/castedo/basecast/-/blob/690ed5bf5ab417cf229a06512eeea360b77fdc20/basecast/out.py#L28

 if not re.search(b"<ref-list>\s*<title ", xml):
    xml = xml.replace(b"<ref-list>", b"<ref-list>\n  <title>References</title>")

in a tool that I am planning to start evangelizing more broadly soon:

https://try.perm.pub/basecast/

The conversion of source files into the baseprint [1] output is almost entirely handled by pandoc, except for the above gross work around.

I'm not 100% sure that this tool should output element_citations. But I do this because pandoc can not read mixed_citations.

At least in the medium-term, if this issue is fixed then conversion of source files into a baseprint [1] can be handled more elegantly with just pandoc.

Not a big deal, but if it's easy to fix, I thought you might want to be aware.

[1] https://baseprints.singlesource.pub/

@jgm jgm closed this as completed in 5ed86e6 Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant