knitr to pdf using xelatex doesn't wrap code chunks

22 Views Asked by At

title: "--" author: "JB" date: "2023-10-22" output: pdf_document: latex_engine: xelatex header-includes:

  • \usepackage{fontspec}
  • \setmainfont{Times New Roman}

library(knitr)
opts_chunk$set(tidy.opts=list(width.cutoff=40), tidy = TRUE)

Hello!

I'm trying to knit rmd to pdf and trying to use xelatex to change the font to times new roman. However, the above code cuts off the code chunk as the screenshot. How could I fix this? Thank you!

Screenshot

I've read many other stackoverflow's relevant questions and answers but couldn't find the answer for my question

0

There are 0 best solutions below