Skip to content

Commit

Permalink
typst template
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 26, 2024
1 parent 51cb230 commit 7cde201
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions inst/templates/typst.typ
Original file line number Diff line number Diff line change
@@ -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],
)

0 comments on commit 7cde201

Please sign in to comment.