Skip to content

Commit c8b69fa

Browse files
Merge pull request typst-doc-cn#18 from YDX-2147483647/docs
Miscellaneous improvements suggested in the forum
2 parents 4fb6f67 + f13e5c8 commit c8b69fa

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

index.typ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#h.h1[
2323
#h.span(style: "display: inline-block;")[
24-
#link("https://www.w3.org/TR/clreq/")[clreq]-#link("https://www.w3.org/TR/clreq-gap/")[gap] for typst
24+
#link("https://www.w3.org/TR/clreq/")[clreq]-#link("https://www.w3.org/TR/clreq-gap/")[gap] for #link("https://typst.app/home")[typst]
2525
]
2626
#h.span(style: "display: inline-block; font-weight: normal; font-size: 1rem; color: var(--gray-color);")[
2727
#datetime.today().display(), typst v#sys.version

main.typ

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#babel(
1111
en: [
12-
Typst is a markup-based typesetting software, and this document describes gaps for the support of the Chinese script within Typst.
12+
Typst is a markup-based typesetting software, and this document describes gaps or shortcomings for the support of the Chinese script within Typst.
1313
In particular, it is concerned with #link("https://www.w3.org/TR/clreq/")[text layout] and #link("https://std.samr.gov.cn/gb/search/gbDetailed?id=71F772D8055ED3A7E05397BE0A0AB82A")[bibliography].
1414
It examines whether needed features are supported by the typst compiler, and provides information on potential workarounds.
1515
],
@@ -586,6 +586,40 @@
586586
>>> ]
587587
```
588588

589+
#babel(
590+
en: [The above simple examples demonstrate the principle, and the following complex examples are closer to practicality.],
591+
zh: [以上简单例子展示了原理,下面的复杂例子更接近实用],
592+
)
593+
594+
```example
595+
>>> #set text(top-edge: "ascender", bottom-edge: "descender")
596+
>>> Current:
597+
#set par(justify: true)
598+
#block(width: 8em)[
599+
天生我材必有用,千金散尽还复来。烹羊宰牛且为乐,会须一饮三百杯。
600+
]
601+
602+
>>> Expected:
603+
>>> #block(width: 8em)[
604+
>>> 天生我材必有用,千金散尽还复来。烹羊宰牛且为乐,会须一饮三百杯#box[。]#linebreak(justify: true)
605+
>>> ]
606+
```
607+
608+
```example-page
609+
>>> // This example behaves differently in `example` and `example-page`.
610+
>>> #set text(top-edge: "ascender", bottom-edge: "descender")
611+
>>> Current:
612+
#set par(justify: true)
613+
#block(width: 12em)[
614+
每年的消费量约4,000吨,每年的消费量
615+
]
616+
617+
>>> Expected:
618+
>>> #block(width: 12em)[
619+
>>> 每年的消费量约4,000吨,每年的消费量#hide[约4,000吨#box[。]]#linebreak(justify: true)
620+
>>> ]
621+
```
622+
589623
=== #bbl(en: [Brackets at the beginning of paragraph], zh: [段首的方括号])
590624

591625
#level.tbd
@@ -968,6 +1002,35 @@ $ integral f dif x $
9681002
#bibliography(bytes(bib), style: "gb-7714-2015-numeric")
9691003
````
9701004

1005+
#babel(
1006+
en: [This issue is caused by an imperfect font, but typst can still provide a better default. For example, we can use the dedicated superscript glyphs only when all characters in `[1]` have them. According to the following example, the mechanism is already implemented for `#super`, but `#cite` processes prefix (`[`), number (`1`), and suffix (`]`) separately, thereby ignoring that mechanism.],
1007+
zh: [此一问题由字体不完善导致,但 typst 仍可改进默认处理方式。例如,只有`[1]`中所有字符都有专用上标版本时,才使用它。根据下例,`#super`已实现此机制,但`#cite`分别处理前缀(`[`)、数字(`1`)和后缀(`]`),导致绕开了这一机制。],
1008+
)
1009+
1010+
````example-page
1011+
>>> Debug:
1012+
>>> #show regex("[✅❌]"): set text(fallback: true)
1013+
#set text(font: "Noto Serif CJK SC")
1014+
1015+
❌国@key
1016+
✅国#super("[1]")
1017+
❌国#"[1]".clusters().map(super).join()
1018+
1019+
#set super(typographic: false)
1020+
1021+
✅国@key
1022+
✅国#super("[1]")
1023+
✅国#"[1]".clusters().map(super).join()
1024+
1025+
>>> #show bibliography: none
1026+
>>> #let bib = ```bib
1027+
>>> @misc{key,
1028+
>>> title = {Title},
1029+
>>> }
1030+
>>> ```.text
1031+
>>> #bibliography(bytes(bib), style: "gb-7714-2015-numeric")
1032+
````
1033+
9711034
=== #bbl(en: [Compression of continuous citation numbers], zh: [压缩连续的引用编号])
9721035

9731036
#level.basic

0 commit comments

Comments
 (0)