When a plot hits the very bottom of the page sometimes instead of moving to the next page it actually gets duplicated see image below. In this example the Rmd contains only one chunk of code to create the chart but it's rendered twice, even include the paragraph before the chart.

I haven't experienced this problem with graphs before. I had had a similar issue with headers (#131).
Could you share the html file and its assets?
Hi Romain,
I created a branch with plot duplication problem you can find all the files here and the html related.
Let me know if you need anything else. Thanks for the help
Thanks @vidonne!
I'm embarassed because both the HTML preview and the PDF are fine with my computer.
Here's the PDF file I get: plot-duplication.pdf
Weird this it the PDF I get: plot_duplication.pdf Page 5-6 you can see the duplication. I haven't updated to the dev version of pagedown though so that's maybe why there is a difference. For some reason I get an error while trying the install.
For some reason I get an error while trying the install.
@vidonne What was the error? Perhaps you can try:
install.packages(
'pagedown', repos = c(
rstudio = 'https://rstudio.r-universe.dev',
CRAN = 'https://cloud.r-project.org'
)
)
@yihui Thanks now installation worked and duplication is gone!!!
That is great news !
So dev version fixed it, I'll close.
Most helpful comment
@yihui Thanks now installation worked and duplication is gone!!!