Skip to content

Commit

Permalink
LaTeX reader: Handle \subtitle command.
Browse files Browse the repository at this point in the history
If there's a subtitle, it is added to the title,
separated by a colon and linebreak.  Closes #280.
  • Loading branch information
jgm committed Jul 21, 2011
1 parent 6c02962 commit fe14bf9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Text/Pandoc/Readers/LaTeX.hs
Expand Up @@ -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
Expand All @@ -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{"
Expand Down

0 comments on commit fe14bf9

Please sign in to comment.