From fe14bf9447248d4be15bfcbff88b3fab51af0a5e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 21 Jul 2011 13:33:05 -0700 Subject: [PATCH] LaTeX reader: Handle \subtitle command. If there's a subtitle, it is added to the title, separated by a colon and linebreak. Closes #280. --- src/Text/Pandoc/Readers/LaTeX.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 349074a8269c..02c7361d7e0f 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -391,7 +391,7 @@ para = do -- bibliographic :: GenParser Char ParserState Block -bibliographic = choice [ maketitle, title, authors, date ] +bibliographic = choice [ maketitle, title, subtitle, authors, date ] maketitle :: GenParser Char st Block maketitle = try (string "\\maketitle") >> spaces >> return Null @@ -404,6 +404,15 @@ title = try $ do updateState (\state -> state { stateTitle = tit }) return Null +subtitle :: GenParser Char ParserState Block +subtitle = try $ do + string "\\subtitle{" + tit <- manyTill inline (char '}') + spaces + updateState (\state -> state { stateTitle = stateTitle state ++ + Str ":" : LineBreak : tit }) + return Null + authors :: GenParser Char ParserState Block authors = try $ do string "\\author{"