floating toc with BiocStyle
1
1
Entering edit mode
Guangchuang Yu ★ 1.2k
@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
ADD COMMENT
1
Entering edit mode
Andrzej Oleś ▴ 750
@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

ADD COMMENT
0
Entering edit mode

yes, it works.

Thanks a lot.

ADD REPLY

Login before adding your answer.

Traffic: 543 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