pandoc-latex-environment icon indicating copy to clipboard operation
pandoc-latex-environment copied to clipboard

Metadata not working in a defaults file (including workaround)

Open gabindu opened this issue 3 years ago • 1 comments

It turns out that when writing the metadata into a defaults.yaml file, the data is encoded in a slightly different way, causing the filter to mix up the environment definitions.

After investigating, I've come to the conclusion that this is due to pandoc's stringify function not working for MetaString objects. (When the metadata is defined in the document header, these turn out to be MetaInline objects, which stringify correctly converts.)

I've reported the issue upstream at https://github.com/jgm/pandoc/issues/7149, and I've written a small (temporary) workaround (which I've posted as pull request #13).

gabindu avatar Mar 15 '21 00:03 gabindu

After more investigation upstream, it turns out that the issue is not actually MetaString or stringify, but rather the different overall structure of the metadata returned by pandoc in the two different situations (a list of MetaInlines with a list of one Str object each, versus a list of MetaString objects with just a string as content each). As such, I'm not sure if this will change upstream in the near future (or at all), so the "temporary" workaround might very well be necessary longterm...

gabindu avatar Mar 16 '21 15:03 gabindu