Giter VIP home page Giter VIP logo

Comments (5)

batpigandme avatar batpigandme commented on September 25, 2024

TL;DR It's the output of tidyverse_conflicts() that seems to cause the error.

Can confirm error re. Unicode character (! LaTeX Error: Unicode character ^^[ (U+001B)) using tinytex:

source input test-issue327.Rmd (recreated below):

---
title: "Test"
output: pdf_document
date: "`r Sys.Date()`"
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r}
library(tidyverse)
```

Output from render after updating tinytex with tinytex::tlmgr_update() per recommendations at https://yihui.org/tinytex/r/#debugging:

  |.....................                               |  40% (setup)          

processing file: test-issue327.Rmd
                                                                                                            
/opt/homebrew/bin/pandoc +RTS -K512m -RTS test-issue327.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output test-issue327.tex --lua-filter /Users/maraaverick/Library/R/arm64/4.2/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Users/maraaverick/Library/R/arm64/4.2/library/rmarkdown/rmarkdown/lua/latex-div.lua --embed-resources --standalone --highlight-style tango --pdf-engine pdflatex --variable graphics --variable 'geometry:margin=1in' 
output file: test-issue327.knit.md

Backtrace:
    x
 1. \-rmarkdown::render(...)
 2.   \-rmarkdown:::latexmk(...)
 3.     \-tinytex::latexmk(file, engine, if (biblatex) "biber" else "bibtex")
 4.       \-tinytex:::latexmk_emu(...)
 5.         \-tinytex (local) run_engine()
 6.           +-tinytex:::system2_quiet(...)
 7.           \-tinytex (local) on_error()
 8.             \-tinytex:::show_latex_error(file, logfile)
! LaTeX Error: Unicode character ^^[ (U+001B)
               not set up for use with LaTeX.

Error: LaTeX failed to compile test-issue327.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See test-issue327.log for more info.
Execution halted

With options(tinytex.verbose = TRUE):

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
I was unable to find any missing LaTeX packages from the error log test-issue327.log.
Backtrace:
    x
 1. \-rmarkdown::render(...)
 2.   \-rmarkdown:::latexmk(...)
 3.     \-tinytex::latexmk(file, engine, if (biblatex) "biber" else "bibtex")
 4.       \-tinytex:::latexmk_emu(...)
 5.         \-tinytex (local) run_engine()
 6.           +-tinytex:::system2_quiet(...)
 7.           \-tinytex (local) on_error()
 8.             \-tinytex:::show_latex_error(file, logfile)
! LaTeX Error: Unicode character ^^[ (U+001B)
               not set up for use with LaTeX.

Error: LaTeX failed to compile test-issue327.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See test-issue327.log for more info.
Execution halted

Everything knits fine with, say, library(dplyr), in place of library(tidyverse).

I am able to knit the file with messages and warnings turned off for the chunk with library(tidyverse) (or with just message=FALSE). Below knits to PDF fine:

---
title: "Test"
output: pdf_document
date: "`r Sys.Date()`"
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
options(tinytex.verbose = TRUE)
```

```{r message=FALSE, warning=FALSE}
library(tidyverse)
```

However, if the above Rmd has a chunk with tidyverse::tidyverse_conflicts() in it, you get the same error:

```{r}
tidyverse::tidyverse_conflicts()
```

from tidyverse.

bleds22e avatar bleds22e commented on September 25, 2024

@batpigandme when I use message = FALSE in the code chunk, it does work!

But I shouldn't have to put that to be able to knit something...

from tidyverse.

jttoivon avatar jttoivon commented on September 25, 2024

This is quite annoying. I have to hand-edit the tex file after each knit. I hope this will be fixed soon.

from tidyverse.

hadley avatar hadley commented on September 25, 2024

I think you're hitting r-lib/cli#581.

from tidyverse.

hadley avatar hadley commented on September 25, 2024

Two work arounds in the meantime:

  • Install the dev version of cli: pak::pak("r-lib/cli")
  • Suppress the tidyverse loading message everywhere by adding this to your .Rprofile: options(tidyverse.quiet = TRUE)

from tidyverse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.