A ConTeXt Chinese typesetting toolkit featuring three core modules: exam generation, document layout, and style customization.
Chinese Version: README_CN.md
| Module | Type | Description |
|---|---|---|
| t-basicexam | Exam Generation | Multiple choice, fill-in-the-blank, reading comprehension, essay questions, cloze tests, etc. |
| t-memos | Document Layout | Multi-theme, multi-style document formatting solution with zhnumber and zhindex |
| s-poriginal | Style Module | Custom slide-like presentation styles similar to PowerPoint requiring visualcounter module |
- Multiple Choice Questions - Support for single and multiple selections with automatic grading
- Fill-in-the-Blank - Flexible answer formats
- Reading Comprehension - Support for long text material references
- Essay Questions - Free response spaces
- Cloze Tests - Text gap-filling with answer matching
- Answer Control - Centralized answer management
- Score Control - Flexible point configuration
- Question Header Control - Custom question numbering and formatting
\usemodule[basicexam][mode=teacher]
\startquestion[point=4,showanswer=true,answer=B]
This is the question stem.
\startchoice
\startcitem Option A \stopcitem
\startcitem[*] Option B (Correct Answer) \stopcitem
\startcitem Option C \stopcitem
\startcitem Option D \stopcitem
\stopchoice
\startanswer
This is the explanation.
\stopanswer
\stopquestion\question[point=4,showanswer=true]{Question stem.\choice{Option A,{[*]Option B},Option C,Option D}}\startquestion
The capital of China is \fillin{Beijing}.
\stopquestion\startclose[showanswer=true,point=10]
In spring, the season of \closechoice[flowers,leaves,birds,rain],
we \closechoice[walk,run,jump,fly] in the park.
\stopclose\startwriting[point=20]
Write an essay about environmental protection (at least 300 words).
\startanswer
Reference essay...
\stopanswer
\stopwritingIncludes pinyin (Pinyin annotation), bihua (Stroke display), zhnumber (Chinese numerals), and zhindex (Chinese index) functionality.
- Multiple Modes: print, kindle, draft, moresize
- Color Themes: red, blue, yellow, green, black, cyan, orange, purple, pink, gray, white
- Chapter Styles: default, simple, classics, classicnovel, colorful, line, rocket, hexa, madsen, kaolike, publish, artical
- TOC Styles: default, simple, classics, classicnovel, colorful, line, rocket, hexa, madsen
- Header Styles: book, novel, colorful, hctext, fctext, foemargin, foemarginalt, hoemargin
- Font Size System: Complete font sizes from 42pt to 3pt
- Multi-language Support: Chinese Simplified (hans), Traditional (hant), Japanese, English
% Load specific extension
\usemodule[memos][extra=pinyin]
\usemodule[memos][extra=bihua]
\usemodule[memos][extra=zhnumber]
\usemodule[memos][extra=index]
% Or load all extensions
\usemodule[memos][extra=all]Purpose: Automatically or manually adds pinyin (romanization) to Chinese characters for educational materials and language learning.
Main Commands:
| Command | Description | Example |
|---|---|---|
\startpinyinscope ... \stoppinyinscope |
Automatic pinyin annotation environment | See example below |
\xpinyin{text} |
Manual pinyin annotation | \xpinyin{汉字} → hànzì |
\xpinyin[pinyin]{char} |
Specify pinyin for polyphonic characters | \xpinyin[chong2]{重} |
\setuppinyin[...] |
Configure pinyin parameters | Set vsep, hsep, ratio, etc. |
Usage:
\usemodule[memos][extra=pinyin]
% Automatic annotation
\startpinyinscope
汉语拼音自动注音测试。
\stoppinyinscope
% Manual annotation
汉字:\xpinyin{手动注音测试}
% Polyphonic character
\xpinyin[chong2]{重}庆是一座美丽的城市。Purpose: Shows the stroke order and structure of Chinese characters for character teaching and calligraphy practice.
Main Commands:
| Command | Description | Example |
|---|---|---|
\bihuaload{chars} |
Load character data | \bihuaload{好学习} |
\bihuashow{char}{n} |
Display the nth stroke | \bihuashow{好}{3} |
\bihuashowall{char} |
Display all strokes | \bihuashowall{好} |
\definebihua[style][...] |
Define custom stroke style | Configure colors, frame, etc. |
Frame Types:
- outer: Outer frame only
- tian: Tian character grid (cross lines)
- mi: Mi character grid (cross + diagonal lines)
- x: Diagonal lines only
- none: No frame
Usage:
\usemodule[memos][extra=bihua]
\bihuaload{好学习}
% Display specific stroke
\bihuashow{好}{3}
% Display with frame
\bihuashow[frame=tian]{好}{3}
% Display all strokes
\bihuashowall{好学习}Purpose: Converts Arabic numerals to Chinese numeral expressions, supporting integers, decimals, fractions, dates, and Ganzhi (sexagenary cycle).
Main Commands:
| Command | Description | Example |
|---|---|---|
\zhnumber{num} |
Integer conversion | \zhnumber{12345} → 一万二千三百四十五 |
\zhnumber{decimal} |
Decimal conversion | \zhnumber{3.14} → 三点一四 |
\zhnumber{fraction} |
Fraction conversion | \zhnumber{1/2} → 二分之一 |
\zhdate{date} |
Date conversion | \zhdate{2024/1/1} → 二〇二四年一月一日 |
\zhtime{time} |
Time conversion | \zhtime{14:30} → 十四点三十分 |
\zhtiangan{n} |
Heavenly Stems | \zhtiangan{1} → 甲 |
\zhdizhi{n} |
Earthly Branches | \zhdizhi{1} → 子 |
\zhganzhinian{year} |
Ganzhi Year | \zhganzhinian{2024} → 甲辰年 |
Purpose: Provides intelligent Chinese index sorting with three sorting methods.
Sorting Methods:
- zh-pinyin: Sort by Pinyin pronunciation
- zh-alpha: Sort by alphabetical order
- zh-stroke: Sort by stroke count
Usage:
\usemodule[memos][extra=index]
\index{Peking University}
\index{Tsinghua University}
\setupregister[index][language=zh-pinyin]
\placeindexProvides custom slide-like presentation styles similar to PowerPoint. Requires the visualcounter module.
mtxrun --script install-modules --install visualcounter- Download the project files
- Place files in
tex/texmf-local/under your ConTeXt installation - Run
mtxrun --generateto refresh file index - Use modules in your TeX files:
\usemodule[basicexam]\usemodule[memos]\usemodule[poriginal]
- Chinese README - Complete documentation in Chinese
- basicexam Manual - Detailed usage guide
- memos Manual - Document layout documentation (English)
- memos Manual (Chinese) - Document layout documentation (Chinese)
- Test Files:
- test-exam.tex - Exam generation tests
- test-frame.tex - Frame tests
- test-poriginal.tex - Style module tests
- test-zhnumber.tex - Chinese numeral tests
- test-zhindex.tex - Chinese index tests
- test-pinyin.tex - Pinyin annotation tests
- test-bihua.tex - Stroke display tests




