AsciiDoc Writer: DisplayMath as asciidoc latexmath block

This commit is contained in:
TG 2019-01-10 17:21:01 +01:00 committed by John MacFarlane
parent b8eeb0f4da
commit 8fdeae2872
3 changed files with 10 additions and 3 deletions

View file

@ -3513,7 +3513,7 @@ reStructuredText
~ It will be rendered using an [interpreted text role `:math:`].
AsciiDoc
~ It will be rendered as `latexmath:[...]`.
~ It will be rendered as `latexmath:[...]` when inline and `[latexmath]++++....++++` when in display mode.
Texinfo
~ It will be rendered inside a `@math` command.

View file

@ -414,7 +414,10 @@ inlineToAsciiDoc _ (Str str) = return $ text $ escapeString str
inlineToAsciiDoc _ (Math InlineMath str) =
return $ "latexmath:[$" <> text str <> "$]"
inlineToAsciiDoc _ (Math DisplayMath str) =
return $ "latexmath:[\\[" <> text str <> "\\]]"
return $
blankline <> "[latexmath]" $$ "++++" $$
"\\[" <> text str <> "\\]"
$$ "++++" $$ blankline
inlineToAsciiDoc _ il@(RawInline f s)
| f == "asciidoc" = return $ text s
| otherwise = do

View file

@ -466,7 +466,11 @@ Ellipses…and…and….
* latexmath:[$223$]
* latexmath:[$p$]-Tree
* Heres some display math:
latexmath:[\[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]]
[latexmath]
++++
\[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
++++
* Heres one that has a line break in it:
latexmath:[$\alpha + \omega \times x^2$].