42 lines
1.1 KiB
Typst
42 lines
1.1 KiB
Typst
// Таблицы — как в «Пример работы с Typst.typ» и gost: figure + table + table.header.
|
||
// Разрыв длинных таблиц и подпись сверху задаёт шаблон modern-g7-32 (style.typ).
|
||
|
||
#show table: set text(hyphenate: true)
|
||
|
||
#let pz-appendix-title(body) = heading(level: 1)[#body]
|
||
|
||
#let pz-table(caption, columns, ..body) = figure(
|
||
table(
|
||
columns: columns,
|
||
..body,
|
||
),
|
||
caption: caption,
|
||
)
|
||
|
||
// Реестры unit-тестов: перенос длинных идентификаторов (camelCase, _); сетка как в примере Typst.
|
||
#let pz-test-table(caption, columns, ..body) = figure(
|
||
{
|
||
show table: set text(hyphenate: true, size: 9pt)
|
||
show table.cell: cell => {
|
||
show regex("[a-z0-9][A-Z]"): m => {
|
||
m.text.first() + sym.zws + m.text.last()
|
||
}
|
||
show regex("[_]"): it => it + sym.zws
|
||
cell
|
||
}
|
||
table(
|
||
columns: columns,
|
||
..body,
|
||
)
|
||
},
|
||
caption: caption,
|
||
)
|
||
|
||
#let pz-fig(path, caption, lbl) = [
|
||
#figure(
|
||
image("../images/" + path, width: 100%),
|
||
caption: caption,
|
||
)
|
||
#label(lbl)
|
||
]
|