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 文档)
Chinese Layout Gap Analysis for Typst.
分析 Typst 与中文排版的差距。
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 所示。
⚠ This document is only an early draft. Additionally, it is not endorsed by either W3C or Typst GmbH. Please refer to it with caution.
⚠ 这份文档仅是早期草稿。此外,本文并无 W3C 或 Typst GmbH 背书。请谨慎参考。
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 文档)
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 文档)
Advanced typst#5908
There are two writing modes in Chinese composition:
中文有两种行文模式:
Horizontal writing mode is the mainstream mode in Chinese Mainland, and is also commonly used for books on natural science in Hong Kong, Macao, Taiwan.
横排是中国大陆的主流方法,港澳台的自然科学类书籍也常用横排。
Vertical writing mode is the traditional mode for Chinese publications, and still stands as an important cultural characteristic of regions where Traditional Chinese is used.
直排是中文书籍的传统方法,仍是繁体中文通行地区的重要文化标志。
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 目前连基础直排也难以实现,下文各节将不再讨论直排相关的问题。
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
Do the standard fallback fonts used in typst match expectations? Is it convenient to select fonts?
typst 的标准回落字体符合预期吗?选择字体方便吗?
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),难以阅读,且无任何警告或提示。
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: …)
再次指定中文字体。
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 是‘虚构’人物!”
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 文档)
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人
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")
可变字体
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
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
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 文档)
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")
想做出*最好的*灯泡。
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
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
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
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
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 文档)
Basic typst#5858 fix (doc-cn)
Both Chinese and Western quotation marks (and apostrophes) use the same Unicode code points:
中西文的引号(及撇号)都使用相同Unicode码位:
‘
left single quotation mark’
right single quotation mark“
left double quotation mark”
right double quotation markBut punctuation in Chinese is usually supposed to be wider than that in Western languages. This cannot be achieved automatically yet.
但中文的标点通常应该比西文的宽。当前这还无法自动实现。
我说:“T'Pol 是‘虚构’人物!”
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 文档)
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]
What characters or other methods are used to indicate abbreviation, ellipsis & repetition? Are there problems?
缩写、省略和重复用什么字符或方法表示?有问题吗?
(derived from a W3C document under its license) (按相应协议修改自 W3C 文档)
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 文档)
Advanced typst#1489
Advanced typst#193 (mentioned)
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
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 文档)
OK
#numbering("一", 299792458)
#numbering("壹", 299792458)
Natively supported. Mentioned here to prevent future people from reimplementing it.
内置支持。为避免又有人不知道而重复开发,提及一下。
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
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 文档)
Advanced typst#6062
#set par(justify: true)
#block(width: 3em)[第1回成段]
Advanced typst#4404
#set par(justify: true)
#block(width: 7.5em)[
天生我材必有用千金散尽还复来烹羊宰牛且为乐会须一饮三百杯
]
To be done typst#4011
Advanced typst#2348
#set par(justify: true)
《新生》的出版之期接近了……
#set par(first-line-indent: 2em)
《新生》的出版之期接近了……
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 $
此处应当仍在段内,不该缩进。
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.
均排是指让几个汉字占固定宽度并均匀分布。
丁声树 黎锦熙 \
李荣 陆志韦
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 文档)
raw
raw
两边缺少中西间距Advanced typst#2702 fix (doc-cn)
汉字`(code)`汉字
Advanced typst#2703 fix (doc-cn)
汉字$A$汉字
#show
#show
会打断标点挤压Basic typst#5474
噫)。嘘).唏
#show "。": "."
噫)。嘘).唏
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 文档)
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 国王
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
和enum
的编号与内容未对齐基线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",
))
+ 鲁镇的酒店的格局,是和别处不同的。
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: "一、")
= 标题
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
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
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
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
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
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
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.
第一种方法应用最广。下文默认指这种方法。
Is it possible to cite a work in the main text using cite
? Does the result meet expectations?
能否用cite
在正文中标注参考文献?结果符合预期吗?
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")
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")
Broken fix (doc-cn)
Bothe the superscript and non-superscript forms are needed in practice.
实际中,上标、非上标两种引用形式都需要。
孔乙己@key,另见文献~#parencite(<key>)。
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,大多数情况下页码应当记录在参考文献表中;只有多次引用同一文献的不同页码时,才需在引用处标注页码。
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
能否在文末或页脚正常生成参考文献表?著录项目完整吗?著录格式符合标准吗?
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 中的 institution
。school
字段常用于学位论文@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}
}
Basic fix (doc-cn)
@phdthesis{alterego,
type = {{超高校级学位论文}},
title = {{基于图书室的笔记本电脑的 Alter Ego 系统}},
author = {不二咲, 千尋},
year = {2010},
address = {某地},
school = {私立希望ヶ峰学園},
publisher = {私立希望ヶ峰学園},
pages = {1--3, 5},
}
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)
The references need only be listed in the footnotes, and should not be repeated at the end of the article. 文献只需在脚注列出,无需在文末重复。
If the same work is cited multiple times, then its footnote should be repeated in most cases. 若一篇文献被重复引用,则大多数情况下,相应脚注也应重复。
孔乙己@key \
上大人@key
#let bib = ```bib
@misc{key,
author = {Author},
title = {Title},
date = {2025-06-17},
}
```.text
#bibliography(bytes(bib), style: "gb-7714-2015-note")
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},
}
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 的一些扩展。
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 文档)
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
,更不会写章一
。因此,中文无法使用ref
或heading
的supplement
参数,必须#show ref: it => …
。
Literal meanings: 字面含义:
第一章
—— number one chapter2.1小节
—— 2.1 tiny section小节2.1
—— tiny section 2.1章一
—— chapter one#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
,又会引发其它问题,例如难以给link
、ref
分别上色。
Advanced fix (doc-cn)
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 文档)
Advanced typst#792 fix (doc-cn) fix (universe/cjk-unbreak)
测试一下,
效果怎么样。
This issue is marked as advanced, because not all people want this behaviour.
这一问题算作 Advanced,因为并非所有人都想要这种行为。
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。
Update date 更新日期
2025-06-21
Compiler 编译器
typst v0.13.1
Document version 文档版本
commit 54039482 (refs/heads/main) (log)
Default fonts 默认字体
New Computer Modern, Noto Serif CJK SC
W3C documents W3C 文档
Standards 标准
Reference implementations 参考实现
biblatex-gb7714-2015
, A BibLaTeX implementation of the GB/T 7714—2015 bibliography style for Chinese users 符合 GB/T 7714—2015 标准的 biblatex 参考文献样式 (TeXdoc PDF)Content
Live long
Documentation
GitHub