@@ -1308,13 +1308,7 @@ isBlockCommand s =
1309treatAsBlock :: Set.Set Text
1309treatAsBlock :: Set.Set Text
1310treatAsBlock = Set.fromList
1310treatAsBlock = Set.fromList
1311− [ "let", "def", "DeclareRobustCommand"
1312− , "newcommand", "renewcommand"
1313− , "newenvironment", "renewenvironment"
1314− , "providecommand", "provideenvironment"
1315− -- newcommand, etc. should be parsed by macroDef, but we need this
1316− -- here so these aren't parsed as inline commands to ignore
1317− , "special", "pdfannot", "pdfstringdef"
1311+ [ "special", "pdfannot", "pdfstringdef"
1318 , "bibliographystyle"
1312 , "bibliographystyle"
1319 , "maketitle", "makeindex", "makeglossary"
1313 , "maketitle", "makeindex", "makeglossary"
1320 , "addcontentsline", "addtocontents", "addtocounter"
1314 , "addcontentsline", "addtocontents", "addtocounter"
@@ -1375,6 +1369,7 @@ inline = (mempty <$ comment)
1375 <|> (space <$ whitespace)
1369 <|> (space <$ whitespace)
1376 <|> (softbreak <$ endline)
1370 <|> (softbreak <$ endline)
1377 <|> word
1371 <|> word
1378 <|> inlineCommand'
1373 <|> inlineCommand'
1379 <|> inlineEnvironment
1374 <|> inlineEnvironment
1380 <|> inlineGroup
1375 <|> inlineGroup
@@ -1420,8 +1415,7 @@ end_ t = try (do
1420preamble :: PandocMonad m => LP m Blocks
1415preamble :: PandocMonad m => LP m Blocks
1421preamble = mempty <$ many preambleBlock
1416preamble = mempty <$ many preambleBlock
1422 where preambleBlock = spaces1
1417 where preambleBlock = spaces1
1423− <|> void macroDef
1418+ <|> void (macroDef <|> blockCommand)
1424− <|> void blockCommand
1425 <|> void braced
1419 <|> void braced
1426 <|> (notFollowedBy (begin_ "document") >> void anyTok)
1420 <|> (notFollowedBy (begin_ "document") >> void anyTok)
@@ -1484,7 +1478,7 @@ authors = try $ do
1485 addMeta "author" (map trimInlines auths)
1479 addMeta "author" (map trimInlines auths)
1487−macroDef :: PandocMonad m => LP m Blocks
1481+macroDef :: (Monoid a, PandocMonad m) => LP m a
1488macroDef =
1482macroDef =
1489 mempty <$ ((commandDef <|> environmentDef) <* doMacros)
1483 mempty <$ ((commandDef <|> environmentDef) <* doMacros)
1490 where commandDef = do
1484 where commandDef = do