git.iko.soy/typeable/pandoc
on master help sign in
AsciiDoc Writer: DisplayMath as asciidoc latexmath block
commit8fdeae2872d76e0d6cd996d595aa22d259074a91 authorTG <tarik.graba@telecom-paristech.fr> dateThu 10 Jan 2019, 17:21 (8 years ago) parentb8eeb0f
3 files changed+10−3
MANUAL.txt+1−1 src/Text/Pandoc/Writers/AsciiDoc.hs+4−1 test/writer.asciidoc+5−1
MANUAL.txt+1−1
@@ -3513,7 +3513,7 @@ reStructuredText
35133513 ~ It will be rendered using an [interpreted text role `:math:`].
35143514
35153515AsciiDoc
3516− ~ It will be rendered as `latexmath:[...]`.
3516+ ~ It will be rendered as `latexmath:[...]` when inline and `[latexmath]++++....++++` when in display mode.
35173517
35183518Texinfo
35193519 ~ It will be rendered inside a `@math` command.
src/Text/Pandoc/Writers/AsciiDoc.hs+4−1
@@ -414,7 +414,10 @@ inlineToAsciiDoc _ (Str str) = return $ text $ escapeString str
414414inlineToAsciiDoc _ (Math InlineMath str) =
415415 return $ "latexmath:[$" <> text str <> "$]"
416416inlineToAsciiDoc _ (Math DisplayMath str) =
417− return $ "latexmath:[\\[" <> text str <> "\\]]"
417+ return $
418+ blankline <> "[latexmath]" $$ "++++" $$
419+ "\\[" <> text str <> "\\]"
420+ $$ "++++" $$ blankline
418421inlineToAsciiDoc _ il@(RawInline f s)
419422 | f == "asciidoc" = return $ text s
420423 | otherwise = do
test/writer.asciidoc+5−1
@@ -466,7 +466,11 @@ Ellipses…and…and….
466466* latexmath:[$223$]
467467* latexmath:[$p$]-Tree
468468* Here’s some display math:
469−latexmath:[\[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]]
469+
470+[latexmath]
471+++++
472+\[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
473+++++
470474* Here’s one that has a line break in it:
471475latexmath:[$\alpha + \omega \times x^2$].
472476