Error messaging with landscape .tex
curtisKJ opened this issue · 8 comments
curtisKJ commented
Problem:
- I can have a Latex table be knitted appropriately. However, when trying to write out the .tex table to disk I get compiling errors from texPreview.
- The latex is written out just fine.
Code:
chrt1comb %>%
rename(`$t_{lag}$ (h)` = tlag,
`$C_{max}$ (ug/L)` = cmax,
`$AUC_{last}$ (h*ug/L)` = auclast,
`$AUC_{0-inf}$ (h*mg/L)` = aucinf.obs,
`$\\lambda_{z}$` = lambda.z,
`$t_{1/2}$ (h)` = half.life,
`$CL/F$ (L/h)` = CL,
`$Vz/F$ (L)` = Vz,
`$AUC_{0-inf}$ Ext. ($\\%$)` = aucpext.obs) %>%
kableExtra::kable(caption =
'Dose 1.0: Summary',
label = 'tab5',format='latex',escape=F) %>%
kableExtra::kable_styling(latex_options = c("scale_down")) %>%
column_spec(1, bold = T) %>%
pack_rows(group_label = "Summaries",
start_row = 3,
end_row = 11,
latex_gap_space = "2em") %>%
kable_footnote(stem = 'CHRT1SUM') %>%
landscape() %>%
texPreview::tex_preview(stem = 'CHRT1SUM',
usrPackages = build_usepackage(pkg = 'lscape'))
yonicd commented
this reproduces the error
system.file('examples/toy/toy.tex',package = 'texPreview')%>%
texPreview::as.kable()%>%
kableExtra::landscape()%>%
texPreview::tex_preview(
usrPackages = texPreview::build_usepackage('lscape')
)
Error in tex_preview.default(obj, tex_lines, stem, overwrite, keep_pdf, :
! Dimension too large.
\sa@placebox ...global \pdfpagewidth =\wd \sa@box
\global \pdfpageheight =\h...
l.18 \end{document}
! ==> Fatal error occurred, no output PDF file produced!
yonicd commented
yonicd commented
I will add geometry
to the tex template of the package to keep this from happening again.
curtisKJ commented
Hmmm, this didn't resolve the issue for me.
yonicd commented
what is the dimension of the dataframe?
curtisKJ commented
Whoops, forgot to vectorize.....it works. Sorry.
yonicd commented
np. so i can close?
curtisKJ commented
Yes, sir. Thanks again.