LaTeX reader & writer: Use \and to separate authors.

Closes #279.
This commit is contained in:
John MacFarlane 2011-07-21 10:09:51 -07:00
parent bd18a80ebe
commit 6c029621ed
3 changed files with 6 additions and 4 deletions

View file

@ -407,8 +407,10 @@ title = try $ do
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' })

View file

@ -17,7 +17,7 @@
\setcounter{secnumdepth}{0}
\VerbatimFootnotes % allows verbatim text in footnotes
\title{Pandoc Test Suite}
\author{John MacFarlane\\Anonymous}
\author{John MacFarlane \and Anonymous}
\date{July 17, 2006}
\begin{document}
\maketitle

View file

@ -32,7 +32,7 @@
\VerbatimFootnotes % allows verbatim text in footnotes
\title{Pandoc Test Suite}
\author{John MacFarlane\\Anonymous}
\author{John MacFarlane \and Anonymous}
\date{July 17, 2006}
\begin{document}