Re: [R-pkg-devel] Disable a particular knitr vignette
For anyone interested, I finally managed to solve this, following a suggestion by Baptiste Auguie. TLDR; my yaml header reads as follows: output: if (packageVersion("rticles") < 0.5 || rmarkdown::pandoc_version() >= 2) rticles::jss_article else rmarkdown::html_vignette This fallback simply ignores the fancy latex commands and produces a HTML output, which prevents R CMD check from complaining. Regards, Iñaki El jue., 2 ago. 2018 a las 10:04, Iñaki Úcar () escribió: > > Hi everyone, > > I have a JSS vignette based on the rticles package. It was compiling > just fine until rticles v0.5 for some reason started requiring pandoc > v2.x for such a document class, and failing otherwise. Due to this > requirement, Windows machines on CRAN show a nasty WARN, because they > still have pandoc v1.x. > > It is painful for Uwe to install pandoc v2.x there, so I was wondering > whether there's any easy mechanism to just disable a particular > vignette based on some condition (in this case, it would be "we are on > CRAN, this is Windows and the pandoc version is < 2"; this is easy to > test). > > I tried putting a condition for the output format in the YAML header > and it works, i.e.: > > output: if (cond) rticles::jss_article else rmarkdown::pdf_document > > But rmarkdown::pdf_document fails to compile, because the JSS class > has many custom macros. I tried also putting a NULL or a NA there, and > it doesn't work. > > Does any knitr ninja here know if there's some easy trick to do this > and make Uwe's life easier? Some "NULL" document format? > > Regards, > Iñaki -- Iñaki Úcar http://www.enchufa2.es @Enchufa2 __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Disable a particular knitr vignette
El jue., 2 ago. 2018 a las 11:41, Henrik Bengtsson () escribió: > > As a workaround, until resolved, you could precompile your vignette > into a PDF and then use the 'R.rsp::asis' vignette engine > (%\VignetteEngine{R.rsp::asis} etc) to include it as a static PDF. > This is described in the vignettes > (https://cran.r-project.org/package=R.rsp). > > -Henrik Thanks for the suggestion, Henrik. I would prefer, though, not to change the behaviour on other platforms and not to rely on another dependency just for a workaround. Iñaki > On Thu, Aug 2, 2018 at 10:04 AM Iñaki Úcar wrote: > > > > Hi everyone, > > > > I have a JSS vignette based on the rticles package. It was compiling > > just fine until rticles v0.5 for some reason started requiring pandoc > > v2.x for such a document class, and failing otherwise. Due to this > > requirement, Windows machines on CRAN show a nasty WARN, because they > > still have pandoc v1.x. > > > > It is painful for Uwe to install pandoc v2.x there, so I was wondering > > whether there's any easy mechanism to just disable a particular > > vignette based on some condition (in this case, it would be "we are on > > CRAN, this is Windows and the pandoc version is < 2"; this is easy to > > test). > > > > I tried putting a condition for the output format in the YAML header > > and it works, i.e.: > > > > output: if (cond) rticles::jss_article else rmarkdown::pdf_document > > > > But rmarkdown::pdf_document fails to compile, because the JSS class > > has many custom macros. I tried also putting a NULL or a NA there, and > > it doesn't work. > > > > Does any knitr ninja here know if there's some easy trick to do this > > and make Uwe's life easier? Some "NULL" document format? > > > > Regards, > > Iñaki > > > > __ > > R-package-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-package-devel __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] Disable a particular knitr vignette
As a workaround, until resolved, you could precompile your vignette into a PDF and then use the 'R.rsp::asis' vignette engine (%\VignetteEngine{R.rsp::asis} etc) to include it as a static PDF. This is described in the vignettes (https://cran.r-project.org/package=R.rsp). -Henrik On Thu, Aug 2, 2018 at 10:04 AM Iñaki Úcar wrote: > > Hi everyone, > > I have a JSS vignette based on the rticles package. It was compiling > just fine until rticles v0.5 for some reason started requiring pandoc > v2.x for such a document class, and failing otherwise. Due to this > requirement, Windows machines on CRAN show a nasty WARN, because they > still have pandoc v1.x. > > It is painful for Uwe to install pandoc v2.x there, so I was wondering > whether there's any easy mechanism to just disable a particular > vignette based on some condition (in this case, it would be "we are on > CRAN, this is Windows and the pandoc version is < 2"; this is easy to > test). > > I tried putting a condition for the output format in the YAML header > and it works, i.e.: > > output: if (cond) rticles::jss_article else rmarkdown::pdf_document > > But rmarkdown::pdf_document fails to compile, because the JSS class > has many custom macros. I tried also putting a NULL or a NA there, and > it doesn't work. > > Does any knitr ninja here know if there's some easy trick to do this > and make Uwe's life easier? Some "NULL" document format? > > Regards, > Iñaki > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] Disable a particular knitr vignette
Hi everyone, I have a JSS vignette based on the rticles package. It was compiling just fine until rticles v0.5 for some reason started requiring pandoc v2.x for such a document class, and failing otherwise. Due to this requirement, Windows machines on CRAN show a nasty WARN, because they still have pandoc v1.x. It is painful for Uwe to install pandoc v2.x there, so I was wondering whether there's any easy mechanism to just disable a particular vignette based on some condition (in this case, it would be "we are on CRAN, this is Windows and the pandoc version is < 2"; this is easy to test). I tried putting a condition for the output format in the YAML header and it works, i.e.: output: if (cond) rticles::jss_article else rmarkdown::pdf_document But rmarkdown::pdf_document fails to compile, because the JSS class has many custom macros. I tried also putting a NULL or a NA there, and it doesn't work. Does any knitr ninja here know if there's some easy trick to do this and make Uwe's life easier? Some "NULL" document format? Regards, Iñaki __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel