English | 简体中文
CTeX-kit is a collection of TeX/LaTeX macro packages, scripts, and resources for Chinese typesetting. Maintained by the CTeX community, it brings together ctex, xeCJK, zhspacing, and other components to provide unified, reliable Chinese typesetting infrastructure across different TeX engines.
| Package | CTAN Version | Description |
|---|---|---|
| ctex | Chinese document classes and package bundle — font configuration, heading schemes, and multi-engine adaptation | |
| xeCJK | CJK font management, character spacing, and punctuation kerning for XeLaTeX |
| Package | CTAN Version | Description |
|---|---|---|
| CJKpunct | CJK punctuation kerning and spacing | |
| xCJK2uni | Legacy CJK encoding to Unicode mapping | |
| xpinyin | Automatic pinyin annotation for Chinese characters | |
| zhnumber | Chinese number and date formatting | |
| zhlineskip | Automatic line spacing adjustment for CJK–Latin mixed text | |
| zhspacing | Automatic CJK–Latin inter-character spacing (LuaTeX approach) | |
| zhmetrics | Chinese font metrics | |
| zhmetrics-uptex | Chinese font metrics for upTeX |
All packages are included in TeX Live and MiKTeX — no manual installation is needed. To use the development version, clone this repository directly.
Using the ctexart document class:
\documentclass{ctexart}
\begin{document}
你好,\LaTeX{}!
\end{document}Using the ctex package with a standard document class:
\documentclass{article}
\usepackage{ctex}
\begin{document}
你好,\LaTeX{}!
\end{document}Supported engines: XeLaTeX, LuaLaTeX, pdfLaTeX (with CJK package), and upLaTeX. XeLaTeX or LuaLaTeX is recommended for the best experience.
ctex-kit/
├── ctex/ # Core: Chinese document classes and packages
├── xeCJK/ # Core: XeLaTeX CJK support
├── CJKpunct/ # CJK punctuation kerning
├── xCJK2uni/ # CJK encoding conversion
├── xpinyin/ # Pinyin annotation
├── zhnumber/ # Chinese numbers
├── zhlineskip/ # Line spacing adjustment
├── zhspacing/ # CJK–Latin spacing
├── zhmetrics/ # Font metrics
├── zhmetrics-uptex/ # upTeX font metrics
├── jiazhu/ # Interlinear annotation (jiazhu)
├── gbk2uni/ # GBK→Unicode conversion tool
├── gbkmac/ # GBK encoding support (macOS)
├── zh-luatex/ # LuaTeX Chinese experimental support
├── support/ # Shared build configuration and support files
└── .github/ # CI/CD configuration
This project uses l3build as its build and test framework.
# Run ctex test suite
cd ctex
l3build check
# Run xeCJK test suite
cd xeCJK
l3build check
# Build CTAN release package
l3build ctanCI tests against the current TeX Live release on Ubuntu, macOS, and Windows, covering five test suites: ctex, xeCJK, zhnumber, CJKpunct, and zhlineskip.
- Programming framework: LaTeX3 / expl3
- Literate programming: docstrip (
.dtxsource files) - Build system: l3build
- CI/CD: GitHub Actions (testing + automated releases)
Bug reports via Issues and code contributions via Pull Requests are welcome.
Before submitting code, please ensure:
- All relevant tests pass (
l3build check) - Code follows expl3 conventions
- Changes to
.dtxfiles include\changesentries
Packages in this project are released under the LPPL v1.3c (LaTeX Project Public License).
Copyright © 2003–2026 CTeX Community