Search
Question: floating toc with BiocStyle
1
gravatar for Guangchuang Yu
3.3 years ago by
Guangchuang Yu1.0k
Hong Kong
Guangchuang Yu1.0k wrote:

I add an additional css as shown in http://rpubs.com/stevepowell99/floating-css

 

via :

---
output:
  BiocStyle::html_document:
    css: my.css
---

and 

```{r style, echo = FALSE, results = 'asis'}
BiocStyle::markdown(css.files = c('my.css'))
```

 

But it fail to generate a html as expected. The table of content is still in the beginning of the main text.

 

Is it possible to generate toc floating in left hand side with BiocStyle?

 

 

 

ADD COMMENTlink modified 3.3 years ago by Andrzej Oleś710 • written 3.3 years ago by Guangchuang Yu1.0k
1
gravatar for Andrzej Oleś
3.3 years ago by
Andrzej Oleś710
Heidelberg, Germany
Andrzej Oleś710 wrote:

Dear Guangchuang,

this should in principle be possible. Please note that if you are specifying the CSS file in the header you shouldn't repeat it in the argument to BiocStyle::markdown, and you probably need to explicitly set toc: yes

Please try the following code which works for me:

---
output:
  BiocStyle::html_document:
    toc: yes
    css: custom.css
---

```{r style, echo = FALSE, results = 'asis'}
BiocStyle::markdown()
```

custom.css

#TOC {
position: fixed;
left: 0;
top: 0;
width: 200px;
height: 100%;
overflow:auto;
}

Best,

Andrzej

ADD COMMENTlink written 3.3 years ago by Andrzej Oleś710

yes, it works.

Thanks a lot.

ADD REPLYlink written 3.3 years ago by Guangchuang Yu1.0k
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: 375 users visited in the last hour