diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-11-16 20:24:34 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-11-16 20:24:34 -0800 |
commit | f096f032f0d210142d4f6de87354df65598cdafb (patch) | |
tree | 31cd03c5c6067ac6089349e175db6931d425e600 /src | |
parent | 46ff0e988a204b5191f47855d870db06d8e465ad (diff) | |
download | pandoc-f096f032f0d210142d4f6de87354df65598cdafb.tar.gz |
ICML writer: better handling of math.
Instead of just printing the raw tex, we now try to fake
it with unicode characters.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/ICML.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs index ae068a94f..95ea0c643 100644 --- a/src/Text/Pandoc/Writers/ICML.hs +++ b/src/Text/Pandoc/Writers/ICML.hs @@ -16,6 +16,7 @@ into InDesign with File -> Place. module Text.Pandoc.Writers.ICML (writeICML) where import Text.Pandoc.Definition import Text.Pandoc.XML +import Text.Pandoc.Readers.TeXMath (texMathToInlines) import Text.Pandoc.Writers.Shared import Text.Pandoc.Shared (splitBy) import Text.Pandoc.Options @@ -410,7 +411,8 @@ inlineToICML opts style (Cite _ lst) = inlinesToICML opts style lst inlineToICML _ style (Code _ str) = charStyle (codeName:style) $ text $ escapeStringForXML str inlineToICML _ style Space = charStyle style space inlineToICML _ style LineBreak = charStyle style $ text lineSeparator -inlineToICML _ style (Math _ str) = charStyle style $ text $ escapeStringForXML str --InDesign doesn't really do math +inlineToICML opts style (Math mt str) = + cat <$> mapM (inlineToICML opts style) (texMathToInlines mt str) inlineToICML _ _ (RawInline f str) | f == Format "icml" = return $ text str | otherwise = return empty |