rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

rocker/verse doesn't properly knit to PDF with tidyverse. #64

Closed sjbanner closed 6 years ago

sjbanner commented 6 years ago

A recent (I think) update to tidyverse added Unicode char √ (U+221A) to the output, which Pandoc complains about. When loading tidyverse:

── Attaching packages ─────────────────── tidyverse 1.2.1 ──
✔ ggplot2 2.2.1     ✔ purrr   0.2.4
✔ tibble  1.4.1     ✔ dplyr   0.7.4
✔ tidyr   0.7.2     ✔ stringr 1.2.0
✔ readr   1.1.1     ✔ forcats 0.2.0
── Conflicts ────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()

And when kniting...

! Package inputenc Error: Unicode char √ (U+221A)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.161 \end{verbatim}

Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF
Error: pandoc document conversion failed with error 43
Execution halted
sjbanner commented 6 years ago

Knit to HTML or Word work just fine. This is rocker/verse:latest.

eddelbuettel commented 6 years ago

Please do the hint suggests:

 Try running pandoc with --latex-engine=xelatex.

That is a well-documented rmarkdown option for the pdf workflow.

MarkusKonk commented 6 years ago

Hi, I guess I have a similar issue. xelatex did not work.

Minimal example (or in the attached zip file):

YAML header:

title: "session_info pandoc error" author: "" date: "8 Januar 2018" output: pdf_document: latex_engine: xelatex html_document: default

code chunk

install.packages("sessioninfo")
library(sessioninfo)
session_info()

I received the following error when running the rmd-file above in the container rocker/verse:3.4.2: pandoc: xelatex not found. xelatex is needed for pdf output. Error: pandoc document conversion failed with error 41 Execution halted

Any ideas?

Thanks in advance session_info_error.Rmd.zip

cboettig commented 6 years ago

@MarkusKonk it should work fine in rocker/verse:latest. tagged images didn't have xelatex or lualatex pre-installed.

Just migrated 3.4.1, 3.4.2, 3.4.3 to TinyTeX, along with latest, which includes all engines (and should make it easier to add additional latex .sty files directly from R, see https://yihui.name/tinytex), so those builds should be live soon.

MarkusKonk commented 6 years ago

It works, thank you very much.