Hi all!
I keep running into an issue where using a floating table of contents and plots is producing extra whitespace at the end of HTML output for an RMarkdown doc.
An example RMarkdown file looks something like this (the chunks are defined properly, I swear -- just difficult to display here)
---
title: "Plots and floating TOC"
output:
html_document:
toc: true
toc_float: true
---
# h1
## h1.2
# h2
## h2.2
```{r message = FALSE, echo = FALSE}
plot(mtcars)
```
```{r message = FALSE, echo = FALSE}
plot(mtcars)
```
```{r message = FALSE, echo = FALSE}
plot(mtcars)
```
and produces the following output: http://rpubs.com/sharlagelfand/plot_floating_toc
Initially it doesn't look like there is extra whitespace, but as you scroll down to the bottom it suddenly appears! This doesn't happen when the table of contents is fixed (toc_float: false). It does happen with plotly and ggplot2 as well as base plots as shown here.
Here is my session info:
devtools::session_info()
#> Session info -------------------------------------------------------------
#> setting value
#> version R version 3.5.1 (2018-07-02)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_Canada.1252
#> tz America/New_York
#> date 2018-08-14
#> Packages -----------------------------------------------------------------
#> package * version date source
#> backports 1.1.2 2017-12-13 CRAN (R 3.5.0)
#> base * 3.5.1 2018-07-02 local
#> compiler 3.5.1 2018-07-02 local
#> datasets * 3.5.1 2018-07-02 local
#> devtools 1.13.6 2018-06-27 CRAN (R 3.5.1)
#> digest 0.6.15 2018-01-28 CRAN (R 3.5.1)
#> evaluate 0.11 2018-07-17 CRAN (R 3.5.1)
#> graphics * 3.5.1 2018-07-02 local
#> grDevices * 3.5.1 2018-07-02 local
#> htmltools 0.3.6 2017-04-28 CRAN (R 3.5.1)
#> knitr 1.20 2018-02-20 CRAN (R 3.5.1)
#> magrittr 1.5 2014-11-22 CRAN (R 3.5.1)
#> memoise 1.1.0 2017-04-21 CRAN (R 3.5.1)
#> methods * 3.5.1 2018-07-02 local
#> Rcpp 0.12.18 2018-07-23 CRAN (R 3.5.1)
#> rmarkdown 1.10 2018-06-11 CRAN (R 3.5.1)
#> rprojroot 1.3-2 2018-01-03 CRAN (R 3.5.1)
#> stats * 3.5.1 2018-07-02 local
#> stringi 1.1.7 2018-03-12 CRAN (R 3.5.0)
#> stringr 1.3.1 2018-05-10 CRAN (R 3.5.1)
#> tools 3.5.1 2018-07-02 local
#> utils * 3.5.1 2018-07-02 local
#> withr 2.1.2 2018-03-15 CRAN (R 3.5.1)
#> yaml 2.2.0 2018-07-25 CRAN (R 3.5.1)
Any thoughts or advice would be much appreciated!