@@ -42,6 +42,7 @@ import Text.Pandoc.Parsing hiding ( F, unF, askF, asksF, runF
42import Text.Pandoc.Readers.LaTeX (inlineCommand, rawLaTeXInline)
42import Text.Pandoc.Readers.LaTeX (inlineCommand, rawLaTeXInline)
43import Text.Pandoc.Shared (compactify', compactify'DL)
43import Text.Pandoc.Shared (compactify', compactify'DL)
44import Text.TeXMath (readTeX, writePandoc, DisplayType(..))
44import Text.TeXMath (readTeX, writePandoc, DisplayType(..))
45+import qualified Text.TeXMath.Readers.MathML.EntityMap as MathMLEntityMap
46import Control.Applicative ( Applicative, pure
47import Control.Applicative ( Applicative, pure
47 , (<$>), (<$), (<*>), (<*), (*>) )
48 , (<$>), (<$), (<*>), (<*), (*>) )
@@ -1431,7 +1432,8 @@ simpleSubOrSuperString = try $
1431inlineLaTeX :: OrgParser (F Inlines)
1432inlineLaTeX :: OrgParser (F Inlines)
1432inlineLaTeX = try $ do
1433inlineLaTeX = try $ do
1433 cmd <- inlineLaTeXCommand
1434 cmd <- inlineLaTeXCommand
1435+ maybe mzero returnF $
1434− maybe mzero returnF $ parseAsMath cmd `mplus` parseAsInlineLaTeX cmd
1436+ parseAsMath cmd `mplus` parseAsMathMLSym cmd `mplus` parseAsInlineLaTeX cmd
1436 parseAsMath :: String -> Maybe Inlines
1438 parseAsMath :: String -> Maybe Inlines
1437 parseAsMath cs = B.fromList <$> texMathToPandoc cs
1439 parseAsMath cs = B.fromList <$> texMathToPandoc cs
@@ -1439,6 +1441,11 @@ inlineLaTeX = try $ do
1439 parseAsInlineLaTeX :: String -> Maybe Inlines
1441 parseAsInlineLaTeX :: String -> Maybe Inlines
1440 parseAsInlineLaTeX cs = maybeRight $ runParser inlineCommand state "" cs
1442 parseAsInlineLaTeX cs = maybeRight $ runParser inlineCommand state "" cs
1444+ parseAsMathMLSym :: String -> Maybe Inlines
1445+ parseAsMathMLSym cs = B.str <$> MathMLEntityMap.getUnicode (clean cs)
1446+ -- dropWhileEnd would be nice here, but it's not available before base 4.5
1447+ where clean = reverse . dropWhile (`elem` "{}") . reverse . drop 1
1442 state :: ParserState
1449 state :: ParserState
1443 state = def{ stateOptions = def{ readerParseRaw = True }}
1450 state = def{ stateOptions = def{ readerParseRaw = True }}