I'm new to getting LaTeX working in R Markdown and have the following error when I tried to knit the tufte template from github:

! Package fontspec Error: The font "Kaiti SC" cannot be found.

! kpathsea:make_tex: Invalid filename `Kaiti SC/OT:language=dflt;', contains ' '

Working on Mac OS Catalina, latest version of R, using xelatex.

Does anyone know how to fix this? I have that exact font in my fontBook. So disappointing to see execution halted after half an hour.

  • 2
    Hard to tell without code
    – DG'
    Mar 18, 2021 at 16:48

1 Answer 1


I figured Kaiti SC must have something to do with Chinese Fonts and there are some Chinese characters I stripped out and have managed to get it to execute to pdf. Below code altered from github:


title: "Tufte"
subtitle: "一R Markdown"
author: "JJ Allaire,"
date: "`r Sys.Date()`"
    citation_package: natbib
    latex_engine: xelatex
    citation_package: natbib
    latex_engine: xelatex
  tufte::tufte_html: default
ctex: yes
bibliography: skeleton.bib
link-citations: yes

```{r setup, include=FALSE}
knitr::opts_chunk$set(cache.extra = packageVersion('tufte'))
options(htmltools.dir.version = FALSE)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .