floating toc with BiocStyle
1
@guangchuang-yu-5419
Last seen 25 days ago
China/Guangzhou/Southern Medical Univer…
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?
BiocStyle
• 1.9k views
@andrzej-oles-5540
Last seen 4.0 years ago
Heidelberg, Germany
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
Login before adding your answer.
Traffic: 543 users visited in the last hour
yes, it works.
Thanks a lot.