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

Header (title, author, date) and footnote not shown when using rmarkdown::html_vignette #470

Closed
road2stat opened this Issue Jul 15, 2015 · 7 comments

Comments

Projects
None yet
3 participants
@road2stat
Copy link

road2stat commented Jul 15, 2015

To reproduce:

Put the rmarkdown vignette skeleton (which has title, author, date and a footnote) in the vignette folder.

Compile and install the package:

R CMD build package
R CMD INSTALL package_version.tar.gz

In R, open the vignette in browser:

vignette('skeleton')

Online Example: Rmd vignette source | Rendered result on CRAN

This behavior should be consistent with knitr:::html_vignette.

@yihui

This comment has been minimized.

Copy link
Member

yihui commented Jul 16, 2015

I think that is simply due to the fact that Pandoc was not available when the vignette was built, in which case knitr falls back to R Markdown v1 (the vignette you showed on CRAN was built with v1). If you build the package inside RStudio, you should be fine; otherwise you will have to either make symlinks of RStudio's pandoc and pandoc-citeproc to your PATH, or install Pandoc separately.

@meriops

This comment has been minimized.

Copy link

meriops commented Jul 17, 2015

You might want to check your pandoc version. Pandoc v1.15.0.5 did "overaggressive CSS minimization" with --self_contained which was corrected in v1.15.0.6. (see here for more).

@road2stat

This comment has been minimized.

Copy link

road2stat commented Jul 17, 2015

@yihui

-- great. I think so. It works well in RStudio (as the R Markdown V2 Vignette page said). Probably I should wait for CRAN to update its package building infrastructure, until then, I guess I might need to use some workaround.

@meriops

-- thanks for the information. That seems to be an interesting bug ... although the version of Pandoc I have is much lower (1.11.x).

@yihui

This comment has been minimized.

Copy link
Member

yihui commented Jul 17, 2015

You don't need to wait for CRAN. CRAN uses whatever vignette output files you submitted in your source package. They don't rebuild vignettes. The problem must have come from your source package. As I said, if you build the package in RStudio, you should be fine, otherwise make sure pandoc and pandoc-citeproc are on your PATH.

@road2stat

This comment has been minimized.

Copy link

road2stat commented Jul 17, 2015

@yihui -- yep. I finally figured it out. It's my problem -- installed Pandoc version was too old.

The interesting part -- the reason why I didn't notice this: I thought I installed pandoc via Homebrew, which means it will get regular updates via brew update / upgrade. However, Pandoc was actually installed via official binary installer, which means I haven't got a single update of Pandoc for two years ... Thanks for @meriops I got to notice Pandoc's version issue.

It is also shocking for me to know that CRAN will not rebuild vignettes. I think a problem like this is exactly why they should rebuild vignettes.

@yihui

This comment has been minimized.

Copy link
Member

yihui commented Jul 18, 2015

Personally I dare not suggest additional work to CRAN maintainers, so I think it is fine that they just use our pre-built vignettes, which saves trouble of both parties (package authors have control over what to display on CRAN, and CRAN maintainers don't need to install and maintain Pandoc).

I just create symlinks of RStudio's pandoc and pandoc-citeproc to make sure the vignettes built from RStudio are consistent with those built outside RStudio: https://github.com/yihui/configuration/blob/master/configure#L5-L6

@road2stat

This comment has been minimized.

Copy link

road2stat commented Jul 18, 2015

That's reasonable. It will not be easy to change this tradition, for both sides ...

Thanks for sharing this. Since I did notice there were delicate differences between the rendered results of different Pandoc versions, I guess it's necessary to keep this in mind (also in configuration).

I will mark this as closed.

@road2stat road2stat closed this Jul 18, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment