git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: Handle \subtitle command.
fe14bf9John MacFarlane
src/Text/Pandoc/Readers/LaTeX.hs+10−1
@@ -391,7 +391,7 @@ para = do
391--
391--
392
392
393bibliographic :: GenParser Char ParserState Block
393bibliographic :: GenParser Char ParserState Block
394−bibliographic = choice [ maketitle, title, authors, date ]
394+bibliographic = choice [ maketitle, title, subtitle, authors, date ]
395
395
396maketitle :: GenParser Char st Block
396maketitle :: GenParser Char st Block
397maketitle = try (string "\\maketitle") >> spaces >> return Null
397maketitle = try (string "\\maketitle") >> spaces >> return Null
@@ -404,6 +404,15 @@ title = try $ do
404 updateState (\state -> state { stateTitle = tit })
404 updateState (\state -> state { stateTitle = tit })
405 return Null
405 return Null
406
406
407+subtitle :: GenParser Char ParserState Block
408+subtitle = try $ do
409+ string "\\subtitle{"
410+ tit <- manyTill inline (char '}')
411+ spaces
412+ updateState (\state -> state { stateTitle = stateTitle state ++
413+ Str ":" : LineBreak : tit })
414+ return Null
415+
407authors :: GenParser Char ParserState Block
416authors :: GenParser Char ParserState Block
408authors = try $ do
417authors = try $ do
409 string "\\author{"
418 string "\\author{"