LaTeX reader: handle \DeclareRobustCommand.

Currently it's just treated as a synonym for `\newcommand`.

Handles the second case mentioned in #3983.
This commit is contained in:
John MacFarlane 2017-10-19 11:50:16 -07:00
parent 9bb8a1f170
commit e941ba05b9

View file

@ -1610,7 +1610,7 @@ isBlockCommand s =
treatAsBlock :: Set.Set Text
treatAsBlock = Set.fromList
[ "let", "def"
[ "let", "def", "DeclareRobustCommand"
, "newcommand", "renewcommand"
, "newenvironment", "renewenvironment"
, "providecommand", "provideenvironment"
@ -1838,7 +1838,8 @@ newcommand = do
pos <- getPosition
Tok _ (CtrlSeq mtype) _ <- controlSeq "newcommand" <|>
controlSeq "renewcommand" <|>
controlSeq "providecommand"
controlSeq "providecommand" <|>
controlSeq "DeclareRobustCommand"
optional $ symbol '*'
Tok _ (CtrlSeq name) txt <- withVerbatimMode $ anyControlSeq <|>
(symbol '{' *> spaces *> anyControlSeq <* spaces <* symbol '}')