Chinese Layout Gap Analysis for Typst.
# Compile
pnpm build # ⇒ dist/index.html
# Recompile on changes
pnpm dev --open # ⇒ http://localhost:3000
Prerequisites:
-
pnpm, the package manager
-
Noto Serif CJK SC, the typeface
Download
09_NotoSerifCJKsc.zip
from 校园网联合镜像站 · Google Fonts, or Language Specific OTFs Simplified Chinese (简体中文) from GitHub Releases · notofonts/noto-cjk.Then install the fonts to system, or put them under
./fonts/
.Noto Serif CJK SC is enough for most contributors. However, if you want to reproduce all examples exactly, please refer to the script.
You can add an example to main.typ
by writing a fenced code block with one of the following languages.
A simple typst example.
```example
>>> Current: \
#underline[中文和English]
>>> Expected: \
>>> #set underline(offset: .15em, stroke: .05em)
>>> #underline[中文和English]
```
-
Regular lines:
👀 shown as the source, and 🚀 executed in preview.
-
Lines starting with
>>>
:🙈 hidden from the source, but still 🚀 executed in preview.
-
Lines starting with
<<<
:👀 shown as the source, but 🛑 not executed in the preview.
Simple examples are evaluated in a container and their states are shared across the entire document.
As a result:
-
Any page configuration is not allowed.
If you just want to
#set page(width: …)
, then use#show: block.with(width: …)
instead. -
Updating counters will affect the following examples.
-
Citations and bibliographies will conflict with other examples.
-
…
If you need advanced features, please write a page example instead.
A standalone typst example compiled in a page.
````example-page
>>> Current: \
孔乙己@key
>>> Expected: \
>>> 孔乙己@key
>>> #show bibliography: none
#let bib = ```bib
@misc{key,
title = {Title},
}
```.text
#bibliography(bytes(bib), style: "gb-7714-2015-numeric")
````
The meanings of <<<
and >>>
are the same as those in simple examples.
```example-bib
@book{key,
title = {标题},
author = {作者},
year = {2025}
}
% 作者. 标题. 2025.
```
-
Regular lines: BibTeX entries.
-
Lines starting with
%
: Expected output.
The code are licensed under Apache 2.0 unless otherwise specified. All rights of rest content are reserved.