Search
Question: BiocStyle header specification
1
gravatar for ioannis.vardaxis
17 months 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

ADD COMMENTlink modified 17 months ago by James W. MacDonald46k • written 17 months ago by ioannis.vardaxis20
1
gravatar for James W. MacDonald
17 months ago by
United States
James W. MacDonald46k 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.

ADD COMMENTlink written 17 months ago by James W. MacDonald46k

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 REPLYlink written 17 months ago by ioannis.vardaxis20

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 REPLYlink written 17 months ago by Andrzej Oleś680

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 REPLYlink written 17 months ago by ioannis.vardaxis20

Try the following:

author:
  - name: first author
    email: email@...
    affiliation: in case you want to provide one
  - name: another author
    email: ...
    affiliation: ...
ADD REPLYlink written 17 months ago by Andrzej Oleś680

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

ADD REPLYlink written 16 months ago by Andrzej Oleś680
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 115 users visited in the last hour