pandoc escapes latex in docbook source #2422
everflux
commented
pandoc expects math in DocBook to be in MathML (since that's
actually a supported math format in DocBook).
It looks like asciidoc produces DocBook as follows (for input
with `$x=f^2$`):
```
<simpara><inlineequation>
<alt><![CDATA[$x=f^2$]]></alt>
<inlinemediaobject><textobject><phrase></phrase></textobject></inlinemediaobject>
</inlineequation></simpara>
```
So, only the `alt` element contains anything. I suppose we could
change the DocBook reader so that it expects raw TeX from the `alt`
element if there is no MathML... Relevant code is `equation` on
line 981 of `src/Text/Pandoc/Readers/DocBook.hs`.
+++ Thomas [Sep 27 15 10:59 ]:
…
everflux
commented
Actually I tried to trick pandoc by not using mathlatex in asciidoc, but plain latex which is retained in docbook:
<simpara>lambda $1+ \lambda$</simpara>
But this gets escaped by pandoc when generating the latex source for the output.
When using mathlatex in asciidoc it seems to be rendered as an image which is then not found by latex called by pandoc.
jgm
closed this
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an asciidoc document that contains latex symbols and formulas.
Since pandoc does not support asciidoc input I export the asciidoc to docbook xml and use that as source for pandoc. This works good so far, except that I can not get latex formulas working.
I tried tex_raw, tex_math_dollars, but pandoc always escapes the formula like
expected was
Is this a bug or is there a way to get pandoc accept latex formulas inside docook?