> ## 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)

> Fix "Font unisong30 at 632 not found" and the default Fandol ctex error under pdfLaTeX. Compile with XeLaTeX, or use CJKutf8 with gbsn on pdfLaTeX.

In a `ctex` document compiled with `pdfLaTeX`, `Font unisong30 at 632 not found` means pdfTeX could not load the Chinese font `unisong30`. Compile it with `XeLaTeX` instead — the document itself does not need to change.```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!
```The font number and size (`unisong30 at 632` above) vary with the document and its font size.## Why `pdfLaTeX` fails`ctex` loads its Chinese fonts from a font set. In TeX Live 2026 on Linux, its default Fandol font set requires `XeLaTeX` or `LuaLaTeX`. Under `pdfLaTeX`, the Fandol diagnostic (``CTeX fontset `fandol' is unavailable in current mode``) identifies an unsupported font set, and a nonstop run can also report a missing `unisong` font from CJK. TeX Live includes `.tfm` font-metric files for `unisong` (and `cyberb`), but does not ship the usable outline or bitmap glyph fonts, so `pdfTeX` stops with a fatal error and produces no PDF. (Passing `fontset=none` lets a minimal `ctexart` document compile under `pdfLaTeX`, but leaves you without configured Chinese fonts.)## 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 `XeLaTeX`Change the compiler, not the document. The same source compiles cleanly 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}
```**Rendered output**Compiled PDF page 1 from ctex-xelatex.tex**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 `pdfLaTeX`Some journal or university templates only build with `pdfLaTeX`. In that case, do not load `ctex`. Use `CJKutf8` 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}
```**Rendered output**Compiled PDF page 1 from cjkutf8-pdflatex.texThis only typesets the characters. `ctex` features such as localized Chinese captions (`目录`, `参考文献`) and `\zihao` are unavailable under `CJKutf8`, so prefer `XeLaTeX` whenever your template allows it.### The same error with the `CJK` package`\begin{CJK}{UTF8}{song}` fails under `pdfLaTeX` in the same way with a different missing 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- For these errors, LaTeX Cloud Studio keeps an explicit **PDFLaTeX** choice. The Problems panel can show one or both of two messages: a missing Chinese font (such as `Chinese font unisong30 is not available for pdfLaTeX`, naming the failing font) and `CTeX font set 'fandol' is unavailable with the selected engine`. Open **Settings** -> **General** and set **LaTeX Engine** to **Auto (Recommended)** or **XeLaTeX**.
- **Auto (Recommended)** is the default and initially selects **XeLaTeX** when it finds an indicator for `ctex`, the `ctex` classes, `xeCJK`, `fontspec`, `polyglossia`, or `\setCJKmainfont`, unless it finds a higher-priority LuaTeX-ja package or class indicator, which selects **LuaLaTeX**.
- If a template requests a commercial or local Chinese font that is unavailable in the compiler image, upload the `.ttf` or `.otf` font files to your project and load them by their uploaded path with `xeCJK` or `fontspec`.Want a Chinese `ctexart` project that compiles out of the box? [Start from the Chinese Article (ctex) template in LaTeX Cloud Studio](https://app.latex-cloud-studio.com/start?template=ctex-article\&utm_source=resources\&utm_medium=next_step\&utm_campaign=docs_open_app\&utm_content=learn_latex_troubleshooting_ctex_font_unisong_not_found).## 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.