Closed drag05 closed 4 years ago
The body of this issue is essentially empty. Please read the issue guide again. Thanks!
@yihui Hello Yihui, Thank you for your time! I don't know what happened - checked all the boxes and all.
I am building a shiny app that basically connects to a database, displays a table where the User can filter the data and then calls rmarkdown::render()
by pressing a button and generate a .pdf
report in app's subdirectory named ./makeReport
.
For this app, all R packages are loaded via the global.R
script.
The Rmd works fine when used in stand alone form, either from R Studio, R console or command line, and loads same libraries via a contained R chunk.
I use tinytex
and run tinytex_install
and tlmgr_update
. I have no MiKTex
installed.
The app contains text, graphs, and tables crossing several pages. Tables wider than 6 columns are column-split via pander
. The rest of tables are generated with knitr::kable
using the custom function below:
reshapeTables <- function(data, caption) {
stopifnot(length(dim(data)) == 2L)
rTab <- if(dim(data)[[2]] > 6){ ## 6 represents 3 conditions of 2 replicates each
panderOptions('knitr.auto.asis', TRUE)
pander(data, caption = caption
, justify = 'left'
, style = 'grid'
, split.table = 90
, keys.as.row.names = TRUE)
} else {
knitr::kable(data
, format = 'latex'
, caption = caption
, align = 'l'
, booktabs = TRUE
, longtable = TRUE) %>%
kable_styling(font_size = 10) %>%
kable_styling(full_width = TRUE, latex_options = c('repeat_header', 'hold_position')) %>%
column_spec(1, bold = TRUE, color = 'red')
}
return(rTab)
}
which throws the following error:
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
I was unable to find any missing LaTeX packages from the error log ReportFulc.log.
! LaTeX Error: Environment longtabu undefined.
Error : LaTeX failed to compile
This is one issue. The second is the Report loses its header together with all the information in it. The footer is still there but cannot get it to show the page of Total pages
info. Just the page
Probably misinterpreting the error message above, at first I tried to install package longtable.sty
using tinytex::tlmgr_install('longtable')
and got the follwing messages:
tlmgr install longtable
tlmgr.pl install: package longtable not present in repository.
tlmgr.pl: action install returned an error; continuing.
tlmgr.pl: package repository http://ctan.mirror.colo-serv.net/systems/texlive/tlnet (verified)
tlmgr.pl: An error has occurred. See above messages. Exiting.
tlmgr update --self
tlmgr install longtable
tlmgr.pl install: package longtable not present in repository.
tlmgr.pl: action install returned an error; continuing.
tlmgr.pl: package repository http://ctan.mirror.colo-serv.net/systems/texlive/tlnet (verified)
tlmgr.pl: An error has occurred. See above messages. Exiting.
I am able to print the table if use format = 'pandoc'
or format = 'markdown'
.
The yaml header looks like this:
title: "Report"
output:
pdf_document:
fig_caption: yes
toc: yes
toc_depth: 1
toc_includes:
fontawesome: yes
header-includes:
\usepackage{titling}
\usepackage{float}
\usepackage{mdframed}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{graphicx}
\usepackage{booktabs,xcolor}
\usepackage{lastpage}
\usepackage{longtable}
\setlength{\droptitle}{-5em}
\pagestyle{fancy} \fancyhf{} \addtolength{\headheight}{20pt}
\fancyfoot[R]{\footnotesize Page \thepage\, of\, \pageref*{LastPage}}
\setlength\footskip{12pt}
\fancypagestyle{plain}{\pagestyle{fancy}}
\lhead{<authors> - \today}
\rhead{\includegraphics[width=0.7in]{./www/Logo.png}}
and
session_info()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363), RStudio 1.3.959
Locale:
LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
LC_MONETARY=English_United States.1252 LC_NUMERIC=C
LC_TIME=English_United States.1252
Package version:
abind_1.4-5 antiword_1.3 askpass_1.1 assertthat_0.2.1
backports_1.1.7 base64enc_0.1.3 BH_1.72.0.3 bitops_1.0.6
blob_1.2.1 boot_1.3.25 broom_0.5.6 callr_3.4.3
car_3.0-8 carData_3.0-4 cellranger_1.1.0 cli_2.0.2
clipr_0.7.0 colorspace_1.4-1 compiler_4.0.0 corrplot_0.84
cowplot_1.0.0 crayon_1.3.4 crosstalk_1.1.0.1 curl_4.3
data.table_1.12.9 DBI_1.1.0 dbplyr_1.4.4 desc_1.2.0
digest_0.6.25 dplyr_1.0.0 DT_0.13 ellipsis_0.3.1
evaluate_0.14 fansi_0.4.1 farver_2.0.3 fastmap_1.0.1
forcats_0.5.0 foreign_0.8-80 generics_0.0.2 ggplot2_3.3.1
ggpubr_0.3.0 ggrepel_0.8.2 ggsci_2.9 ggsignif_0.6.0
glue_1.4.1 graphics_4.0.0 grDevices_4.0.0 grid_4.0.0
gridExtra_2.3 gtable_0.3.0 haven_2.3.1 highr_0.8
hms_0.5.3 htmltools_0.4.0 htmlwidgets_1.5.1 httpuv_1.5.4
httr_1.4.1 isoband_0.2.1 jsonlite_1.6.1 kableExtra_1.1.0
knitr_1.28 labeling_0.3 later_1.1.0.1 lattice_0.20-41
lazyeval_0.2.2 lifecycle_0.2.0 lme4_1.1.23 magrittr_1.5
maptools_1.0.1 markdown_1.1 MASS_7.3.51.6 Matrix_1.2.18
MatrixModels_0.4.1 methods_4.0.0 mgcv_1.8.31 mime_0.9
minqa_1.2.4 munsell_0.5.0 ndjson_0.8.0 nlme_3.1-148
nloptr_1.2.2.1 nnet_7.3.14 openssl_1.4.1 openxlsx_4.1.5
pander_0.6.4 parallel_4.0.0 patchwork_1.0.0 pbkrtest_0.4.8.6
pdftools_2.3.1 pillar_1.4.4 pkgbuild_1.0.8 pkgconfig_2.0.3
pkgload_1.1.0 plyr_1.8.6 polynom_1.4.0 pool_0.1.4.3
praise_1.0.0 prettyunits_1.1.1 processx_3.4.2 progress_1.2.2
promises_1.1.1 ps_1.3.3 purrr_0.3.4 qpdf_1.1
quantreg_5.55 R6_2.4.1 RColorBrewer_1.1-2 Rcpp_1.0.4.6
RcppEigen_0.3.3.7.0 RCurl_1.98.1.2 readODS_1.6.7 readr_1.3.1
readtext_0.76 readxl_1.3.1 rematch_1.0.1 reshape2_1.4.4
rio_0.5.16 rjson_0.2.20 rlang_0.4.6 rmarkdown_2.2
RMySQL_0.10.20 rprojroot_1.3.2 rstatix_0.5.0 rstudioapi_0.11
rvest_0.3.5 scales_1.1.1 selectr_0.4.2 shiny_1.4.0.2
shinythemes_1.1.2 sourcetools_0.1.7 sp_1.4.2 SparseM_1.78
splines_4.0.0 statmod_1.4.34 stats_4.0.0 streamR_0.4.5
stringi_1.4.6 stringr_1.4.0 striprtf_0.5.2 sys_3.3
testthat_2.3.2 tibble_3.0.1 tidyr_1.1.0 tidyselect_1.1.0
tinytex_0.23.2 tools_4.0.0 utf8_1.1.4 utils_4.0.0
vctrs_0.3.1 viridisLite_0.3.0 webshot_0.5.2 withr_2.2.0
xfun_0.14 xml2_1.3.2 xtable_1.8-4 yaml_2.2.1
zip_2.0.4
Please advise, thank you!
By filing an issue to this repo, I promise that
xfun::session_info('tinytex')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/tinytex')
.I understand that my issue may be closed if I don't fulfill my promises.