LaTeX reader: use applyMacros in rawLaTeXBlock, rawLaTeXInline.
This commit is contained in:
parent
9daf22fa61
commit
3679d8d0bd
1 changed files with 5 additions and 2 deletions
|
@ -270,13 +270,16 @@ rawLaTeXBlock :: (PandocMonad m, HasMacros s, HasReaderOptions s)
|
|||
=> ParserT String s m String
|
||||
rawLaTeXBlock = do
|
||||
lookAhead (try (char '\\' >> letter))
|
||||
snd <$> rawLaTeXParser (environment <|> macroDef <|> blockCommand)
|
||||
-- we don't want to apply newly defined latex macros to their own
|
||||
-- definitions:
|
||||
(snd <$> rawLaTeXParser macroDef) <|>
|
||||
((snd <$> rawLaTeXParser (environment <|> blockCommand)) >>= applyMacros)
|
||||
|
||||
rawLaTeXInline :: (PandocMonad m, HasMacros s, HasReaderOptions s)
|
||||
=> ParserT String s m String
|
||||
rawLaTeXInline = do
|
||||
lookAhead (try (char '\\' >> letter) <|> char '$')
|
||||
snd <$> rawLaTeXParser (inlineEnvironment <|> inlineCommand')
|
||||
rawLaTeXParser (inlineEnvironment <|> inlineCommand') >>= applyMacros . snd
|
||||
|
||||
inlineCommand :: PandocMonad m => ParserT String ParserState m Inlines
|
||||
inlineCommand = do
|
||||
|
|
Loading…
Add table
Reference in a new issue