@@ -868,14 +868,17 @@ emDashOld = do
868-- | Parse a \newcommand or \renewcommand macro definition.
868-- | Parse a \newcommand or \renewcommand macro definition.
869macro :: GenParser Char ParserState Block
869macro :: GenParser Char ParserState Block
870macro = do
870macro = do
871− getState >>= guard . stateApplyMacros
871+ apply <- stateApplyMacros `fmap` getState
872 inp <- getInput
872 inp <- getInput
873 case parseMacroDefinitions inp of
873 case parseMacroDefinitions inp of
874 ([], _) -> pzero
874 ([], _) -> pzero
875− (ms, rest) -> do count (length inp - length rest) anyChar
875+ (ms, rest) -> do def <- count (length inp - length rest) anyChar
876− updateState $ \st ->
878+ updateState $ \st ->
877− st { stateMacros = ms ++ stateMacros st }
879+ st { stateMacros = ms ++ stateMacros st }
878− return Null
880+ return Null
881+ else return $ RawBlock "latex" def
880-- | Apply current macros to string.
883-- | Apply current macros to string.
881applyMacros' :: String -> GenParser Char ParserState String
884applyMacros' :: String -> GenParser Char ParserState String