Converting a Chinese .md File into PDF Using pandoc

debug
LaTeX
diary
Author

Guest_1013

Published

2026-08-04

pandoc is a powerful document converter; I tried to use it to convert a markdown file written in Chinese into a PDF file. However, LaTeX does not have very good support for Chinese characters.

One way of doing it is to specify the Chinese font:

pandoc example.md -o example.pdf --pdf-engine=xelatex -V CJKmainfont="SimSun"

However, the major drawback is that some of the special characters, like Greek characters and some arrows outside of LaTeX blocks, are not rendered correctly. A temporary solution is to fully embrace LaTeX and rewrite these special characters in LaTeX blocks.