@@ -398,6 +398,19 @@ codeBlockIndented = do
398398lhsCodeBlock :: GenParser Char ParserState Block
399399lhsCodeBlock = do
400400 failUnlessLHS
401+ contents <- lhsCodeBlockBird <|> lhsCodeBlockLaTeX
402+ return $ CodeBlock ("",["haskell"],[]) contents
403+
404+lhsCodeBlockLaTeX :: GenParser Char ParserState String
405+lhsCodeBlockLaTeX = try $ do
406+ string "\\begin{code}"
407+ manyTill spaceChar newline
408+ contents <- many1Till anyChar (try $ string "\\end{code}")
409+ blanklines
410+ return $ stripTrailingNewlines contents
411+
412+lhsCodeBlockBird :: GenParser Char ParserState String
413+lhsCodeBlockBird = try $ do
401414 pos <- getPosition
402415 when (sourceColumn pos /= 1) $ fail "Not in first column"
403416 lns <- many1 birdTrackLine
@@ -406,7 +419,7 @@ lhsCodeBlock = do
406419 then map (drop 1) lns
407420 else lns
408421 blanklines
409− return $ CodeBlock ("",["haskell"],[]) $ intercalate "\n" lns'
422+ return $ intercalate "\n" lns'
410423
411424birdTrackLine :: GenParser Char st [Char]
412425birdTrackLine = do