aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-19 11:50:16 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-19 11:50:16 -0700
commite941ba05b911d01a51614b0b0060f705b2000688 (patch)
tree65267f3b1540fbdccdc30f34fc91421eb3374e08
parent9bb8a1f1707a7bd240af07ad41d74dbcc9dee181 (diff)
downloadpandoc-e941ba05b911d01a51614b0b0060f705b2000688.tar.gz
LaTeX reader: handle `\DeclareRobustCommand`.
Currently it's just treated as a synonym for `\newcommand`. Handles the second case mentioned in #3983.
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs5
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 '}')