From ccf314829b539762447dc67e506e77c03d3b6e05 Mon Sep 17 00:00:00 2001
From: John MacFarlane <fiddlosopher@gmail.com>
Date: Sun, 9 Sep 2012 18:21:53 -0700
Subject: [PATCH] LaTeX reader:  Guard against "begin", "end" in inlineCommand.

Removed these from list of inline commands.
---
 src/Text/Pandoc/Readers/LaTeX.hs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 4a9ac8a41..64696d053 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -265,8 +265,6 @@ blockCommands = M.fromList $
   , ("closing", skipopts *> closing)
   --
   , ("rule", skipopts *> tok *> tok *> pure horizontalRule)
-  , ("begin", mzero)   -- these are here so they won't be interpreted as inline
-  , ("end", mzero)
   , ("item", skipopts *> loose_item)
   , ("documentclass", skipopts *> braced *> preamble)
   , ("centerline", (para . trimInlines) <$> (skipopts *> tok))
@@ -321,6 +319,7 @@ section lvl = do
 inlineCommand :: LP Inlines
 inlineCommand = try $ do
   name <- anyControlSeq
+  guard $ name /= "begin" && name /= "end"
   guard $ not $ isBlockCommand name
   parseRaw <- getOption readerParseRaw
   star <- option "" (string "*")