|
1 | | -#import "typ/util.typ": babel, bbl, issue, note, prompt, pull, unichar, workaround |
| 1 | +#import "typ/packages/till-next.typ": mark-till-next, till-next |
| 2 | +#import "typ/util.typ": babel, bbl, issue, note, now-fixed, prompt, pull, unichar, workaround |
2 | 3 | #import "typ/prioritization.typ": level, level-table |
3 | | -#import "typ/show-example.typ": render-examples |
| 4 | +#import "typ/show-example.typ": layout-git-log, render-examples |
4 | 5 | #show: render-examples |
5 | 6 |
|
6 | 7 | #babel(en: [Chinese Layout Gap Analysis for Typst.], zh: [分析 Typst 与中文排版的差距。]) |
|
44 | 45 |
|
45 | 46 | #set heading(numbering: "1.1") |
46 | 47 | #show heading.where(level: 3): set heading(numbering: none) |
| 48 | +#show: mark-till-next |
47 | 49 |
|
48 | 50 | = #bbl(en: [Text direction], zh: [文本方向]) |
49 | 51 |
|
|
677 | 679 | ``` |
678 | 680 |
|
679 | 681 | ```example-page |
680 | | ->>> // This example behaves differently in `example` and `example-page`. |
| 682 | +>>> // This example behaves differently in `example` and `example-page` because of cjk-latin-spacing. |
681 | 683 | >>> #set text(top-edge: "ascender", bottom-edge: "descender") |
682 | 684 | >>> Current: |
683 | 685 | #set par(justify: true) |
@@ -816,6 +818,25 @@ $ integral f dif x $ |
816 | 818 | >>> 汉字#h(0.25em)$A$#h(0.25em)汉字 |
817 | 819 | ``` |
818 | 820 |
|
| 821 | +=== #bbl(en: [Redundant CJK-Latin space at manual line breaks], zh: [人为换行时多余中西间距]) |
| 822 | + |
| 823 | +#level.advanced |
| 824 | +#issue("typst#6539") |
| 825 | + |
| 826 | +#babel( |
| 827 | + en: [If the line is manually broken between a CJK and a Latin character, then typst will insert an extra CJK-Latin space. This space becomes noticeable when text is aligned to the right or center.], |
| 828 | + zh: [若在汉字和拉丁字母间手动换行,typst 会插入多余中西间距。如果文本右对齐或居中对齐,这个间距会显现出来。], |
| 829 | +) |
| 830 | + |
| 831 | +```example |
| 832 | +>>> Current: \ |
| 833 | +#set text(cjk-latin-spacing: auto) |
| 834 | +#box(width: 3em, stroke: (right: green), align(right, [国国\ TT])) |
| 835 | +
|
| 836 | +>>> Expected: \ |
| 837 | +>>> #box(width: 3em, stroke: (right: green), align(right, [国国TT])) |
| 838 | +``` |
| 839 | + |
819 | 840 | === #bbl(en: [Punctuation compression is interrupted by `#show`], zh: [`#show`会打断标点挤压]) |
820 | 841 |
|
821 | 842 | #level.basic |
@@ -957,6 +978,31 @@ $ integral f dif x $ |
957 | 978 | >>> = 一、标题 |
958 | 979 | ``` |
959 | 980 |
|
| 981 | +=== #bbl(en: [The auto hanging indents of multiline headings are inaccurate], zh: [多行标题的自动悬挂缩进不准确]) |
| 982 | + |
| 983 | +#level.advanced |
| 984 | +#issue("typst#6527") |
| 985 | +#workaround("https://github.com/typst/typst/issues/6527#issuecomment-3026200835") |
| 986 | + |
| 987 | +#babel( |
| 988 | + en: [The default value of `heading.hanging-indent` is `auto`, which indicates that the subsequent heading lines will be indented based on the width of the numbering. However, the `auto` width is not accurate if the numbering ends with a full-width punctuation, e.g., #unichar("、").], |
| 989 | + zh: [`heading.hanging-indent`默认为`auto`,表示标题从第二行起按编号的宽度缩进。然而若编号以全宽标点结尾,例如 #unichar("、"),那么`auto`得出的宽度并不准确。], |
| 990 | +) |
| 991 | + |
| 992 | +```example-page |
| 993 | +#set page(width: 5 * 12pt + 2 * 1em, margin: 1em) |
| 994 | +#show heading: set text(12pt) |
| 995 | +
|
| 996 | +>>> #show heading: pad.with(top: -0.75em) |
| 997 | +>>> Current: |
| 998 | +#set heading(numbering: "一、") |
| 999 | += 寻寻觅觅 |
| 1000 | +
|
| 1001 | +>>> Expected: |
| 1002 | +>>> #set heading(numbering: none, hanging-indent: 2em) |
| 1003 | +>>> = 一、寻寻觅觅 |
| 1004 | +``` |
| 1005 | + |
960 | 1006 | == Styling initials <initials> |
961 | 1007 |
|
962 | 1008 | #prompt(from-w3c: "https://www.w3.org/TR/clreq-gap/#initials")[ |
@@ -1137,13 +1183,15 @@ $ integral f dif x $ |
1137 | 1183 |
|
1138 | 1184 | === #bbl(en: [Citation numbers are flying over their brackets], zh: [引用编号的数字高于括号]) |
1139 | 1185 |
|
1140 | | -#level.basic |
1141 | | -#issue("typst#633") |
| 1186 | +#level.ok |
| 1187 | +#issue("typst#633", closed: true) |
1142 | 1188 | #issue("typst#6513", closed: true) |
1143 | 1189 | #issue("typst#4203", closed: true) |
1144 | | -#pull("typst#5777") |
| 1190 | +#pull("typst#5777", merged: true) |
1145 | 1191 | #workaround("https://typst-doc-cn.github.io/guide/FAQ/cite-flying.html") |
1146 | 1192 |
|
| 1193 | +#till-next(now-fixed.with(last-affected: "0.13.1", last-level: "basic")) |
| 1194 | + |
1147 | 1195 | #babel( |
1148 | 1196 | en: [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.], |
1149 | 1197 | zh: [`gb-7714-2015-numeric`样式会用括号包裹引用编号(例:`[1]`)并上标。不过有些字体只给数字提供了专用上标版本,而括号未提供。这导致上标时未对齐,数字显得比括号高。], |
@@ -1232,7 +1280,7 @@ $ integral f dif x $ |
1232 | 1280 |
|
1233 | 1281 | ````example-page |
1234 | 1282 | >>> Expected: \ |
1235 | | -<<< 孔乙己@key,另见文献~#parencite(<key>)。 |
| 1283 | +<<< 孔乙己@key,另见#cite(<key>, form: "prose-short")。 |
1236 | 1284 | >>> 孔乙己#super[[1]],另见文献#h(0.25em)#[[1]]。 |
1237 | 1285 | ```` |
1238 | 1286 |
|
@@ -1600,6 +1648,8 @@ $ integral f dif x $ |
1600 | 1648 | [ |
1601 | 1649 | - #bbl(en: [Document version], zh: [文档版本]) \ |
1602 | 1650 | #link(git.commit_url)[commit #git.name] (#link(git.log_url)[log]) |
| 1651 | + |
| 1652 | + #layout-git-log(summary: bbl(en: [Latest log], zh: [最新日志]), git.latest_log) |
1603 | 1653 | ] |
1604 | 1654 | } |
1605 | 1655 |
|
|
0 commit comments