diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-07-21 13:33:05 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-07-21 13:33:51 -0700 |
commit | fe14bf9447248d4be15bfcbff88b3fab51af0a5e (patch) | |
tree | fd91b2dc27c5d9fed194f41f3fe470632d85988d /src/Text/Pandoc | |
parent | 6c029621ed9399abebbfd4fc43af0dd751c621aa (diff) | |
download | pandoc-fe14bf9447248d4be15bfcbff88b3fab51af0a5e.tar.gz |
LaTeX reader: Handle \subtitle command.
If there's a subtitle, it is added to the title,
separated by a colon and linebreak. Closes #280.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 349074a82..02c7361d7 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{" |