lierdakil / pandoc-crossref

Pandoc filter for cross-references
https://lierdakil.github.io/pandoc-crossref/
GNU General Public License v2.0
909 stars 73 forks source link

Double figure captions in typst output #442

Open SwiftSeal opened 2 weeks ago

SwiftSeal commented 2 weeks ago

Hello!

Original issue with details is here: https://github.com/jgm/pandoc/issues/9888

When generating typst documents, the figure caption is duplicated. This doesn't occur for word or latex output.

lierdakil commented 2 weeks ago

So basically pandoc-crossref inserts its numbers, and then typst inserts its own on top of those. It's similar to LaTeX in that sense. There's a lot of special-casing for LaTeX output, and it lacks some features, and I'm not too keen on adding the same for typst (not least because I don't use it and have no idea how it works).

You have two options:

  1. Tell typst to skip any special handling of item titles. No idea how to do that, but it's possible in LaTeX, so I assume there is a way in typst, too.
  2. Write a simple LUA filter to convert certain citations to the format typst expects and not use pandoc-crossref at all.

Since typst has its own support for numbering, if you intend to share this with someone and/or edit it after the fact, the latter option is likely what you want. If you're going to pursue that, see also https://github.com/lierdakil/pandoc-crossref/issues/431.