@@ -296,7 +296,7 @@ inBrackets x = str "[" <> x <> str "]"
297-- eat an optional argument and one or more arguments in braces
297-- eat an optional argument and one or more arguments in braces
298ignoreInlines :: PandocMonad m => String -> (String, LP m Inlines)
298ignoreInlines :: PandocMonad m => String -> (String, LP m Inlines)
299−ignoreInlines name = (name, doraw <|> (mempty <$ optargs))
299+ignoreInlines name = (name, doraw <|> (optargs >> ignore name))
300 where optargs = skipopts *> skipMany (try $ optional sp *> braced)
300 where optargs = skipopts *> skipMany (try $ optional sp *> braced)
301 contseq = '\\':name
301 contseq = '\\':name
302 doraw = (rawInline "latex" . (contseq ++) . snd) <$>
302 doraw = (rawInline "latex" . (contseq ++) . snd) <$>
@@ -304,8 +304,14 @@ ignoreInlines name = (name, doraw <|> (mempty <$ optargs))
304 guard $ extensionEnabled Ext_raw_tex exts
304 guard $ extensionEnabled Ext_raw_tex exts
305 withRaw optargs)
305 withRaw optargs)
307+ignore :: (Monoid a, PandocMonad m) => String -> LP m a
310+ warningWithPos pos $ "Skipped \\" ++ name ++ " and its arguments"
307ignoreBlocks :: PandocMonad m => String -> (String, LP m Blocks)
313ignoreBlocks :: PandocMonad m => String -> (String, LP m Blocks)
308−ignoreBlocks name = (name, doraw <|> (mempty <$ optargs))
314+ignoreBlocks name = (name, doraw <|> (optargs >> ignore name))
309 where optargs = skipopts *> skipMany (try $ optional sp *> braced)
315 where optargs = skipopts *> skipMany (try $ optional sp *> braced)
310 contseq = '\\':name
316 contseq = '\\':name
311 doraw = (rawBlock "latex" . (contseq ++) . snd) <$>
317 doraw = (rawBlock "latex" . (contseq ++) . snd) <$>
@@ -438,7 +444,7 @@ inlineCommand = try $ do
438 then parseFromString inlines transformed
444 then parseFromString inlines transformed
439 else if extensionEnabled Ext_raw_tex exts
445 else if extensionEnabled Ext_raw_tex exts
440 then return $ rawInline "latex" rawcommand
446 then return $ rawInline "latex" rawcommand
441− else return mempty
447+ else ignore name
442 (lookupListDefault mzero [name',name] inlineCommands <*
448 (lookupListDefault mzero [name',name] inlineCommands <*
443 optional (try (string "{}")))
449 optional (try (string "{}")))
@@ -489,7 +495,7 @@ inlineCommands = M.fromList $
489 , ("sim", lit "~")
495 , ("sim", lit "~")
490 , ("label", unlessParseRaw >> (inBrackets <$> tok))
496 , ("label", unlessParseRaw >> (inBrackets <$> tok))
491 , ("ref", unlessParseRaw >> (inBrackets <$> tok))
497 , ("ref", unlessParseRaw >> (inBrackets <$> tok))
492− , ("noindent", unlessParseRaw >> return mempty)
498+ , ("noindent", unlessParseRaw >> ignore "noindent")
493 , ("textgreek", tok)
499 , ("textgreek", tok)
494 , ("sep", lit ",")
500 , ("sep", lit ",")
495 , ("cref", unlessParseRaw >> (inBrackets <$> tok)) -- from cleveref.sty
501 , ("cref", unlessParseRaw >> (inBrackets <$> tok)) -- from cleveref.sty