clreq-gap for typst 2025-06-21, typst v0.13.1

Chinese Layout Gap Analysis for Typst.

分析 Typst 与中文排版的差距。

Introduction 导语

Typst is a markup-based typesetting software, and this document describes gaps for the support of the Chinese script within Typst. In particular, it is concerned with text layout and bibliography. It examines whether needed features are supported by the typst compiler, and provides information on potential workarounds.

Typst 是一款基于标记的排版软件,这份文档描述了它在中文支持方面的差距,特别是排版参考文献著录。本文会检查 typst 编译器是否支持所需功能,并介绍可能的临时解决方案。

This document also attempts to prioritize the gaps in terms of the impact on Chinese end authors. The prioritization is indicated by colour, as shown in Table 1.

根据对中文最终作者的影响程度,本文还尝试给这些差距排出优先顺序。优先级用颜色表示,如 Table 1 所示。

Table 1: Priority levels 优先级

⚠ This document is only an early draft. Additionally, it is not endorsed by either W3C or Typst GmbH. Please refer to it with caution.

⚠ 这份文档仅是早期草稿。此外,本文并无 W3CTypst GmbH 背书。请谨慎参考。

1 Text direction 文本方向

See also §6.1 for features such as column layout, page turning direction, etc. that are affected by text direction.

分栏布局、翻页方向等也受文本方向影响,这些请参阅§6.1.

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

1.1 Writing mode 行文模式

In what direction does text flow along a line and across a page? (If the basic direction is right-to-left see §1.2.) If the script uses vertically oriented text, what are the requirements? What about if you mix vertical text with scripts that are normally only horizontal? Do you need a switch to use different characters in vertical vs. horizontal text? Does typst support short runs of horizontal text in vertical lines (tate-chu-yoko in Japanese) as expected? Is the orientation of characters and the directional ordering of characters supported as needed?

文本在行内和跨页时分别沿什么方向书写?(若基本方向就时从右到左,请移步§1.2)如果文段可能沿竖直方向排列(直排),有哪些要求?若直排文段中混入其它文字,而这种文字通常水平书写,又如何?是否需要开关以在直排、横排时使用不同字符?typst 能否正常在直排文本中将小段文本按横排插入(日文的“纵中横”)?字符的朝向及排列方向符合需求吗?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Vertical Writing Mode 直排

Advanced typst#5908

There are two writing modes in Chinese composition:

中文有两种行文模式:

Compared with horizontal writing mode, vertical writing mode not only changes the direction of the text flow, but also adjusts the form, size, and position of punctuation marks (as shown in Figure 1 and Figure 2). Additionally, it requires adapting to mixed Chinese-Western text, captions of figures, multi-column layout, and more.

与横排相比,直排除了更改行文方向,还会调整标点符号的形态、尺寸、位置(如 Figure 1、Figure 2),此外还需适配中西混排、图表标题、分栏等。

Considering that typst currently struggles even with basic vertical typesetting, we will not cover issues related to vertical writing mode in the following sections.

鉴于 typst 目前连基础直排也难以实现,下文各节将不再讨论直排相关的问题。

《永樂大典》The Yongle Encyclopedia
Figure 1: An ancient example of vertical text 直排的古代例子
Straight and wavy lines alongside vertical text 直排行间的专名号与书名号
Figure 2: A modern example of vertical text 直排的现代例子

1.2 Bidirectional text

If the general inline direction is right-to-left, are there any issues when handling that? Where the inline direction of text is mixed, is this bidirectional text adequately supported? What about numbers and expressions? Do the Unicode bidi controls and typst markup provide the support needed? Is isolation of directional runs problematic?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Not applicable

2 Glyph shaping & positioning 字形的变形与定位

2.1 Fonts selection 字体选择

Do the standard fallback fonts used in typst match expectations? Is it convenient to select fonts?

typst 的标准回落字体符合预期吗?选择字体方便吗?

Writing Chinese without configuring any font leads to messy font fallback 若不配置字体就写中文,回落出的字体会很混乱

Advanced typst#5040 typst#5900 fix (doc-cn)

The default main text font in typst does not include Chinese characters. Therefore, when compiling locally, if you write Chinese without configuring any font using #set text(font: …), the fallback result may end up mixing fonts of different writing styles (as shown in Figure 3), making the text hard to read. Moreover, there is no warning or hint.

typst的正文默认字体不含汉字。因此本地编译时,若不用#set text(font: …)配置字体就写中文,回落结果可能混合不同风格的字体(如 Figure 3),难以阅读,且无任何警告或提示。

“为什么字体这么奇怪”, literally “Why is the font so strange”
Figure 3: The result might be a mixture of sans and serif fonts 结果可能混合了黑体和宋体

Wrong monospace font fallback for Chinese in raw block 代码块内汉字回落的等宽字体不正常

