Closed muschellij2 closed 5 years ago
I bet there must be certain ANSI escape codes. I feel this issue is not directly relevant to bookdown but essentially a LaTeX issue. You'll have to either disable ANSI escape codes from rlang, or figure out how to deal with them in LaTeX (e.g. https://tex.stackexchange.com/q/168460/9128).
Ahh good to know. I will look into this a bit more, but wanted to present the problem and current solution in case anyone else ran into it. Will close.
Sounds good. Thank you!
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
By filing an issue to this repo, I promise that
xfun::session_info('bookdown')
. 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('rstudio/bookdown')
.I'm trying to reproduce, which is a bit hard due to different nature from when using Rscript vs. using RStudio.
Problem
LaTeX failures when
rlang
-style traceback in PDF book inbookdown
, whenerror = TRUE
in code chunk.This may be due to @r-lib
rlang
not recognizing PDF output (not sure if it should) orbookdown
should set option if necessary.Solution
Set
options(rlang_backtrace_on_error = "none")
inRmd
file.Example failures
With
xelatex
With
pdflatex
:Does not reproduce in
reprex
I think this may be due to traceback options in
rlang
with non-UTF8 characters in traceback for PDF outputs for `bookdown.Here is the uploaded test files: test.zip, but they are downloaded in the scrip below.
I have not found this to completely reproduce in @tidyverse reprex, but if you run this script locally (RStudio or Terminal R), it will error whenever
rlang_backtrace_on_error
seems to be set to anything but"none"
or `"reminder"':