@@ -41,7 +41,7 @@ import Text.Pandoc.Parsing hiding ( F, unF, askF, asksF, runF
4141 )
4242import Text.Pandoc.Readers.LaTeX (inlineCommand, rawLaTeXInline)
4343import Text.Pandoc.Shared (compactify', compactify'DL)
44−import Text.TeXMath (texMathToPandoc, DisplayType(..))
44+import Text.TeXMath (readTeX, writePandoc, DisplayType(..))
4545
4646import Control.Applicative ( Applicative, pure
4747 , (<$>), (<$), (<*>), (<*), (*>) )
@@ -1383,7 +1383,7 @@ inlineLaTeX = try $ do
13831383 maybe mzero returnF $ parseAsMath cmd `mplus` parseAsInlineLaTeX cmd
13841384 where
13851385 parseAsMath :: String -> Maybe Inlines
1386− parseAsMath cs = maybeRight $ B.fromList <$> texMathToPandoc DisplayInline cs
1386+ parseAsMath cs = B.fromList <$> texMathToPandoc cs
13871387
13881388 parseAsInlineLaTeX :: String -> Maybe Inlines
13891389 parseAsInlineLaTeX cs = maybeRight $ runParser inlineCommand state "" cs
@@ -1391,6 +1391,9 @@ inlineLaTeX = try $ do
13911391 state :: ParserState
13921392 state = def{ stateOptions = def{ readerParseRaw = True }}
13931393
1394+ texMathToPandoc inp = (maybeRight $ readTeX inp) >>=
1395+ writePandoc DisplayInline
1396+
13941397maybeRight :: Either a b -> Maybe b
13951398maybeRight = either (const Nothing) Just
13961399