From 149c09132e5baed7c4b661d4884fa680b4ed6cb4 Mon Sep 17 00:00:00 2001 From: Rene Saitenmacher <(none)> Date: Wed, 11 Sep 2024 23:47:54 +0200 Subject: [PATCH] Fix pdf printing on separate pages for A4 format --- code/printA4.Rmd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/printA4.Rmd b/code/printA4.Rmd index ee9dda5..e2846d6 100644 --- a/code/printA4.Rmd +++ b/code/printA4.Rmd @@ -14,6 +14,11 @@ params: path: NA --- -```{r, echo=FALSE, out.width="100%", warning=FALSE, message=FALSE} -image_read(params$path) +```{r, echo=FALSE, results="asis", warning=FALSE, message=FALSE, out.width="100%"} +# Known issue for knitr include_graphics: https://stackoverflow.com/questions/51268623/insert-images-using-knitrinclude-graphics-in-a-for-loop +# Can't image_read outside top-level. So cheat and output markdown format image +# inclusion and use result="asis" +for(path in params$path){ + cat(paste0("![](", path, ")"), "\n") +} ```