Pandoc filters, templates, and wrapper scripts for converting genome note Markdown files to docx, pdf and JATS-XML files.
- Pandoc 3.x
- pandoc-crossref
- panflute (
pip install panflute) - XeLaTeX (for PDF output)
All scripts take the input .md file as the first argument and derive the
output filename automatically. An explicit output path can be given as a
second argument.
# PDF via XeLaTeX
bin/gn-pdf ilActPoly1.md
# DOCX for review (figures and tables inline)
bin/gn-docx-review ilActPoly1.md
# DOCX for submission (figures and tables at end)
bin/gn-docx-sub ilActPoly1.md
# JATS XML for Wellcome Open Research
bin/gn-jats ilActPoly1.mdFilter order matters and must not be changed.
JATS pipeline:
normalize_pandoc_inputs.lua— rewrites BibTeX italic markers; promotes table IDspandoc-crossref— resolves@fig:/@tbl:cross-referencesfix-figtbl-xref.py— converts figure/table elements to raw JATS blocks--citeproc— processes citations using BibTeX input and CSL- JATS writer using Pandoc and an XML template
postprocess-jats.py— sorts references, adds punctuation, restores italics
DOCX submission pipeline:
inject_frontmatter.lua— injects styled author/affiliation/grant blockpandoc-crossrefextract_figs_tables.lua— moves figures and tables after references--citeproc
DOCX review pipeline: same as submission but without extract_figs_tables.lua.
PDF pipeline: pandoc-crossref → --citeproc → XeLaTeX.
bin/ wrapper scripts (gn-pdf, gn-docx-review, gn-docx-sub, gn-jats)
filters/ Lua and Python Pandoc filters
templates/ LaTeX template, JATS-XML template, DOCX reference doc, CSL, fonts