I'm trying to put together some course notes as a PDF, and am having trouble getting certain Unicode characters to display properly.
Using the xelatex latex engine is necessary for the document to be rendered at all (using the default engine results in an error due to the unrecognized characters), however, only the first Unicode character (uppercase delta) is displayed properly.
For example, when using the rmarkdown
- works - Δ
- doesn't work - ⌘
iconv -f UTF-8 your_file -o /dev/null
The problem might be that the default font does not have that character. You'll need to find a font that has it. On Linux,
fc-list lists the fonts that are available on your computer. Pick one and add it to your yaml front matter:
--- output: pdf_document: latex_engine: xelatex mainfont: FreeMono --- - works - Δ - doesn't work - ⌘
Here, I am using FreeMono, which is the first one I found that has the ⌘ character, but there probably is a better one.