style: restyle PDF export
This commit is contained in:
parent
8fd2ee067e
commit
aaa897c8dc
3 changed files with 34 additions and 10 deletions
|
|
@ -9,7 +9,13 @@
|
|||
#set page(
|
||||
paper: "a4",
|
||||
flipped: true,
|
||||
margin: (top: 1.2cm, bottom: 1.2cm, left: 1.0cm, right: 1.0cm)
|
||||
margin: (top: 1.2cm, bottom: 1.2cm, left: 1.0cm, right: 1.0cm),
|
||||
numbering: "1",
|
||||
footer: context [
|
||||
#set text(size: 8pt)
|
||||
#set align(center)
|
||||
#counter(page).display("1 / 1", both: true)
|
||||
]
|
||||
)
|
||||
|
||||
#set text(size: 9pt, hyphenate: true)
|
||||
|
|
@ -58,7 +64,6 @@
|
|||
#let start = fixed_count + chunk_index * max_dynamic_cols
|
||||
|
||||
#let page_cols = fixed_cols + dyn_cols_chunk
|
||||
#let headers = page_cols.map(c => c.at("label", default: ""))
|
||||
|
||||
// widths: first two columns fixed (32mm, 42mm), rest distributed as 1fr
|
||||
#let widths = (
|
||||
|
|
@ -67,9 +72,9 @@
|
|||
..((1fr,) * dyn_count)
|
||||
)
|
||||
|
||||
#let header_cells = headers.map(h => text(weight: "bold", size: 9pt)[#h])
|
||||
#let header_cells = page_cols.map(c => text(weight: "bold", size: 9pt)[#c.at("label", default: "")])
|
||||
|
||||
// Body cells (row-major), nur die Spalten dieses Chunks
|
||||
// Body cells (row-major), only columns of this chunk
|
||||
#let body_cells = (
|
||||
rows
|
||||
.map(row => row.slice(0, fixed_count) + row.slice(start, start + dyn_count))
|
||||
|
|
@ -77,8 +82,27 @@
|
|||
.flatten()
|
||||
)
|
||||
|
||||
// Thinner grid for body; thicker vertical line between column 2 and 3; header and outer borders thick
|
||||
#let thin_stroke = 0.3pt + black
|
||||
#let thick_sep = 1.5pt + black
|
||||
#let thick_stroke = 1pt + black
|
||||
#let last_x = fixed_count + dyn_count - 1
|
||||
#let last_y = rows.len()
|
||||
#let stroke_fn = (x, y) => {
|
||||
let top = if y == 0 or y == 1 { thick_stroke } else { thin_stroke }
|
||||
let bottom = if y == 0 or y == last_y { thick_stroke } else { thin_stroke }
|
||||
let left = if x == 0 { thick_stroke } else if x == 2 { thick_sep } else { thin_stroke }
|
||||
let right = if x == last_x { thick_stroke } else { thin_stroke }
|
||||
(top: top, bottom: bottom, left: left, right: right)
|
||||
}
|
||||
|
||||
// Light gray background for first two columns (first_name, last_name)
|
||||
#let fill_fn = (x, y) => if x < 2 { rgb("f2f2f2") } else { none }
|
||||
|
||||
#table(
|
||||
columns: widths,
|
||||
stroke: stroke_fn,
|
||||
fill: fill_fn,
|
||||
table.header(..header_cells),
|
||||
..body_cells,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue