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

1.19 update and fix #1716 breaks the compact title when only title and date fields are present #1719

Closed
chrisothal opened this issue Dec 4, 2019 · 4 comments

Comments

@chrisothal
Copy link

It seems the most recent update to 1.19 removed the custom latex template and uses pandoc's default template. Fix #1716 was proposed to keep a compact title by including compact-title.tex in the includes argument of pdf_document() (essentially render("test.Rmd", output_format = pdf_document(includes = includes(in_header = "compact-title.tex")))). However, if I have title and date fields but no author field, the rendered PDF document contains a blank line between the title and date. I'm not sure if this is a pandoc, latex, or rmarkdown change, as I receive a "no \author given" warning. Rmarkdown before used to render simply the title and date with no whitespace in between and wouldn't throw any issue with a missing \author.

test.Rmd

---
title: "test"
output: pdf_document
date: "12/3/2019"
---
This is a test document
@chrisothal
Copy link
Author

chrisothal commented Dec 4, 2019

After comparing template default-1.17.0.2.tex, it seems the compact-title:yes variable was used within the template to remove the line where the author field would be and assign a blank author. This also gives the versatility in either assigning an author(s) or no authors.

default-1.17.0.2.tex:

$if(author)$
  \author{$for(author)$$author$$sep$ \\ $endfor$}
  $if(compact-title)$
  \preauthor{\centering\large\emph}
  \postauthor{\par}
  $endif$
$else$
  \author{}
  $if(compact-title)$
  \preauthor{}\postauthor{}
  $endif$
$endif$

@yihui
Copy link
Member

yihui commented Dec 4, 2019

For the warning "no \author given", I just submitted a PR to Pandoc to fix it: jgm/pandoc#5961

For the blank space when no author is given, I'll see how to remove it. Thanks for the report!

@yihui yihui closed this as completed in 07a0ca4 Dec 4, 2019
@yihui
Copy link
Member

yihui commented Dec 4, 2019

Could you install the development version and see if you are happy with the spacing now? Thank you!

remotes::install_github('rstudio/rmarkdown')

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@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

No branches or pull requests

2 participants