rstudio / rticles

LaTeX Journal Article Templates for R Markdown
https://pkgs.rstudio.com/rticles/
1.47k stars 519 forks source link

Better JSS multiline author support #292

Closed aldomann closed 4 years ago

aldomann commented 4 years ago

In some cases, when using authors in multiple lines with the \AND command (see #100 and https://github.com/rstudio/rticles/commit/b740b19b90cd6f7afe2cd7d66456c9efa0bb4cdf), the TeX file will result in \AND \And at the start of a new line (example shown below). This makes

x <- gsub('( \\\\AND )\\\\And ', '\\1', x)

replacement not able to get rid of \And. This small fix is able to handle this special case as well as the previous replacement cases.

Example of problematic TeX author field

\author{
Main author\\University of life and more \And Second author\\University
of life and more \And Third Author\\University of life and more
\AND \And Fourth Author\\University of life and more \And Fifth
Author\\University of life and more \And Sixth Author\\University of
life and more \AND Seventh Author\\University of life and
more \And Eighth Author\\University of life and more \And Ninth
Author\\University of life and more
}

image