From d1832da9e104d61aa6ee0161aefeabf4aef9bbd2 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 2 Dec 2007 00:36:32 +0000 Subject: Added Text.Pandoc.Readers.TeXMath and changed default handling of math. + Text.Pandoc.Readers.TeXMath exports readTeXMath, which reads raw TeX math and outputs a string of pandoc inlines that tries to render it as far as possible, lapsing into literal TeX when needed. + Added Text.Pandoc.Readers.TeXMath to pandoc.cabal + ghc66 version. + Modified writers so that readTeXMath is used for default HTMl output in HTML, S5, RTF, Docbook. + Updated README with information about how math is rendered in all formats. + Updated test suite. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1129 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Writers/Docbook.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Text/Pandoc/Writers/Docbook.hs') diff --git a/Text/Pandoc/Writers/Docbook.hs b/Text/Pandoc/Writers/Docbook.hs index 2cad0ca39..f0fde18a4 100644 --- a/Text/Pandoc/Writers/Docbook.hs +++ b/Text/Pandoc/Writers/Docbook.hs @@ -30,6 +30,7 @@ Conversion of 'Pandoc' documents to Docbook XML. module Text.Pandoc.Writers.Docbook ( writeDocbook) where import Text.Pandoc.Definition import Text.Pandoc.Shared +import Text.Pandoc.Readers.TeXMath import Data.List ( isPrefixOf, drop ) import Text.PrettyPrint.HughesPJ hiding ( Str ) @@ -274,7 +275,7 @@ inlineToDocbook opts EmDash = text "—" inlineToDocbook opts EnDash = text "–" inlineToDocbook opts (Code str) = inTagsSimple "literal" $ text (escapeStringForXML str) -inlineToDocbook opts (Math str) = inlineToDocbook opts (Code str) +inlineToDocbook opts (Math str) = inlinesToDocbook opts $ readTeXMath str inlineToDocbook opts (TeX str) = empty inlineToDocbook opts (HtmlInline str) = empty inlineToDocbook opts LineBreak = text $ "" -- cgit v1.2.3