> ## Documentation Index
> Fetch the complete documentation index at: https://resources.latex-cloud-studio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fix "Font unisong not found" in Chinese LaTeX (ctex)

> pdfLaTeX cannot compile ctex documents: "Font unisong30 at 632 not found". Compile Chinese LaTeX with XeLaTeX, or use CJKutf8 with gbsn on pdfLaTeX.

```log pdflatex.log theme={null}
.../ctex/fontset/ctex-fontset-fandol.def:103: Critical Class ctexart Error: CTeX fontset `fandol' is unavailable in
(ctexart)                       current mode.

!pdfTeX error: pdflatex (file unisong30): Font unisong30 at 632 not found
 ==> Fatal error occurred, no output PDF file produced!
```Your document uses ctex (`\documentclass{ctexart}`, `ctexbook`, `ctexrep`, `ctexbeamer`, or
`\usepackage{ctex}`) and it was compiled with pdfLaTeX. Compile it with XeLaTeX instead. The
document itself does not need to change.The font number and size in the message (`unisong30 at 632` above) vary with the document and
its font size. Every variant has the same cause and the same fix.## Why pdfLaTeX failsctex loads its Chinese fonts from a font set. In TeX Live 2026 on Linux, which is the
environment the examples on this page are compiled in, ctex selects the Fandol font set. That
font set needs XeLaTeX or LuaLaTeX, so under pdfLaTeX ctex reports
``CTeX fontset `fandol' is unavailable in current mode`` and falls back to the old `unisong`
font names of the CJK package. TeX Live does not include those fonts, so pdfTeX stops with a
fatal error and writes no PDF.The first message is the cause. The `unisong` message is the consequence, and it is the one most
logs show last.## Minimal failing example```latex ctex-pdflatex.tex theme={null}
% Fails when the compiler is pdfLaTeX
\documentclass{ctexart}
\begin{document}
你好，世界。This line mixes Chinese and English.
\end{document}
```<details><summary>Compiler result</summary>
      \> \\[!WARNING]
\>
\> This example is intentionally invalid. The automated example test verifies that compilation fails with: `Critical Class ctexart Error: CTeX fontset`.</details>## Fix: compile with XeLaTeXChange the compiler, not the document. The same source compiles with XeLaTeX:```latex ctex-xelatex.tex theme={null}
% Same document, compiled with XeLaTeX
\documentclass{ctexart}
\begin{document}
你好，世界。This line mixes Chinese and English.
\end{document}
```<details>
  <summary>Rendered output</summary>
  Open zoomable preview: Compiled PDF page 1 from ctex-xelatex.tex

  Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment.

  [Open SVG](https://resources.latex-cloud-studio.com/images/rendered/learn-latex-troubleshooting-ctex-font-unisong-not-found-02/page-1.svg)
</details>**Ready to use this syntax?** Continue in the browser editor when you want to adapt the example in a real project.[Open LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?utm_source=resources\&utm_medium=rendered_output\&utm_campaign=docs_open_app\&utm_content=learn_latex_troubleshooting_ctex_font_unisong_not_found)On the command line, run `xelatex main.tex` or `latexmk -xelatex main.tex` instead of
`pdflatex main.tex`. LuaLaTeX (`lualatex main.tex`) also compiles this document.## If you must stay on pdfLaTeXSome journal or university templates only build with pdfLaTeX. In that case, do not load ctex.
Use the `CJKutf8` package with a font that TeX Live ships, such as `gbsn` (Simplified Chinese,
Song style), `gkai` (Simplified Chinese, Kai style), or `bsmi` (Traditional Chinese):```latex cjkutf8-pdflatex.tex theme={null}
% pdfLaTeX only: CJKutf8 with the gbsn font that TeX Live ships
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{gbsn}
你好，世界。
\end{CJK}
This line is ordinary English text.
\end{document}
```<details>
  <summary>Rendered output</summary>
  Open zoomable preview: Compiled PDF page 1 from cjkutf8-pdflatex.tex

  Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment.

  [Open SVG](https://resources.latex-cloud-studio.com/images/rendered/learn-latex-troubleshooting-ctex-font-unisong-not-found-03/page-1.svg)
</details>This only typesets the characters. ctex features such as Chinese captions (`目录`, `参考文献`)
and the `\zihao` font-size command are not available, so prefer XeLaTeX whenever the template
allows it.### The same error with the CJK package`\begin{CJK}{UTF8}{song}` fails under pdfLaTeX in the same way, with a different font name:```log pdflatex.log theme={null}
!pdfTeX error: pdflatex (file cyberb30): Font cyberb30 at 600 not found
 ==> Fatal error occurred, no output PDF file produced!
```Replace `song` with `gbsn`, or switch to XeLaTeX and ctex.## In LaTeX Cloud Studio- The project's **LaTeX Engine** setting defaults to **Auto (Recommended)**. With Auto, a
  document that uses `ctex`, `ctexart`, `ctexbook`, `ctexrep`, `ctexbeamer`, `xeCJK`, `fontspec`,
  or `polyglossia`, or calls `\setCJKmainfont`, compiles with XeLaTeX. Packages loaded from your
  own `.sty` and `.cls` files count too, and commented-out lines are ignored.
- Documents that use `luatexja` or the `ltjs*` classes for Japanese compile with LuaLaTeX.
- If the engine is set to **PDFLaTeX** explicitly, that choice is kept and the compile fails. The
  Problems panel then shows `Chinese font unisong30 is not available for pdfLaTeX`. Open the
  project **Settings**, and under **General** set **LaTeX Engine** to **Auto (Recommended)** or
  **XeLaTeX**.## Related pages- [LaTeX in Chinese](https://resources.latex-cloud-studio.com/learn/latex/languages/chinese.md): set up a Chinese document with XeLaTeX and xeCJK
- [Compiler and engine errors](https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/compiler-and-engine-errors.md): `fontspec` and other engine mismatches
- [Choosing a compiler](https://resources.latex-cloud-studio.com/learn/latex/basics/choosing-compiler.md): pdfLaTeX, XeLaTeX, and LuaLaTeX compared
- [LaTeX in Japanese](https://resources.latex-cloud-studio.com/learn/latex/languages/japanese.md)
- [Emergency stop](https://resources.latex-cloud-studio.com/learn/latex/troubleshooting/emergency-stop.md): when the compile stops before `\end{document}`
- [Troubleshooting center](https://resources.latex-cloud-studio.com/learn/latex/troubleshooting.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.