Closed mikeroswell closed 10 months ago
c.f. #2231
For more context, this is the emitted warning that shows in knitted output with dplyr
It does not seems like the output link is correct for support with knitr. I think this is an issue with dplyr or maybe cli which should be what is used there.
Usually the ANSI code formatting for cli use to get nice output in console should be deactivating when knitting.
See also with html_document()
BTW regarding #2231, this is a matter of latex_engine, and xelatex should be used when unicode https://bookdown.org/yihui/rmarkdown-cookbook/latex-unicode.html
It does not solve issue here, because I think there is something that shouldn't be printed anyway.
The message comes from lifecycle package https://github.com/r-lib/lifecycle/blob/80a1e521f995671d062a338856110198b3cdd5e3/R/deprecate.R#L221-L225
with the use of {.url {url}}
formatting in cli
This is ultimately an issue within cli
> xfun::raw_string(
+ knitr::knit(text = c("```{r}", 'url <- "https://github.com/yihui/knitr/issues"', 'cli::format_inline("Please report the issue at {.url {url}}.")', '```'))
+ )
```r
url <- "https://github.com/yihui/knitr/issues"
cli::format_inline("Please report the issue at {.url {url}}.")
## [1] "Please report the issue at <\033]8;;https://github.com/yihui/knitr/issues\ahttps://github.com/yihui/knitr/issues\033]8;;\a>."
What is expected is all the ANSI formatting to be removed
````r
> xfun::raw_string(
+ knitr::knit(text = c("```{r}", 'cli::format_inline("A message for {.emph later}, thanks {.fn format_inline}.")', '```'))
+ )
```r
cli::format_inline("A message for {.emph later}, thanks {.fn format_inline}.")
## [1] "A message for later, thanks `format_inline()`."
Looks like it's on their radar: https://github.com/r-lib/cli/issues/581#issue-1576635242
yes thanks, I was writing a message there. Didn't know you where also digging into that.
Thanks, your message was more helpful! Since I had complained in the first place, I figured it might be my job to close the loop.
This should be fixed in dev cli: https://github.com/r-lib/cli/issues/581 Can you please confirm?
It works for me now with your example @mikeroswell and dev cli
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('knitr')
. 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/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
--
Error knitting to .pdf from .rmd seems to occur with
warnings
generated by dplyr, suggesting a problem with a unicode escape.I was able to reproduce with this
Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8
Package version: evaluate_0.20 graphics_4.2.2 grDevices_4.2.2 highr_0.10 knitr_1.42
methods_4.2.2 stats_4.2.2 tools_4.2.2 utils_4.2.2 xfun_0.37
yaml_2.3.7