@@ -698,11 +698,9 @@ data ParserState = ParserState
698 stateAuthors :: [[Inline]], -- ^ Authors of document
698 stateAuthors :: [[Inline]], -- ^ Authors of document
699 stateDate :: [Inline], -- ^ Date of document
699 stateDate :: [Inline], -- ^ Date of document
700 stateHeaderTable :: [HeaderType], -- ^ Ordered list of header types used
700 stateHeaderTable :: [HeaderType], -- ^ Ordered list of header types used
701− stateIndentedCodeClasses :: [String], -- ^ Classes to use for indented code blocks
702 stateNextExample :: Int, -- ^ Number of next example
701 stateNextExample :: Int, -- ^ Number of next example
703 stateExamples :: M.Map String Int, -- ^ Map from example labels to numbers
702 stateExamples :: M.Map String Int, -- ^ Map from example labels to numbers
704 stateHasChapters :: Bool, -- ^ True if \chapter encountered
703 stateHasChapters :: Bool, -- ^ True if \chapter encountered
705− stateApplyMacros :: Bool, -- ^ Apply LaTeX macros?
706 stateMacros :: [Macro], -- ^ List of macros defined so far
704 stateMacros :: [Macro], -- ^ List of macros defined so far
707 stateRstDefaultRole :: String -- ^ Current rST default interpreted text role
705 stateRstDefaultRole :: String -- ^ Current rST default interpreted text role
@@ -724,11 +722,9 @@ defaultParserState =
724 stateAuthors = [],
722 stateAuthors = [],
725 stateDate = [],
723 stateDate = [],
726 stateHeaderTable = [],
724 stateHeaderTable = [],
727− stateIndentedCodeClasses = [],
728 stateNextExample = 1,
725 stateNextExample = 1,
729 stateExamples = M.empty,
726 stateExamples = M.empty,
730 stateHasChapters = False,
727 stateHasChapters = False,
731− stateApplyMacros = True,
732 stateMacros = [],
728 stateMacros = [],
733 stateRstDefaultRole = "title-reference"}
729 stateRstDefaultRole = "title-reference"}
@@ -916,7 +912,7 @@ emDashOld = do
916-- | Parse a \newcommand or \renewcommand macro definition.
912-- | Parse a \newcommand or \renewcommand macro definition.
917macro :: Parsec [Char] ParserState Block
913macro :: Parsec [Char] ParserState Block
918macro = do
914macro = do
919− apply <- stateApplyMacros `fmap` getState
915+ apply <- getOption readerApplyMacros
920 inp <- getInput
916 inp <- getInput
921 case parseMacroDefinitions inp of
917 case parseMacroDefinitions inp of
922 ([], _) -> mzero
918 ([], _) -> mzero
@@ -931,7 +927,7 @@ macro = do
931-- | Apply current macros to string.
927-- | Apply current macros to string.
932applyMacros' :: String -> Parsec [Char] ParserState String
928applyMacros' :: String -> Parsec [Char] ParserState String
933applyMacros' target = do
929applyMacros' target = do
934− apply <- liftM stateApplyMacros getState
930+ apply <- getOption readerApplyMacros
936 then do macros <- liftM stateMacros getState
932 then do macros <- liftM stateMacros getState
937 return $ applyMacros macros target
933 return $ applyMacros macros target