tinytex package issue on Mac M1

The issue of installing tinytex package on Mac M1.

When knitr LaTex file, the error message is like:

! sh: xelatex: command not found

Solve:

run this in your terminal (not in the R console):

# create the dir if it doesn't exist
[ -e /usr/local/bin ] || sudo mkdir -p /usr/local/bin
# change owner of the dir
sudo chown -R `whoami`:admin /usr/local/bin


~/Library/TinyTeX/bin/*/tlmgr path add
Chen Xing
Chen Xing
Founder & Data Scientist

Enjoy Life & Enjoy Work!

Related