I am unable to render PDF files from R Markdown properly due to the Chinese characters in an otherwise mostly English document, from a Windows 11 machine, using tinytex. I'm receiving the following error:
! Package fontspec Error: The font "SimHei" cannot be found.
That says it all. This post explains how to fix it in regular TeX, how that plays with tinytex is something I'm unsure of, so use this at your own risk
Thanks for your reply @technocrat - running tinytex::tlmgr_install("SimHei") returns the following:
tlmgr.pl install: package SimHei not present in repository.
tlmgr.pl: action install returned an error; continuing.
tlmgr.pl: package repository https://ctan.mirror.rafal.ca/systems/texlive/tlnet (not verified: pubkey missing)
tlmgr.pl: An error has occurred. See above messages. Exiting.
I'm fairly certain that tlmgr_install, and the post you are linking, is specifically for latex packages, not for fonts. Looking on CTAN, there does not appear to be a package named "SimHei".
Anyway. I'm calling the ctex package here because my browsing around has pointed me to that for the use of Chinese characters, but perhaps I'm going down the wrong path and should be using another package instead.
I may be further muddying the waters, but FWIW, I have this running after
sudo apt-get update
sudo apt install texlive-full
and knitting your sample document downloaded a lot of files. However, I don't know now whether RStudio is still rendering from tinytex or is using the system tex