Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug with multiple authors in pdf output #354

Merged
merged 1 commit into from
Jan 13, 2015

Conversation

robjhyndman
Copy link
Contributor

Fixes #353

jjallaire added a commit that referenced this pull request Jan 13, 2015
Fixed bug with multiple authors in pdf output
@jjallaire jjallaire merged commit 611f47b into rstudio:master Jan 13, 2015
@yihui
Copy link
Member

yihui commented Jan 13, 2015

Thanks!, But I guess this fixes the symptom (and changes behavior) without curing the disease, and I'd very much like to preserve \and since it is the correct thing to do in LaTeX when writing multiple authors.

@robjhyndman
Copy link
Contributor Author

I'm not sure what you mean by "correct". The definition of \and is

\def\and{%                  % \begin{tabular}
  \end{tabular}%
  \hskip 1em \@plus.17fil%
  \begin{tabular}[t]{c}}%   % \end{tabular}

This normally works because LaTeX sets the authors within a tabular environment. But rmarkdown uses the titling package which does not use the tabular environment, and then the definition causes a problem.

My fix was just to replace \and with \\\\ which avoids the use of the tabular environment and so it does not cause a clash when the titling package is loaded.

There is some discussion of this issue at https://tex.stackexchange.com/questions/109658/and-command-in-author-tag

@robjhyndman
Copy link
Contributor Author

Note that I also mimicked the formatting for html and doc outputs which places each author on a new line. Using \and without the titling package will put authors on the same line. Presumably we want the output to be as similar as possible for each output type.

@yihui
Copy link
Member

yihui commented Jan 14, 2015

By "correct", I mean \and is what we normally use to separate authors. If you hard-code it to be a line break \\, there is no way to customize it. For example, the original layout was to put authors on one line, and that is what I'd prefer.

@jjallaire I feel we opened a can of worms by defining our own LaTeX template here. I looked at Pandoc's default template again, and the spacing does not look too bad:


image


This is what our template produced:


image


Anyway, since it is trivially easy to switch to Pandoc's default template in R Markdown, this issue does not really bother me too much.

@jjallaire
Copy link
Member

@yihui I hear what you are saying and am certainly tempted to go back to using pandoc's template. I have heard however from a ton of people that they don't like the default pandoc spacing at the top so it wouldn't be without significant detractors. I think we should leave it as-is for now and perhaps make it more obvious (via documentation and the IDE) how to switch to the default template.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The default LaTeX template does not work with multiple authors
3 participants