Advanced typst#3385 fix (doc-cn)

This issue continues the above issue.

这一问题接续上一问题。

Apart from the main text, typst presets another font for raw code blocks, which does not include Chinese characters either. Currently, this setting takes precedence over the main text font you specified, forcing you to re-declare the Chinese font by #show raw: set text(font: …).

在正文之外,typst对raw代码块预设了另一字体,同样不含汉字。该设置目前优先于你指定的正文字体,导致必须用#show raw: set text(font: …)再次指定中文字体。

Language-dependant font configuration 按语言设置字体

Basic typst#794

For punctuation marks such as quotation marks (see §4.2), Chinese and Western scripts share the same Unicode code points, but require different glyph forms. Therefore, their fonts must be set respectively.

对于引号(见 §4.2)等标点符号,中西文在Unicode中共用码位w3c/clreq#534 ,但要求不同形态,故必须分开设置字体。

我说:“T'Pol 是‘虚构’人物!”

2.2 Font rendering & font styles 字体渲染与字体风格

How are fonts grouped into recognisable writing styles? How is each writing style used? Are special font or OpenType features needed for this script that are not available? What other general, font-related issues arise? The font styles described here refer to alternative types of writing style, such as naskh vs nastaliq; for oblique, italic, and weights see instead §2.5.

字体如何分类成可辨识的字体风格?如何使用各类字体风格?这种文字是否还需要尚不可用的特定字体或 OpenType 特性? 还有哪些字体相关的一般问题?此处“字体风格”是指书写风格的不同变体,例如阿拉伯文中naskh与nastaliq;至于倾斜体(oblique)、意大利体(italic)以及各级字重,请移步§2.5

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Size per font 按字体设置字号

Advanced typst#6295

It is common to use different fonts for Chinese and Western characters, and the visual sizes of different fonts may need to be fine-tuned for alignment.

中西文经常采用不同字体,而不同字体的视觉大小可能需要微调对齐。

共10人

Variable font 可变字体

Advanced typst#185 typst#6054 fix (github)

Variable fonts offer more creative possibilities and have higher storage efficiency. Given the vast number of Chinese characters, designing and storing traditional static fonts can be challenging — for example, a static Noto Sans CJK OTF/TTC is often ~100 MB. This makes variable fonts especially valuable for the Chinese language.

可变字体的创意可能性更多,并且存储效率更高。汉字数量庞大,设计、存储传统不可变字体都相对困难——例如不可变思源黑体一般有 ~100 MB,所以可变字体对中文有独特价值。

#set text(font: "Source Han Serif SC VF")
可变字体

2.3 Context-based shaping and positioning

If context-sensitive rendering support is needed to shape combinations of letters or position certain glyphs relative to others, is this adequately provided for? Does the script in question require additional user control features to support alterations to the position or shape of glyphs, for example adjusting the distance between the base text and diacritics, or changing the glyphs used in a systematic way? Do you need to be able to compose/decompose conjuncts or ligatures, or show characters that are otherwise hidden, etc? If text is cursive, see the separate §2.4.

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Not applicable

2.4 Cursive text

If this script is cursive (ie. letters are generally joined up, like in Arabic, N’Ko, Syriac, etc), are there problems or needed features related to the handling of cursive text? Do cursive links break if parts of a word are marked up or styled? Do Unicode joiner and non-joiner characters behave as expected?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Not applicable

2.5 Letterform slopes, weights, & italics 字体斜度、字重、意大利体

This covers ways of modifying the glyphs for a range of text, such as for italicisation, bolding, oblique, etc. Are italicisation, bolding, oblique, etc relevant? Do italic fonts lean in the right direction? Is synthesised italicisation or oblique problematic? Are there other problems relating to bolding or italicisation - perhaps relating to generalised assumptions of applicability? For alternative writing/font styles, see §2.2.

这节讨论针对一串文本的字形的修改方法,例如意大利体(italic)、粗体、倾斜体(oblique)等。是否有意大利体、粗体、倾斜体的概念?意大利体的倾斜方向正确吗?倾斜体(即伪意大利体)有问题吗?还有其它加粗、倾斜相关的问题吗——也许某些普遍假设并不适用?至于各类字体风格,请移步§2.2

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Fake (synthesized) bold 伪粗体

Basic typst#394 fix (universe/cuti) fix (doc-cn)

Classic Chinese fonts often have only one level of text weight. Therefore, fake bold is crucial in practice.

传统中文字体通常只有单级字重,所以伪粗体在实用中很关键。

#set text(font: "SimSun")
想做出*最好的*灯泡。

2.6 Case & other character transforms

Does your script need special text transforms that are not supported? For example, do you need to to convert between half-width and full-width presentation forms? Does your script convert letters to uppercase, capitalised and lowercase alternatives according to your typographic needs? How about other transforms?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Not applicable

