BiocStyle header specification
1
1
Entering edit mode
@ioannisvardaxis-11763
Last seen 19 months ago
Norway/Oslo

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 • 1.9k views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 3 days ago
United States

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.

ADD COMMENT
0
Entering edit mode

hi, thanks for the answer.

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.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Try the following:

author:
  - name: first author
    email: email@...
    affiliation: in case you want to provide one
  - name: another author
    email: ...
    affiliation: ...
ADD REPLY
0
Entering edit mode

In case you missed it, the devel version of BiocStyle::pdf_document2 supports now the shorttitle yaml option for specifying headers.

ADD REPLY

Login before adding your answer.

Traffic: 504 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6