diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-10-19 11:50:16 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-10-19 11:50:16 -0700 |
commit | e941ba05b911d01a51614b0b0060f705b2000688 (patch) | |
tree | 65267f3b1540fbdccdc30f34fc91421eb3374e08 /src/Text | |
parent | 9bb8a1f1707a7bd240af07ad41d74dbcc9dee181 (diff) | |
download | pandoc-e941ba05b911d01a51614b0b0060f705b2000688.tar.gz |
LaTeX reader: handle `\DeclareRobustCommand`.
Currently it's just treated as a synonym for `\newcommand`.
Handles the second case mentioned in #3983.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 5 |
1 files 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 '}') |