1
2.4 years ago by
Norway/Trondheim/NTNU
ioannis.vardaxis20 wrote:

Hi,

I am trying to use BiocStyle to create vignette in R markdown. I read the instructions but i dont get the results i want so I was wondering what I have done wrong. I dont understand where I should place the first chuck which loads latex2. If i do it this way i get two pages with double author etc.

---
title: "pkg"
author: "author"
date: "r doc_date()"
package: "r BiocStyle::pkg_ver('pkg')"
output:
BiocStyle::pdf_document2
vignette: >
%\VignetteIndexEntry{pkg}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

{r style,eval=TRUE,echo=FALSE,results='hide'}
BiocStyle::latex2()


<!-- Title -->
\bioctitle[pkg]{long pkg name}
\author{author {\email{author mail}}}
\date{r Sys.Date()}

\maketitle

Best

biocstyle • 516 views
modified 2.4 years ago by James W. MacDonald49k • written 2.4 years ago by ioannis.vardaxis20
1
2.4 years ago by
United States
James W. MacDonald49k wrote:

You already have set the author and title in the yaml section:

---
title: "pkg"
author: "author"
date: "r doc_date()"
package: "r BiocStyle::pkg_ver('pkg')"
output:
BiocStyle::pdf_document2
vignette: >
%\VignetteIndexEntry{pkg}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

The extra title section you add below is then adding in the same thing, a second time.

I know, but if I dont do that then i cannot use :\bioctitle[pkg]{long pkg name} and the package will only have a sort name

actually i cannot use any of the biocstyle options in the yalm since biocstyle has to be loaded after the yalm. Therefore everythink is doubled.

In an .Rmd document, you don't need the code chunk which calls BiocStyle::latex2(), as the setup is already done by specifying output: BiocStyle::pdf_document2 in the document header. The short/long titles in r markdown are currently not implemented, for now you can only have one title specified in document header. However, I might add this in near future, so stay tuned.

Cheers,

Andrzej

Ok thanks.

One last question, i try to add email etc in yaml but it doesn't appear on the pdf:

---
title: "pkg"
author: "author"
email: email@..
date: "r doc_date()"
package: "r BiocStyle::pkg_ver('pkg')"
output:
BiocStyle::pdf_document2
vignette: >
%\VignetteIndexEntry{pkg}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

Any solution to that?

Best

Try the following:

author:
- name: first author
email: email@...
affiliation: in case you want to provide one
- name: another author
email: ...
affiliation: ...
In case you missed it, the devel version of BiocStyle::pdf_document2 supports now the shorttitle yaml option for specifying headers.