From c3d65f93b28312cc45cdb66a29d62c526b3379c1 Mon Sep 17 00:00:00 2001 From: Sven Vogel Date: Mon, 8 Jul 2024 09:34:33 +0200 Subject: [PATCH] added: APA style table --- src/style.typ | 13 +++++++++++++ template/main.typ | 7 +++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/style.typ b/src/style.typ index 625c257..65856bc 100644 --- a/src/style.typ +++ b/src/style.typ @@ -52,6 +52,19 @@ show figure: set block(breakable: true) + // APA style table + set table( + inset: 0.5em, + align: left, + stroke: (x, y) => ( + left: none, + right: none, + top: if y == 0 { 1.5pt } else if y < 2 { 1pt } else { 0pt }, + bottom: if y == 0 { 1pt } else { 1.5pt } )) + + // make table header bold + show table.cell.where(y: 0): set text(weight: "bold") + set block(spacing: 2em) set par( justify: true, diff --git a/template/main.typ b/template/main.typ index 4e90991..b9134f4 100644 --- a/template/main.typ +++ b/template/main.typ @@ -63,8 +63,11 @@ $ #figure( table( - columns: 2, - "Hello", "World"), + columns: 3, + table.header[Date][Exercise Type][Calories Burned], + [2023-03-15], [Swimming], [400], + [2023-03-17], [Weightlifting], [250], + [2023-03-18], [Yoga], [200]), caption: [ Some table ]) #pagebreak()