3 Typographic units 排版单元

3.1 Characters & encoding 字符与编码

Most languages are now supported by Unicode, but there are still occasional issues. In particular, there may be issues related to ordering of characters, or competing encodings (as in Myanmar), or standardisation of variation selectors or the encoding model (as in Mongolian). Are there any character repertoire issues preventing use of this script in typst? Do variation selectors need attention? Are there any other encoding-related issues?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

3.2 Grapheme/word segmentation & selection

This is about how text is divided into graphemes, words, sentences, etc., and behaviour associated with that. Are there special requirements for the following operations: forwards/backwards deletion, cursor movement & selection, character counts, searching & matching, text insertion, line-breaking, justification, case conversions, sorting? Are words separated by spaces, or other characters? Are there special requirements when double-clicking or triple-clicking on the text? Are words hyphenated? (Some of the answers to these questions may be picked up in other sections, such as §5.1, or §5.6.)

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

4 Punctuation & inline features 标点符号及其它行内特性

4.1 Phrase & section boundaries 短语与章节边界

What characters are used to indicate the boundaries of phrases, sentences, and sections? What about other punctuation, such as dashes, connectors, separators, etc? Are there specific problems related to punctuation or the interaction of the text with punctuation (for example, punctuation that is separated from preceding text but must not be wrapped alone to the next line)? Are there problems related to bracketing information or demarcating things such as proper nouns, etc? Some of these topics have their own sections; see also §4.2, and §4.4.

表示短语、句子或段落的边界用什么字符?破折号、连接符、分隔符等其它标点符号呢?关于标点符号或,或者文字与标点符号相互作用,是否存在特定问题(例如某标点符号与前文分开,但不允许换至下一行)?专有名词等需要明确括住的信息,使用正常吗?其中部分话题有专门章节,参见§4.2§4.4

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

4.2 Quotations & citations 引文

This is a subtopic of phrase & section boundaries that is worth handling separately. What characters are used to indicate quotations? Do quotations within quotations use different characters? What characters are used to indicate dialogue? Are the same mechanisms used to cite words, or for scare quotes, etc? What about citing book or article names? Are there any issues when dealing with quotations marks, especially when nested? Should block quotes be indented or handled specially? Do quotation marks take text direction into account appropriately?

有些短语或章节边界需要单独处理,本节讨论这方面话题。引语用什么字符标识?引文中的引文是否要用不同字符?对话用什么字符标识?引用单词(即 scare quotes)的方法相同吗?引用书籍或文章名标题呢?处理引号有无问题,特别是嵌套时?用于整段的引号需要缩进或特别处理吗?引号是否考虑了文本方向?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Quotation marks should have different widths for Chinese and Western text 中西文引号的宽度应当不同

Basic typst#5858 fix (doc-cn)

Both Chinese and Western quotation marks (and apostrophes) use the same Unicode code points:

中西文的引号(及撇号)都使用相同Unicode码位:

But punctuation in Chinese is usually supposed to be wider than that in Western languages. This cannot be achieved automatically yet.

但中文的标点通常应该比西文的宽。当前这还无法自动实现。

我说:“T'Pol 是‘虚构’人物!”

4.3 Emphasis & highlighting 强调与突出显示

How are emphasis and highlighting achieved? If lines or marks are drawn alongside, over or through the text, do they need to be a special distance from the text itself? Is it important to skip characters when underlining, etc? How do things change for vertically set text?

如何强调或突出显示一串文本?若在文字旁边、文字上方上方或穿过文字划线或者做标记,是否需与文字保持特定距离?加下划线时是否需要跳过某些字符?直排时规则又如何?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Underline breaks when mixing Chinese and Western text 中西文下划线错位

Advanced typst#1210 typst#1716 (comment) fix (doc-cn)

Unlike the Latin alphabet, Chinese characters have no concept of ascenders and descenders. Therefore, underlines in Chinese should be drawn completely below the glyphs. Additionally, it is common to use different fonts for Chinese and Western characters, creating more difficulties in aligning the underline.

与拉丁字母不同,汉字没有升降部的概念,所以中文的下划线应当完全在字符之下。此外,中西文常用不同字体,导致下划线更难对齐。

#underline[中文和English]

4.4 Abbreviation, ellipsis, & repetition 缩写、省略与重复

What characters or other methods are used to indicate abbreviation, ellipsis & repetition? Are there problems?

缩写、省略和重复用什么字符或方法表示?有问题吗?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

4.5 Inline notes & annotations 行内注与行间注

What mechanisms, if any, are used to create inline notes and annotations? Are the appropriate methods for inline annotations supported for this script? Both Hanyu Pinyin (Romanization) and Bopomofo (Phonetic Symbols) are included. This section deals with inline annotation approaches. For annotation methods where a marker in the text points out to another part of the document, see §6.3.

如果这种文字有行内注与行间注,分别采用什么机制?相关方法是否支持?汉语拼音、注音符号都算在内。本节关注行内注释;至于指向文档其它部分的注释,请参考§6.3

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Add support for ruby (CJK, e.g., furigana for Japanese) 支持标注拼音

Advanced typst#1489

warichu 割注

Advanced typst#193 (mentioned)

4.6 Text decoration & other inline features 文本标示与其他行内特性

This section is a catch-all for inline features that do not fit under the previous sections. It can also be used to describe in one place a set of general requirements related to inline features when those features appear in more than one of the sections above. It covers characters or methods (eg. text decoration) that are used to convey information about a range of text. Are all needed forms of highlighting or marking of text available, such as wavy underlining, numeric overbars, etc. If lines are drawn alongside, over or through the text, do they need to be a special distance from the text itself? Is it important to skip characters when underlining, etc? How do things change for vertically set text? Are there other punctuation marks that were not covered in preceding sections? Are lines correctly drawn relative to vertical text?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

4.7 Data formats & numbers 数据格式与数字

Relevant here are formats related to number, currency, dates, personal names, addresses, and so forth. If the script has its own set of number digits, are there any issues in how they are used? Does the script or language use special format patterns that are problematic (eg. 12,34,000 in India)? What about date/time formats and selection - and are non-Gregorian calendars needed? Do percent signs and other symbols associated with number work correctly, and do numbers need special decorations, (like in Ethiopic or Syriac)? How about the management of personal names, addresses, etc. in typst: are there issues?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Numbers in Chinese 中文数字

OK

#numbering("一", 299792458)

#numbering("壹", 299792458)

Natively supported. Mentioned here to prevent future people from reimplementing it.

内置支持。为避免又有人不知道而重复开发,提及一下。

5 Line and paragraph layout 行与段落版式

5.1 Line breaking & hyphenation 换行与断词连字

Does typst capture the rules about the way text in your script wraps when it hits the end of a line? Does line-breaking wrap whole words at a time, or characters, or something else (such as syllables in Tibetan and Javanese)? What characters should not appear at the end or start of a line, and what should be done to prevent that? Is hyphenation used for your script, or something else? If hyphenation is used, does it work as expected? (Note, this is about line-end hyphenation when text is wrapped, rather than use of the hyphen and related characters as punctuation marks.)

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

OK

5.2 Text alignment & justification 文本对齐

When text in a paragraph needs to have flush lines down both sides, does it follow the rules for your script? Does the script need assistance to conform to a grid pattern? Does your script allow punctuation to hang outside the text box at the start or end of a line? Where adjustments are need to make a line flush, how is that done? Do you shrink/stretch space between words and/or letters? Are word baselines stretched, as in Arabic? What about paragraph indents, or the need for logical alignment keywords, such as start/end, rather than left/right? Does the script indent the first line of a paragraph?

若一段内的文字需要两端对齐,结果是否符合这种文字的习惯?文字是否需要辅助才能符合网格模式?这种文字允许标点符号在一行头尾悬挂到文本框以外吗?需要对齐某条线时,应当如何操作?正常会伸缩词间距、字间距吗?是否会像阿拉伯文那样拉伸文字基线?段落缩进如何,而逻辑对齐关键字(例如start/end而非left/right)又如何?这种文字是否缩进段落首行?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

CJK-latin glues stretch only before latin characters 中西间距只在拉丁字母之前拉伸

Advanced typst#6062

#set par(justify: true)
#block(width: 3em)[第1回成段]

Strict grid aligned in both horizontal and vertical axes 严格纵横对齐的网格

Advanced typst#4404

#set par(justify: true)
#block(width: 7.5em)[
天生我材必有用千金散尽还复来烹羊宰牛且为乐会须一饮三百杯
]

Brackets at the beginning of paragraph 段首的方括号

To be done typst#4011

Parenthetical indication punctuation marks at the start of paragraphs are not adjusted sometimes 段首的夹注符号有时不会调整间距

Advanced typst#2348

#set par(justify: true)
《新生》的出版之期接近了……

#set par(first-line-indent: 2em)
《新生》的出版之期接近了……

Unexpected indentation after figures, lists and block equations 图表、列表、块级公式后异常缩进

Basic typst#3206 fix (doc-cn)

Figures, lists and block equations will break the paragraph, causing the following text to start a new paragraph. This becomes visually noticeable when a first-line indent is applied. In Chinese, it is common practice to use a 2-em first-line indent, making this issue particularly apparent.

图表、列表、块级公式会终结段落,导致后文另起一段。若设置了首行缩进,换段会很明显。而中文出版物普遍设置首行缩进两字,导致这一问题尤为突出。

#set par(first-line-indent: (amount: 2em, all: true))

段首起始该缩进
$ integral f dif x $
此处应当仍在段内,不该缩进。

