Hi Albert,
Claudio Di Vita <claudio...@gmail.com> writes:
> Confirmed: when tex_math_dollars is disabled pandoc doesn't create
> Math elements, while under the same conditions (inheriting
> PANDOC_READER_OPTIONS) pandoc.read create Math elements for the same
> document.
That's a problem in the docs: it should be noted more clearly that the
format extensions are taken from the format, not from the ReaderOptions.
Try with
pandoc.read('$2^a$', 'markdown-tex_math_dollars')
or (with pandoc 3)
md = {
format = 'markdown',
extensions = {tex_math_dollars = 'disable'}
}
pandoc.read('$a$', md)
> Il giorno martedì 17 gennaio 2023 alle 09:58:14 UTC+1 Claudio Di Vita
> ha scritto:
>
> Hi folks,
>
> reading the documentation, with the extension tex_math_dollars
> enabled (that's the default) anything between two $ (or two $$)
> characters will be treated as TeX math.
>
> However, I think that when such extension is enabled, the
> document parsing, including the metadata, is a bit inaccurate,
> because also strings like ${value1}/${value2} are treated like
> TeX math.
>
> Of course disabling the extension or escaping the $ characters
> there are no issues, but it would be nice to avoid that, if
> possible.
>
> Any idea of what can be the wrong parsing cause ?
>
> Cheers,
>
> Claudio
--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124