git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader & writer: Use \and to separate authors.
6c02962John MacFarlane
src/Text/Pandoc/Readers/LaTeX.hs+4−2
@@ -407,8 +407,10 @@ title = try $ do
407authors :: GenParser Char ParserState Block
407authors :: GenParser Char ParserState Block
408authors = try $ do
408authors = try $ do
409 string "\\author{"
409 string "\\author{"
410+ let andsep = try $ string "\\and" >> notFollowedBy letter >>
411+ spaces >> return '&'
410− raw <- many1 (notFollowedBy (char '}') >> inline)
412+ raw <- sepBy (many $ notFollowedBy (char '}' <|> andsep) >> inline) andsep
411− let authors' = map normalizeSpaces $ splitBy (== LineBreak) raw
413+ let authors' = map normalizeSpaces raw
412 char '}'
414 char '}'
413 spaces
415 spaces
414 updateState (\s -> s { stateAuthors = authors' })
416 updateState (\s -> s { stateAuthors = authors' })
tests/latex-reader.latex+1−1
@@ -17,7 +17,7 @@
17\setcounter{secnumdepth}{0}
17\setcounter{secnumdepth}{0}
18\VerbatimFootnotes % allows verbatim text in footnotes
18\VerbatimFootnotes % allows verbatim text in footnotes
19\title{Pandoc Test Suite}
19\title{Pandoc Test Suite}
20−\author{John MacFarlane\\Anonymous}
20+\author{John MacFarlane \and Anonymous}
21\date{July 17, 2006}
21\date{July 17, 2006}
22\begin{document}
22\begin{document}
23\maketitle
23\maketitle
tests/writer.latex+1−1
@@ -32,7 +32,7 @@
32\VerbatimFootnotes % allows verbatim text in footnotes
32\VerbatimFootnotes % allows verbatim text in footnotes
33
33
34\title{Pandoc Test Suite}
34\title{Pandoc Test Suite}
35−\author{John MacFarlane\\Anonymous}
35+\author{John MacFarlane \and Anonymous}
36\date{July 17, 2006}
36\date{July 17, 2006}
37
37
38\begin{document}
38\begin{document}