Even inter-character spacing 均排

Advanced fix (doc-cn) fix (universe/tricorder)

Even inter-character spacing means letting several Chinese characters to occupy a fixed width and be evenly distributed.

均排是指让几个汉字占固定宽度并均匀分布。

丁声树 黎锦熙 \
李荣 陆志韦

5.3 Text spacing 文本的间距调整

This section is concerned with spacing that is adjusted around and between characters on a line in ways other than attempts to fit text to a given width (ie. justification). Some scripts create emphasis or other effects by spacing out the words, letters or syllables in a word. Are there requirements for this script/language that are unsupported? If spacing needs to be applied between letters and numbers, is that possible? What about space associated with punctuation, such as the gap before a colon in French? (For justification related spacing, see §5.2.)

本节关注要使文本适应指定长度(对齐)时,如何在字符之间和字符周围添加空隙。有些文字通过空出单词、字母、音阶来表达强调等效果。能否满足这种语言文字的需求?若需在字母、数字间加空,能否做到?像法文冒号前间距那种标点符号相关的空隙呢?(关于对齐相关的间距,请见§5.2。)

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

CJK-Latin-spacing not working around raw raw两边缺少中西间距

Advanced typst#2702 fix (doc-cn)

汉字`(code)`汉字

CJK-Latin-spacing not working around inline equations 行内公式两边缺少中西间距

Advanced typst#2703 fix (doc-cn)

汉字$A$汉字

Punctuation compression is interrupted by #show #show会打断标点挤压

Basic typst#5474

噫)。嘘).唏

#show "。": "."
噫)。嘘).唏

5.4 Baselines, line-height, etc. 基线、行高等

Does typst support requirements for baseline alignment between mixed scripts and in general? Are there issues related to line height or inter-line spacing, etc.? Are the requirements for baseline or line height in vertical text covered?

typst能否对齐多文种的基线?行高、行距等方面有无问题?直排时的基线、行高能否满足要求?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Default line height is too tight for Chinese 默认行高对中文来说过小

Basic fix (doc-cn)

Unlike the Latin alphabet, Chinese characters have no concept of ascenders and descenders. So even though the numerical values of the leading are the same, the visual spacing of Chinese is smaller than that of Western text.

与拉丁字母不同,汉字没有升降部的概念。所以尽管行距的数值相同,中文的视觉效果会比西文紧。

Typst 国王 \
Typst 国王

5.5 Lists, counters, etc. 列表、编号等

Are there list or other counter styles in use? If so, what is the format used and can that be achieved? Are the correct separators available for use after list counters? Are there other aspects related to counters and lists that need to be addressed? Are list counters handled correctly in vertical text?

是否使用列表或其它编号样式?若是,使用什么格式,能否实现?列表编号后的分隔符是否正确?编号、列表的其它方面还有要解决的吗?直排时列表编号是否正常?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

List and enum markers are not aligned with the baseline of the item's contents listenum的编号与内容未对齐基线

Basic typst#1204 fix (doc-cn)

This issue occurs when the marker and the content have different heights. It is common in mixed Chinese-Western text layouts to use different fonts for Chinese and Western characters. As a result, the height of Western (numeric) markers is likely to differ from that of the Chinese content, triggering the issue.

这一问题的触发条件是编号和内容的高度不同。而中西混排场景中,中西文经常采用不同字体,导致西文(数字)编号与中文内容很可能不一样高,从而触发问题。

#set text(font: (
(name: "New Computer Modern", covers: "latin-in-cjk"),
"SimSun",
))

+ 鲁镇的酒店的格局,是和别处不同的。

Too wide spacing between heading numbering and title 标题编号与内容之间的空隙过宽

Basic typst#5778 fix (doc-cn)

In Chinese, the chapter number and its title are typically separated by the secondary comma U+3001  ideographic comma. Unlike the dot . used in formats like 1. Title, no extra space should follow the in examples such as 一、标题. However, typst puts a hard-coded 0.3-em space here.

中文通常习惯用顿号 U+3001  ideographic comma 分隔章号和标题。与1. Title这种格式中的.不同,一、标题中的后不应再插入空格。然而 typst 在这里硬编码插入了宽 0.3 em 的空格。

#set heading(numbering: "一、")
= 标题

5.6 Styling initials

Does typst correctly handle special styling of the initial letter of a line or paragraph, such as for drop caps or similar? How about the size relationship between the large letter and the lines alongide? where does the large letter anchor relative to the lines alongside? is it normal to include initial quote marks in the large letter? is the large letter really a syllable? etc. Are all of these things working as expected?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

6 Page & book layout 页面与书籍版式

6.1 General page layout & progression 基本页面版式与装订方向

