Using Japanese in Quarto PDF Output
When outputting PDFs with Quarto, Japanese may not be displayed correctly with the default settings. This is because the LaTeX settings do not support Japanese by default. This article introduces settings for using Japanese in Quarto.
Preparation for PDF Output
To output PDF, LaTeX needs to be installed. The officially recommended option is TinyTeX.
Install it by running the following command in a terminal.
Terminal
quarto install tinytexLaTeX is a typesetting system for creating high-quality documents. It is widely used especially for academic papers and technical documents. Although there are many commands to learn, you do not need a deep understanding of LaTeX just to output PDFs from Quarto.
If you try to output a PDF when LaTeX is not installed, an error occurs. In that case, Quarto displays a message suggesting that you run quarto install tinytex to install TeX.
How to Output PDF
To output PDF with Quarto, specify format: pdf in the YAML header.
---
title: "Document Title"
format: pdf
---With this setting, Quarto generates the document in PDF format. However, Japanese may not display correctly as-is.
Settings for Displaying Japanese Correctly
To display Japanese correctly, add the following setting to the YAML header.
---
title: "Document Title"
format:
pdf:
CJKmainfont: "BIZ UDPGothic" # specify the Japanese font to use
---