Skip to content

Latest commit

 

History

History
129 lines (93 loc) · 5.64 KB

File metadata and controls

129 lines (93 loc) · 5.64 KB

CTeX-kit

ctex-kit test

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.

Core Packages

Package CTAN Version Description
ctex CTAN Chinese document classes and package bundle — font configuration, heading schemes, and multi-engine adaptation
xeCJK CTAN CJK font management, character spacing, and punctuation kerning for XeLaTeX

Satellite Packages

Package CTAN Version Description
CJKpunct CTAN CJK punctuation kerning and spacing
xCJK2uni CTAN Legacy CJK encoding to Unicode mapping
xpinyin CTAN Automatic pinyin annotation for Chinese characters
zhnumber CTAN Chinese number and date formatting
zhlineskip CTAN Automatic line spacing adjustment for CJK–Latin mixed text
zhspacing CTAN Automatic CJK–Latin inter-character spacing (LuaTeX approach)
zhmetrics CTAN Chinese font metrics
zhmetrics-uptex CTAN Chinese font metrics for upTeX

Quick Start

Installation

All packages are included in TeX Live and MiKTeX — no manual installation is needed. To use the development version, clone this repository directly.

Basic Usage

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.

Repository Structure

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

Building and Testing

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 ctan

CI tests against the current TeX Live release on Ubuntu, macOS, and Windows, covering five test suites: ctex, xeCJK, zhnumber, CJKpunct, and zhlineskip.

Technology Stack

  • Programming framework: LaTeX3 / expl3
  • Literate programming: docstrip (.dtx source files)
  • Build system: l3build
  • CI/CD: GitHub Actions (testing + automated releases)

Contributing

Bug reports via Issues and code contributions via Pull Requests are welcome.

Before submitting code, please ensure:

  1. All relevant tests pass (l3build check)
  2. Code follows expl3 conventions
  3. Changes to .dtx files include \changes entries

Related Links

License

Packages in this project are released under the LPPL v1.3c (LaTeX Project Public License).


Copyright © 2003–2026 CTeX Community