NewGraphEnvironment / hsp

Health and Safety Plan
https://newgraphenvironment.github.io/hsp/
Creative Commons Zero v1.0 Universal
0 stars 2 forks source link

Unable to build printable pdf #19

Closed Mateo9569 closed 1 year ago

Mateo9569 commented 1 year ago

I'm getting a runtime error when I try to build the printable pdf. I tried increasing the timeout period to 360 but it still didn't work. Any insight into how to fix would be appreciated. The console log is shown below.

image

NewGraphEnvironment commented 1 year ago

Thanks for the issue!

Can you possibly see if you can narrow down why the doc does not render to pdf with rmarkdown::render_site(output_format = 'pagedown::html_paged', encoding = 'UTF-8') and pagedown:chrome_print and fix or update issue?

You can start by moving each chapter rmd to hold directory separately and rebuilding with scripts/run.R and pagedown:chrome_print to find the rmd culprit. Then you could remove top half of culprit rmd then bottom half of culprit rmd and rerun to find area where problem is. Then you can zoom in by removing top half and bottom half of culprit half rmd and on and on to find the issue. It is a surprisingly quick process.

Mateo9569 commented 1 year ago

That was a super helpful tip, thank you. Turns out there was 2 rmd files that were causing problems: 0110-intro.Rmd and 0200-plans-assessments.Rmd. In both files, the cause of the problem was pictures.

In the case of 0200-plans-assessments.Rmd, the problem was at this picture call. There was two pictures in the fig/media/ folder, one called risk_matrix.png and another called Risk_Matrix.jpg. I fixed the issue by calling the correct picture.

As for the issue in 0110-intro.Rmd, the problem was with the forestry accord picture. I got an up to date picture of the forestry accord from google and used that one instead. The error then went away. Really weird. The only thing I can think of is that the dimensions of the original picture were causing an error.

Anyways, the pdf builds just fine for me now.