From e941ba05b911d01a51614b0b0060f705b2000688 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 19 Oct 2017 11:50:16 -0700 Subject: LaTeX reader: handle `\DeclareRobustCommand`. Currently it's just treated as a synonym for `\newcommand`. Handles the second case mentioned in #3983. --- src/Text/Pandoc/Readers/LaTeX.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index b3c637748..089d3d741 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -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 '}') -- cgit v1.2.3