I have a shiny app which produces a pdf report using multiple Rmd files and the bookdown package, the Rmd files mostly consist of Latex code with some code chunks for plots. I've been getting some inconsistent results between the pdf produced by the app running locally (via my browser/Rstudio) and the pdf produced by the hosed version running on shinyapps. When the pdf is produced locally the spacing is perfect and what I would expect, as seen below.
When downloaded from the hosted app the spacing between table of contents items becomes more compressed as does the spacing between headings and corresponding paragraphs (this is less noticeable) as seen below.
I have tried the latex commands
\onehalfspacing
and
\fontsize{10}{16}
\selectfont
to try and extend the table of contents but to no avail.
I have uploaded an example app to GitHub which exhibits the issue here: https://github.com/matt-888/stackoverflow
Any help would be greatly appreciated :) I've been trying to figure out what is going on for a while now and have implemented some work arounds but haven't found the source of the issue. I am also having a similar problem with plot positioning which I will post presently.