diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index a4157da2f..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,11 +404,22 @@ 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{" - raw <- many1 (notFollowedBy (char '}') >> inline) - let authors' = map normalizeSpaces $ splitBy (== LineBreak) raw + let andsep = try $ string "\\and" >> notFollowedBy letter >> + spaces >> return '&' + raw <- sepBy (many $ notFollowedBy (char '}' <|> andsep) >> inline) andsep + let authors' = map normalizeSpaces raw char '}' spaces updateState (\s -> s { stateAuthors = authors' }) |
