From 7cde201899c1e16a8542008601d362f9cf7cfc96 Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Thu, 25 Jan 2024 21:25:35 -0500 Subject: [PATCH] typst template --- inst/templates/typst.typ | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 inst/templates/typst.typ diff --git a/inst/templates/typst.typ b/inst/templates/typst.typ new file mode 100644 index 00000000..d32c29a2 --- /dev/null +++ b/inst/templates/typst.typ @@ -0,0 +1,39 @@ + +#import "@preview/tablex:0.0.8": tablex, rowspanx, colspanx + +#tablex( + columns: 4, + align: left + horizon, + auto-vlines: false, + header-rows: 1, + + map-cells: cell => { + + let j = (1,); + if (j.contains(cell.x)) { cell.align = center }; + + let i = (2,4); + let j = (1,); + if (i.contains(cell.y) and j.contains(cell.x)) { cell.fill = black }; + + let i = (2,4); + let j = (1,); + if (i.contains(cell.y) and j.contains(cell.x)) { cell.content = { set text(white); cell.content } } + + let i = (0,); + if (i.contains(cell.y)) { cell.content = { emph(cell.content) } } + + let i = (1,); + if (i.contains(cell.y)) { cell.content = { strong(cell.content) } } + return cell; + + }, + + + [Username], [Location], [Height], [Score], + [John], [Second St.], [180 cm], [5], + [Wally], [Third Av.], [160 cm], [10], + [Jason], [Some St.], [150 cm], [15], + [Robert], [123 Av.], [190 cm], [20], + [Other], [Unknown St.], [170 cm], [25], +) \ No newline at end of file