How are the main text area and ancilliary areas positioned and defined? Are there any special requirements here, such as dimensions in characters for the Japanese kihon hanmen? The book cover for scripts that are read right-to-left scripts is on the right of the spine, rather than the left. Is that provided for? When content can flow vertically and to the left or right, how do you specify the location of objects, text, etc. relative to the flow? For example, keywords left and right are likely to need to be reversed for pages written in English and page written in Arabic. Do tables and grid layouts work as expected? How do columns work in vertical text? Can you mix block of vertical and horizontal text correctly? Does text scroll in the expected direction? Other topics that belong here include any local requirements for things such as printer marks, tables of contents and indexes. See also §6.2.

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

6.2 Grids & tables 网格与表格

As a subtopic of page layout, does the script have special requirements for character grids or for tables?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

6.3 Footnotes, endnotes, etc. 脚注、尾注等

Does your script have special requirements for footnotes, endnotes or other necessary annotations of this kind in the way needed for your culture? (See §4.5 for purely inline annotations, such as ruby or warichu. This section is more about annotation systems that separate the reference marks and the content of the notes.)

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

6.4 Page headers, footers, etc. 页眉、页脚等

Are there special conventions for page numbering, or the way that running headers and the like are handled?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

6.5 Forms & user interaction 表单和用户交互

Are vertical form controls well supported? In right-to-left scripts, is it possible to set the base direction for a form field? Is the scroll bar on the correct side? etc. Are there other aspects related to user interaction that need to be addressed?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

To be done

7 Bibliography 参考文献管理

Is there any difficulty in complying with the Chinese national standard GB/T 7714—2015 Information and documentation—Rules for bibliographic references and citations to information resources (PDF)?

遵守中国国家标准 GB/T 7714—2015《信息与文献 参考文献著录规则》PDF)有无困难?

GB/T 7714—2015 specifies the following three citation styles. Each style uses a dedicated citing format in the main text, and the bibliography list at the end also arranges differently. However, the rules on recording each individual work are identical.

GB/T 7714—2015 规定了以下三种标注方法。各方法采用不同的正文引注样式,末尾参考文献表的排布方式也不尽相同;不过,每项文献的著录规则完全相同。

The first style is the most widely used. The following sections will refer to this method unless otherwise specified.

第一种方法应用最广。下文默认指这种方法。

7.1 Citing 参考文献引注

Is it possible to cite a work in the main text using cite? Does the result meet expectations?

能否用cite在正文中标注参考文献?结果符合预期吗?

Citation numbers are flying over their brackets 引用编号的数字高于括号

Basic fix (doc-cn)

The style gb-7714-2015-numeric formats a citation with a number enclosed in square brackets (e.g., [1]) and render them in superscript. However, some fonts only provide dedicated superscript glyphs for numbers, not for brackets. This can cause misalignment, with the numbers appearing higher than the brackets in the superscript.

gb-7714-2015-numeric样式会用括号包裹引用编号(例:[1])并上标。不过有些字体只给数字提供了专用上标版本,而括号未提供。这导致上标时未对齐,数字显得比括号高。

#set text(font: "Noto Serif CJK SC")
孔乙己@key\上大人

