From cc4b461e1254cf09c2e5aa972c14f42c0438a5bf Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 12:35:41 +0200 Subject: [PATCH 01/11] try render pdflatex --- DESCRIPTION | 3 ++- R/DownloadModule.R | 23 ++++++++++++++++++----- R/TableBlock.R | 2 +- man/download_report_button_srv.Rd | 3 ++- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4beb6bd3..308164af 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,7 +30,8 @@ Suggests: lattice, png, rtables (>= 0.5.1), - testthat + testthat, + tinytex VignetteBuilder: knitr RdMacros: diff --git a/R/DownloadModule.R b/R/DownloadModule.R index c35a01d0..39134a48 100644 --- a/R/DownloadModule.R +++ b/R/DownloadModule.R @@ -29,6 +29,7 @@ download_report_button_ui <- function(id) { #' @param reporter [`Reporter`] instance. #' @param rmd_output `character` vector with `rmarkdown` output types, #' by default all possible `c("pdf_document", "html_document", "powerpoint_presentation", "word_document")`. +#' `pdflatex` has to be installed to use the `"pdf_document"` output. #' @param rmd_yaml_args `named list` vector with `Rmd` `yaml` header fields and their default values. #' Default `list(author = "NEST", title = "Report", date = Sys.Date(), output = "html_document")`. #' Please update only values at this moment. @@ -52,6 +53,11 @@ download_report_button_srv <- function(id, checkmate::assert_list(rmd_yaml_args, names = "named") checkmate::assert_true(all(c("author", "title", "date", "output") %in% names(rmd_yaml_args))) + if ("pdf_document" %in% rmd_output && inherits(try(system("pdflatex --version")), "try-error")) { + warning("pdflatex is not available so the pdf_document output is hidden from use.") + rmd_output <- setdiff(rmd_output, "pdf_document") + } + shiny::moduleServer( id, function(input, output, session) { @@ -124,7 +130,14 @@ download_report_button_srv <- function(id, shiny::showNotification("Rendering and Downloading the document.") input_list <- lapply(names(rmd_yaml_args), function(x) input[[x]]) names(input_list) <- names(rmd_yaml_args) - report_render_and_compress(reporter, input_list, file) + res <- try(report_render_and_compress(reporter, input_list, file)) + if (inherits(res, "try-error")) { + shiny::showNotification( + ui = "Report failed to be generated.", + action = "Please contact app developer", + type = "error" + ) + } }, contentType = "application/zip" ) @@ -154,14 +167,14 @@ report_render_and_compress <- function(reporter, input_list, file = tempdir()) { expr = zip::zipr(temp_zip_file, renderer$get_output_dir()), warning = function(cond) { shiny::showNotification( - ui = sprintf("Zipping folder warning!"), + ui = "Zipping folder warning!", action = "Please contact app developer", type = "warning" ) }, error = function(cond) { shiny::showNotification( - ui = sprintf("Zipping folder error!"), + ui = "Zipping folder error!", action = "Please contact app developer", type = "error" ) @@ -172,14 +185,14 @@ report_render_and_compress <- function(reporter, input_list, file = tempdir()) { expr = file.copy(temp_zip_file, file), warning = function(cond) { shiny::showNotification( - ui = sprintf("Copying file warning!"), + ui = "Copying file warning!", action = "Please contact app developer", type = "warning" ) }, error = function(cond) { shiny::showNotification( - ui = sprintf("Copying file error!"), + ui = "Copying file error!", action = "Please contact app developer", type = "error" ) diff --git a/R/TableBlock.R b/R/TableBlock.R index d7a632f6..71f59609 100644 --- a/R/TableBlock.R +++ b/R/TableBlock.R @@ -35,7 +35,7 @@ TableBlock <- R6::R6Class( # nolint: object_name_linter. } ), private = list( - supported_tables = c("data.frame", "rtables", "TableTree", "ElementaryTable") + supported_tables = c("data.frame", "rtables", "TableTree", "ElementaryTable", "knitr_kable") ), lock_objects = TRUE, lock_class = TRUE diff --git a/man/download_report_button_srv.Rd b/man/download_report_button_srv.Rd index d80e242e..ff667b0d 100644 --- a/man/download_report_button_srv.Rd +++ b/man/download_report_button_srv.Rd @@ -19,7 +19,8 @@ download_report_button_srv( \item{reporter}{\code{\link{Reporter}} instance.} \item{rmd_output}{\code{character} vector with \code{rmarkdown} output types, -by default all possible \code{c("pdf_document", "html_document", "powerpoint_presentation", "word_document")}.} +by default all possible \code{c("pdf_document", "html_document", "powerpoint_presentation", "word_document")}. +\code{pdflatex} has to be installed to use the \code{"pdf_document"} output.} \item{rmd_yaml_args}{\verb{named list} vector with \code{Rmd} \code{yaml} header fields and their default values. Default \code{list(author = "NEST", title = "Report", date = Sys.Date(), output = "html_document")}. From 5b0c879c9c0b79ba570224627f21f78567700363 Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 12:39:02 +0200 Subject: [PATCH 02/11] fix --- R/DownloadModule.R | 6 +++++- R/TableBlock.R | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/R/DownloadModule.R b/R/DownloadModule.R index 39134a48..58f80e80 100644 --- a/R/DownloadModule.R +++ b/R/DownloadModule.R @@ -54,7 +54,11 @@ download_report_button_srv <- function(id, checkmate::assert_true(all(c("author", "title", "date", "output") %in% names(rmd_yaml_args))) if ("pdf_document" %in% rmd_output && inherits(try(system("pdflatex --version")), "try-error")) { - warning("pdflatex is not available so the pdf_document output is hidden from use.") + warning("pdflatex is not available so the pdf_document output is hidden for use.") + shiny::showNotification( + ui = "pdflatex is not available so the pdf_document output is hidden for use.", + type = "warning" + ) rmd_output <- setdiff(rmd_output, "pdf_document") } diff --git a/R/TableBlock.R b/R/TableBlock.R index 71f59609..d7a632f6 100644 --- a/R/TableBlock.R +++ b/R/TableBlock.R @@ -35,7 +35,7 @@ TableBlock <- R6::R6Class( # nolint: object_name_linter. } ), private = list( - supported_tables = c("data.frame", "rtables", "TableTree", "ElementaryTable", "knitr_kable") + supported_tables = c("data.frame", "rtables", "TableTree", "ElementaryTable") ), lock_objects = TRUE, lock_class = TRUE From 1cd5a63fe7a86ea99add64291f12a35b9760199f Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 17:10:56 +0200 Subject: [PATCH 03/11] Update DownloadModule.R --- R/DownloadModule.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/DownloadModule.R b/R/DownloadModule.R index 58f80e80..c7f683ee 100644 --- a/R/DownloadModule.R +++ b/R/DownloadModule.R @@ -53,7 +53,7 @@ download_report_button_srv <- function(id, checkmate::assert_list(rmd_yaml_args, names = "named") checkmate::assert_true(all(c("author", "title", "date", "output") %in% names(rmd_yaml_args))) - if ("pdf_document" %in% rmd_output && inherits(try(system("pdflatex --version")), "try-error")) { + if ("pdf_document" %in% rmd_output && inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { warning("pdflatex is not available so the pdf_document output is hidden for use.") shiny::showNotification( ui = "pdflatex is not available so the pdf_document output is hidden for use.", From e67eb52bfb71a758c1b668500dfc3881fa5370b6 Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 17:14:21 +0200 Subject: [PATCH 04/11] Update Previewer.R --- R/Previewer.R | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/R/Previewer.R b/R/Previewer.R index 6e30ec3c..8297d151 100644 --- a/R/Previewer.R +++ b/R/Previewer.R @@ -76,6 +76,17 @@ reporter_previewer_srv <- function(id, reporter, rmd_yaml_args = list( date = as.character(Sys.Date()), output = "html_document" )) { checkmate::assert_class(reporter, "Reporter") + checkmate::assert_list(rmd_yaml_args) + + if ("pdf_document" %in% rmd_output && inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { + warning("pdflatex is not available so the pdf_document output is hidden for use.") + shiny::showNotification( + ui = "pdflatex is not available so the pdf_document output is hidden for use.", + type = "warning" + ) + rmd_output <- setdiff(rmd_output, "pdf_document") + } + shiny::moduleServer( id, function(input, output, session) { From b3d65f32c7d36bfa2f85fd5c6b22af2975106ba0 Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 17:16:56 +0200 Subject: [PATCH 05/11] Update Previewer.R --- R/Previewer.R | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/R/Previewer.R b/R/Previewer.R index 8297d151..7f2e1810 100644 --- a/R/Previewer.R +++ b/R/Previewer.R @@ -16,6 +16,17 @@ reporter_previewer_ui <- function(id, rmd_output = c( author = "NEST", title = "Report", date = as.character(Sys.Date()), output = "html_document" )) { + checkmate::assert_list(rmd_output) + checkmate::assert_list(rmd_yaml_args) + if ("pdf_document" %in% rmd_output && inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { + warning("pdflatex is not available so the pdf_document output is hidden for use.") + shiny::showNotification( + ui = "pdflatex is not available so the pdf_document output is hidden for use.", + type = "warning" + ) + rmd_output <- setdiff(rmd_output, "pdf_document") + } + ns <- shiny::NS(id) encoding <- shiny::tagList( shiny::tags$h3("Download the Report"), @@ -78,15 +89,6 @@ reporter_previewer_srv <- function(id, reporter, rmd_yaml_args = list( checkmate::assert_class(reporter, "Reporter") checkmate::assert_list(rmd_yaml_args) - if ("pdf_document" %in% rmd_output && inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { - warning("pdflatex is not available so the pdf_document output is hidden for use.") - shiny::showNotification( - ui = "pdflatex is not available so the pdf_document output is hidden for use.", - type = "warning" - ) - rmd_output <- setdiff(rmd_output, "pdf_document") - } - shiny::moduleServer( id, function(input, output, session) { From 39d622cf99712f4cdbd5f32e3ec5e728728470d9 Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 17:18:15 +0200 Subject: [PATCH 06/11] Update Previewer.R --- R/Previewer.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/Previewer.R b/R/Previewer.R index 7f2e1810..8427f92a 100644 --- a/R/Previewer.R +++ b/R/Previewer.R @@ -16,7 +16,6 @@ reporter_previewer_ui <- function(id, rmd_output = c( author = "NEST", title = "Report", date = as.character(Sys.Date()), output = "html_document" )) { - checkmate::assert_list(rmd_output) checkmate::assert_list(rmd_yaml_args) if ("pdf_document" %in% rmd_output && inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { warning("pdflatex is not available so the pdf_document output is hidden for use.") From 3720e49dcddb8f78365c1321cc3df66b2c4ea61f Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 17:29:01 +0200 Subject: [PATCH 07/11] improve --- R/DownloadModule.R | 93 +++++++++++++++++++++++----------------------- R/Previewer.R | 21 +++++------ 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/R/DownloadModule.R b/R/DownloadModule.R index c7f683ee..0fc3fc74 100644 --- a/R/DownloadModule.R +++ b/R/DownloadModule.R @@ -53,15 +53,6 @@ download_report_button_srv <- function(id, checkmate::assert_list(rmd_yaml_args, names = "named") checkmate::assert_true(all(c("author", "title", "date", "output") %in% names(rmd_yaml_args))) - if ("pdf_document" %in% rmd_output && inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { - warning("pdflatex is not available so the pdf_document output is hidden for use.") - shiny::showNotification( - ui = "pdflatex is not available so the pdf_document output is hidden for use.", - type = "warning" - ) - rmd_output <- setdiff(rmd_output, "pdf_document") - } - shiny::moduleServer( id, function(input, output, session) { @@ -161,47 +152,57 @@ report_render_and_compress <- function(reporter, input_list, file = tempdir()) { checkmate::assert_list(input_list, names = "named") checkmate::assert_string(file) - yaml_header <- as_yaml_auto(input_list) + if (identical("pdf_document", input_list$output) && + inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { + warning("pdflatex is not available so the pdf_document output is hidden for use.") + shiny::showNotification( + ui = "pdflatex is not available so the pdf_document output is hidden for use.", + type = "warning" + ) + } + yaml_header <- as_yaml_auto(input_list) renderer <- Renderer$new() - renderer$render(reporter$get_blocks(), yaml_header) - temp_zip_file <- tempfile(fileext = ".zip") + creport <- try(renderer$render(reporter$get_blocks(), yaml_header)) - tryCatch( - expr = zip::zipr(temp_zip_file, renderer$get_output_dir()), - warning = function(cond) { - shiny::showNotification( - ui = "Zipping folder warning!", - action = "Please contact app developer", - type = "warning" - ) - }, - error = function(cond) { - shiny::showNotification( - ui = "Zipping folder error!", - action = "Please contact app developer", - type = "error" - ) - } - ) + if (!inherits(creport, "try-error")) { + temp_zip_file <- tempfile(fileext = ".zip") + tryCatch( + expr = zip::zipr(temp_zip_file, renderer$get_output_dir()), + warning = function(cond) { + shiny::showNotification( + ui = "Zipping folder warning!", + action = "Please contact app developer", + type = "warning" + ) + }, + error = function(cond) { + shiny::showNotification( + ui = "Zipping folder error!", + action = "Please contact app developer", + type = "error" + ) + } + ) - tryCatch( - expr = file.copy(temp_zip_file, file), - warning = function(cond) { - shiny::showNotification( - ui = "Copying file warning!", - action = "Please contact app developer", - type = "warning" - ) - }, - error = function(cond) { - shiny::showNotification( - ui = "Copying file error!", - action = "Please contact app developer", - type = "error" - ) - } - ) + tryCatch( + expr = file.copy(temp_zip_file, file), + warning = function(cond) { + shiny::showNotification( + ui = "Copying file warning!", + action = "Please contact app developer", + type = "warning" + ) + }, + error = function(cond) { + shiny::showNotification( + ui = "Copying file error!", + action = "Please contact app developer", + type = "error" + ) + } + ) + } rm(renderer) invisible(file) diff --git a/R/Previewer.R b/R/Previewer.R index 8427f92a..7ffefdc0 100644 --- a/R/Previewer.R +++ b/R/Previewer.R @@ -17,15 +17,7 @@ reporter_previewer_ui <- function(id, rmd_output = c( date = as.character(Sys.Date()), output = "html_document" )) { checkmate::assert_list(rmd_yaml_args) - if ("pdf_document" %in% rmd_output && inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { - warning("pdflatex is not available so the pdf_document output is hidden for use.") - shiny::showNotification( - ui = "pdflatex is not available so the pdf_document output is hidden for use.", - type = "warning" - ) - rmd_output <- setdiff(rmd_output, "pdf_document") - } - + ns <- shiny::NS(id) encoding <- shiny::tagList( shiny::tags$h3("Download the Report"), @@ -87,7 +79,7 @@ reporter_previewer_srv <- function(id, reporter, rmd_yaml_args = list( )) { checkmate::assert_class(reporter, "Reporter") checkmate::assert_list(rmd_yaml_args) - + shiny::moduleServer( id, function(input, output, session) { @@ -153,7 +145,14 @@ reporter_previewer_srv <- function(id, reporter, rmd_yaml_args = list( shiny::showNotification("Rendering and Downloading the document.") input_list <- lapply(names(rmd_yaml_args), function(x) input[[x]]) names(input_list) <- names(rmd_yaml_args) - report_render_and_compress(reporter, input_list, file) + res <- try(report_render_and_compress(reporter, input_list, file)) + if (inherits(res, "try-error")) { + shiny::showNotification( + ui = "Report failed to be generated.", + action = "Please contact app developer", + type = "error" + ) + } }, contentType = "application/zip" ) From e4e6b9147a921c75091b5da0c7302f9f1fa9dc8f Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 17:36:06 +0200 Subject: [PATCH 08/11] improve --- R/DownloadModule.R | 104 ++++++++++++++++++++++++--------------------- R/Previewer.R | 9 +--- 2 files changed, 57 insertions(+), 56 deletions(-) diff --git a/R/DownloadModule.R b/R/DownloadModule.R index 0fc3fc74..d6d076b7 100644 --- a/R/DownloadModule.R +++ b/R/DownloadModule.R @@ -125,14 +125,7 @@ download_report_button_srv <- function(id, shiny::showNotification("Rendering and Downloading the document.") input_list <- lapply(names(rmd_yaml_args), function(x) input[[x]]) names(input_list) <- names(rmd_yaml_args) - res <- try(report_render_and_compress(reporter, input_list, file)) - if (inherits(res, "try-error")) { - shiny::showNotification( - ui = "Report failed to be generated.", - action = "Please contact app developer", - type = "error" - ) - } + report_render_and_compress(reporter, input_list, file) }, contentType = "application/zip" ) @@ -154,55 +147,70 @@ report_render_and_compress <- function(reporter, input_list, file = tempdir()) { if (identical("pdf_document", input_list$output) && inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { - warning("pdflatex is not available so the pdf_document output is hidden for use.") + warning("pdflatex is not available so the pdf_document could not be rendered.") shiny::showNotification( - ui = "pdflatex is not available so the pdf_document output is hidden for use.", + ui = "pdflatex is not available so the pdf_document could not be rendered.", type = "warning" ) } yaml_header <- as_yaml_auto(input_list) renderer <- Renderer$new() - creport <- try(renderer$render(reporter$get_blocks(), yaml_header)) - if (!inherits(creport, "try-error")) { - temp_zip_file <- tempfile(fileext = ".zip") - tryCatch( - expr = zip::zipr(temp_zip_file, renderer$get_output_dir()), - warning = function(cond) { - shiny::showNotification( - ui = "Zipping folder warning!", - action = "Please contact app developer", - type = "warning" - ) - }, - error = function(cond) { - shiny::showNotification( - ui = "Zipping folder error!", - action = "Please contact app developer", - type = "error" - ) - } - ) + tryCatch( + renderer$render(reporter$get_blocks(), yaml_header), + warning = function(cond) { + shiny::showNotification( + ui = "Render document warning!", + action = "Please contact app developer", + type = "warning" + ) + }, + error = function(cond) { + shiny::showNotification( + ui = "Render document error!", + action = "Please contact app developer", + type = "error" + ) + } + ) - tryCatch( - expr = file.copy(temp_zip_file, file), - warning = function(cond) { - shiny::showNotification( - ui = "Copying file warning!", - action = "Please contact app developer", - type = "warning" - ) - }, - error = function(cond) { - shiny::showNotification( - ui = "Copying file error!", - action = "Please contact app developer", - type = "error" - ) - } - ) - } + temp_zip_file <- tempfile(fileext = ".zip") + tryCatch( + expr = zip::zipr(temp_zip_file, renderer$get_output_dir()), + warning = function(cond) { + shiny::showNotification( + ui = "Zipping folder warning!", + action = "Please contact app developer", + type = "warning" + ) + }, + error = function(cond) { + shiny::showNotification( + ui = "Zipping folder error!", + action = "Please contact app developer", + type = "error" + ) + } + ) + + tryCatch( + expr = file.copy(temp_zip_file, file), + warning = function(cond) { + shiny::showNotification( + ui = "Copying file warning!", + action = "Please contact app developer", + type = "warning" + ) + }, + error = function(cond) { + shiny::showNotification( + ui = "Copying file error!", + action = "Please contact app developer", + type = "error" + ) + } + ) rm(renderer) invisible(file) diff --git a/R/Previewer.R b/R/Previewer.R index 7ffefdc0..26186330 100644 --- a/R/Previewer.R +++ b/R/Previewer.R @@ -145,14 +145,7 @@ reporter_previewer_srv <- function(id, reporter, rmd_yaml_args = list( shiny::showNotification("Rendering and Downloading the document.") input_list <- lapply(names(rmd_yaml_args), function(x) input[[x]]) names(input_list) <- names(rmd_yaml_args) - res <- try(report_render_and_compress(reporter, input_list, file)) - if (inherits(res, "try-error")) { - shiny::showNotification( - ui = "Report failed to be generated.", - action = "Please contact app developer", - type = "error" - ) - } + report_render_and_compress(reporter, input_list, file) }, contentType = "application/zip" ) From 3a2ec2cc11b7835a1311fecefff17381a3c1603c Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 18:04:47 +0200 Subject: [PATCH 09/11] improve --- R/DownloadModule.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/DownloadModule.R b/R/DownloadModule.R index d6d076b7..7e38d0a2 100644 --- a/R/DownloadModule.R +++ b/R/DownloadModule.R @@ -146,12 +146,13 @@ report_render_and_compress <- function(reporter, input_list, file = tempdir()) { checkmate::assert_string(file) if (identical("pdf_document", input_list$output) && - inherits(try(system2("pdflatex --version", stdout = TRUE)), "try-error")) { - warning("pdflatex is not available so the pdf_document could not be rendered.") + inherits(try(system2("pdflatex --version", stdout = TRUE), silent = TRUE), "try-error")) { shiny::showNotification( - ui = "pdflatex is not available so the pdf_document could not be rendered.", - type = "warning" + ui = "pdflatex is not available so the pdf_document could not be rendered. Please use other output type.", + action = "Please contact app developer", + type = "error" ) + stop("pdflatex is not available so the pdf_document could not be rendered.") } yaml_header <- as_yaml_auto(input_list) From 2270cdd52f995c9cdb294f0e50da06069542b216 Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Wed, 6 Jul 2022 18:18:57 +0200 Subject: [PATCH 10/11] styler --- R/DownloadModule.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/DownloadModule.R b/R/DownloadModule.R index 7e38d0a2..fb454819 100644 --- a/R/DownloadModule.R +++ b/R/DownloadModule.R @@ -146,7 +146,7 @@ report_render_and_compress <- function(reporter, input_list, file = tempdir()) { checkmate::assert_string(file) if (identical("pdf_document", input_list$output) && - inherits(try(system2("pdflatex --version", stdout = TRUE), silent = TRUE), "try-error")) { + inherits(try(system2("pdflatex --version", stdout = TRUE), silent = TRUE), "try-error")) { shiny::showNotification( ui = "pdflatex is not available so the pdf_document could not be rendered. Please use other output type.", action = "Please contact app developer", From 88d5d8f0124bdf051623fc9e8552c24572bfaca9 Mon Sep 17 00:00:00 2001 From: Maciej Nasinski Date: Thu, 7 Jul 2022 12:57:22 +0200 Subject: [PATCH 11/11] Update R/DownloadModule.R --- R/DownloadModule.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/DownloadModule.R b/R/DownloadModule.R index fb454819..11d472bd 100644 --- a/R/DownloadModule.R +++ b/R/DownloadModule.R @@ -146,7 +146,7 @@ report_render_and_compress <- function(reporter, input_list, file = tempdir()) { checkmate::assert_string(file) if (identical("pdf_document", input_list$output) && - inherits(try(system2("pdflatex --version", stdout = TRUE), silent = TRUE), "try-error")) { + inherits(try(system2("pdflatex", "--version", stdout = TRUE), silent = TRUE), "try-error")) { shiny::showNotification( ui = "pdflatex is not available so the pdf_document could not be rendered. Please use other output type.", action = "Please contact app developer",