rmarkdown icon indicating copy to clipboard operation
rmarkdown copied to clipboard

Float TOC issues with scrolling

Open xtmgah opened this issue 9 years ago • 2 comments

Hello: when I have HTML documents where I can scroll sideways/horizontal (happens with wide tables, etc), the floating TOC stays fixed on the screen, and not fixed relative to the content. It’s then hidden behind code boxes and everything else that is transparent.

xtmgah avatar Sep 07 '16 16:09 xtmgah

This seems to be a tough issue to solve. A workaround would be applying a CSS rule to the elements that might overflow. For example,

p {overflow-x: auto}

reprex

---
title: test
output:
  html_document:
    toc: true
    toc_float: true
---

```{css}
p {overflow-x: auto}
```


# foo

## bar

### buz

```{r, out.extra='style="width:50cm; max-width:50cm"'}
plot(iris)
```

atusy avatar Jul 21 '20 12:07 atusy

It would be easier to style such content if we can target output part from chunk. Applying overflow auto to any <p> may be too much, but that indeed works.

This could help for styling: https://github.com/rstudio/rmarkdown/issues/2025

cderv avatar Jan 12 '22 15:01 cderv