#let bib = ```bib
@misc{key,
title = {Title},
}
```.text
#bibliography(bytes(bib), style: "gb-7714-2015-numeric")

Compression of continuous citation numbers 压缩连续的引用编号

Basic hayagriva#189 (mentioned)

Compression should start from two citations., but the current threshold is three.

压缩应从两篇文献开始,而目前是从三篇开始。

两篇@a @b \
三篇@a @b @c

#let bib = (
"abc".clusters().map(n => "@misc{[n], title = {Title}}".replace("[n]", n)).sum()
)
#bibliography(bytes(bib), style: "gb-7714-2015-numeric")

Superscript and non-superscript forms should coexist 共存上标和非上标形式

Broken fix (doc-cn)

Bothe the superscript and non-superscript forms are needed in practice.

实际中,上标、非上标两种引用形式都需要。

 孔乙己@key,另见文献~#parencite(<key>)。

Cite with page numbers 带页码引用

Advanced fix (forum)

初次@a[260] \
再次@a[326--329] @b @c @d

#let bib = (
"abcd".clusters().map(n => "@misc{[n], title = {Title}}".replace("[n]", n)).sum()
)
#bibliography(bytes(bib), style: "gb-7714-2015-numeric")

This issue is marked as advanced, because citing with page number is not common. According to GB/T 7714—2015 §10.1.3, in most cases, page numbers should be recorded in the bibliography list. Citing with page number is only necessary when the work is cited multiple times with different page numbers.

这一问题算作 Advanced,因为带页码引用并不常见。根据 GB/T 7714—2015 §10.1.3,大多数情况下页码应当记录在参考文献表中;只有多次引用同一文献的不同页码时,才需在引用处标注页码。

7.2 Bibliography listing 参考文献表

Can bibliography generate a bibliography / reference listing at the end of the article or the page? Does each entry have all parts? Does the citation format meet the standard?

bibliography能否在文末或页脚正常生成参考文献表?著录项目完整吗?著录格式符合标准吗?

Use et al. for English and for Chinese 英文用et al.,中文用

Broken citationberg#5 hayagriva#291 nju-lug/modern-nju-thesis#3 csimide/SEU-Typst-Template#1 fix (doc-cn) fix (universe/modern-nju-thesis)

It is extremely common to cite both Chinese and English works in an article. For multi-author literature, some authors may be omitted. In such cases, we should use et al. for English and for Chinese.

一篇文章同时引用中英文献极其常见。多著者文献可能省略部分作者,这时英文应加et al.,中文应加

Currently, #set text(lang: …) can select et al. (en) or (zh) for all entries, but it is not possible to set each entry individually.

当前可用#set text(lang: …)统一选择et al.(en)与(zh),但无法逐文献设置。

@article{吴伟仁2017,
title = {“嫦娥4号”月球背面软着陆任务设计},
author = {{吴伟仁} and {王琼} and {唐玉华} and {于国斌} and {刘继忠} and {张玮} and {宁远明} and {卢亮亮}},
date = {2017-01},
journaltitle = {深空探测学报},
volume = {4},
number = {2},
pages = {111--117},
doi = {10.15982/j.issn.2095-7777.2017.02.002},
langid = {chinese}
}
@article{su2025,
title = {South {{Pole}}{{Aitken}} Massive Impact 4.25 Billion Years Ago Revealed by {{Chang}}'e-6 Samples},
author = {Su, Bin and Chen, Yi and Wang, Zeling and Zhang, Di and Chen, Haojie and Gou, Sheng and Yue, Zongyu and Liu, Yanhong and Yuan, Jiangyan and Tang, Guoqiang and Guo, Shun and Li, Qiuli and Lin, Yang-Ting and Li, Xian-Hua and Wu, Fu-Yuan},
date = {2025-03-20},
journaltitle = {National Science Review},
shortjournal = {Natl. Sci. Rev.},
pages = {nwaf103},
issn = {2095-5138},
doi = {10.1093/nsr/nwaf103},
langid = {english},
}

institution and school are not shown institution机构名称和school学校名称不显示

Broken hayagriva#112 fix (doc-cn)

institution and school are not recognized as aliases of publisher, and typst does not understand institute in CSL either. The school field is conventionally associated with @thesis ([D]), and the institute field with @report ([R]). These fields should be placed between the location and the date after [D]/[R].

institution机构名称和school学校名称未被识别成publisher的别名,typst 亦不支持解析 CSL 中的 institutionschool字段常用于学位论文@thesis[D]),institute字段常用于报告@report[R]),它们应显示在[D]/[R]后的地点与日期之间。

@report{report,
author = {Robert Swearingen},
title = {Morphology and syntax of British sailors’ English},
series = {Technical Report},
number = {249},
institution = {Profanity Institute},
address = {New York},
year = {1985},
}
@thesis{王楠2016,
title = {在“共产主义视镜”下想象科学——“十七年”期间的中国科幻文学与科学话语},
author = {王楠},
date = {2016-08-05},
institution = {新加坡国立大学},
location = {新加坡},
url = {https://scholarbank.nus.edu.sg/handle/10635/132143},
urldate = {2025-02-15},
langid = {chinese}
}

Discontinuous page numbers are displayed incorrectly, missing a comma 不连续页码显示错误,缺少逗号

Basic fix (doc-cn)

@phdthesis{alterego,
type = {{超高校级学位论文}},
title = {{基于图书室的笔记本电脑的 Alter Ego 系统}},
author = {不二咲, 千尋},
year = {2010},
address = {某地},
school = {私立希望ヶ峰学園},
publisher = {私立希望ヶ峰学園},
pages = {1--3, 5},
}

Chinese works should be ordered by the pinyin or strokes of the authors for gb-7714-2015-author-date 采用gb-7714-2015-author-date时,中文文献应按著者汉语拼音字顺或笔画笔顺排列

Advanced hayagriva#259

The style gb-7714-2015-author-date currently sorts works by Unicode code points. However, according to the standard, when using this style, the cited works should first be grouped by scripts, then arranged by author names and publication dates. For Chinese works, they may be ordered by either pinyin or strokes.

目前gb-7714-2015-author-date样式按Unicode码位排序。而标准规定,采用这种样式时,各篇文献首先按文种集中,然后按著者字顺和出版年排列,其中中文文献可按著者汉语拼音字顺或笔画笔顺排列。

gb-7714-2015-note is totally broken gb-7714-2015-note完全无法使用

Advanced hayagriva#189 (mentioned)

孔乙己@key \
上大人@key

#let bib = ```bib
@misc{key,
author = {Author},
title = {Title},
date = {2025-06-17},
}
```.text
#bibliography(bytes(bib), style: "gb-7714-2015-note")

7.3 Bibliography file 参考文献文件

Are there difficulties creating files related to bibliography? Including the database of reference entires (Hayagriva *.yml, BibTeX *.bib) and the Citation Style Language style *.csl.

准备参考文献相关的文件是否存在困难?包括参考文件数据库(Hayagriva *.yml、BibTeX *.bib)和 Citation Style Language 样式 *.csl

@standard is not correctly interpreted @standard被错误解释

Basic hayagriva#312

@standard is the [S] type in GB/T 7714—2015. It is a regular type in CSL, and a non-standard type in BibTeX (but accepted by biber). However, typst interprets it as @misc ([Z]) or @webpage ([EB]).

@standard是 GB/T 7714—2015 里的[S]类型文献。它在 CSL 中是个正常类型,不过并非 BibTeX 的标准类型(但 biber 支持)。然而 typst 将它解释为@misc[Z])或@webpage[EB])。

@standard{DASH,
title = {Information Technology — {{Dynamic}} Adaptive Streaming over {{HTTP}} ({{DASH}}) — {{Part}} 1: {{Media}} Presentation Description and Segment Formats},
author = {{ISO/IEC}},
date = {2022-08},
number = {ISO/IEC 23009-1:2022(E)},
publisher = {International Organization for Standardization},
url = {https://www.iso.org/standard/83314.html},
pubstate = {Published},
version = {5},
}

Failed to load some CSL styles 无法加载某些 CSL 样式

Advanced fix (doc-cn)

The compiler does not support the CSL-M standard yet, nor is it compatible with some extensions of citeproc-js.

编译器暂不支持 CSL-M 标准,也不兼容 citeproc-js 的一些扩展。

8 Other 杂项

8.1 Culture-specific features 文化独有特性

Sometimes a script or language does things that are not common outside of its sphere of influence. This is a loose bag of additional items that were not previously mentioned. This section may also be relevant for observations related to locale formats (such as number, date, currency, format support).

有时语言文字会其有特殊做法。本节兜底补充,覆盖上文未提及的特殊情况。本节也可讨论本地化格式(如数字、日期、货币)的支持情况。

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

For references to headings, the supplement should not be put before the number 引用章节时,名称不该在编号之前

Broken typst#5102 typst#2485 (mentioned)

When referencing chapters and sections in Chinese, it is standard to write 第一章 or 2.1小节, while forms like 小节2.1 are rarely used, and 章一 is virtually nonexistent. Therefore, the supplement parameter of ref or heading is useless for Chinese, making it inevitable to use #show ref: it => ….

引用章节时,中文通常写第一章2.1小节,而几乎不写小节2.1,更不会写章一。因此,中文无法使用refheadingsupplement参数,必须#show ref: it => …

Literal meanings: 字面含义:

#set heading(numbering: "1.1")
== 标题 <sec>
@sec

Besides, defining a show rule to replace ref with link(it.element.location(), …) will cause other problems, such as difficulty in coloring link and ref separately.

此外,若在 show 规则中用link(it.element.location(), …)替代ref,又会引发其它问题,例如难以给linkref分别上色。

Bilingual figure captions 双语插图标题

Advanced fix (doc-cn)

8.2 What else? 其它

There are many other modules and specifications which may need review for script-specific requirements. What else is likely to cause problems for worldwide usage of typst, and what requirements need to be addressed to make typst function well locally?

(derived from a W3C document under its license) (按相应协议修改自 W3C 文档

Ignore linebreaks between CJK characters in source code 忽略源码中CJK字符间的换行

Advanced typst#792 fix (doc-cn) fix (universe/cjk-unbreak)

测试一下,
效果怎么样。

This issue is marked as advanced, because not all people want this behaviour.

这一问题算作 Advanced,因为并非所有人都想要这种行为。

Disable the spell checker of webapp 关闭 webapp 的拼写检查

Advanced fix (doc-cn)

The spell checker embedded in the webapp does not support Chinese, marking all characters as misspelled, as shown in Figure 4.

webapp 内嵌的拼写检查器不支持中文,每个字都会被标为拼写错误,如 Figure 4。

我要給阿Q做正傳,已經不止一兩年了。但一面要做,一面又往回想,這足見我不是一個“立言”的人,因為從來不朽之筆,須傳不朽之人,於是人以文傳,文以人傳——究竟誰靠誰傳,漸漸的不甚瞭然起來,而終於歸接到傳阿Q,仿佛思想裏有鬼似的。
Figure 4: 94 spelling mistakes 94个拼写错误

Addendum 附录

Summary 概要

    Environment of the examples 例子的环境信息

    References 参考资料

    To be done 待办

    Umbrella/tracking issues