Closed marcboschmatas closed 7 months ago
Thanks! Out of curiosity, where did you find the list of markup symbols to escape?
In the typst docs! https://typst.app/docs/reference/syntax/
The fact that you can use both the markdown-like characters (*, _ and so on) and functions can be helpful to avoid potential conflicts I guess.
Thanks, this is fantastic!
I have made a few changes and it seems to be working fine and not interfering
format_tt()
too much. Ref https://github.com/vincentarelbundock/tinytable/issues/232block[
import "@preview/tablex:0.0.8": tablex, hlinex, vlinex, colspanx
let nhead = 1;
let nrow = 11;
let ncol = 2;
figure(
kind: "tinytable", supplement: none, tablex( columns: ncol, header-rows: nhead, align: left + horizon, auto-lines: false,
hlinex(y: 5, start: 0, end: 2, stroke: 0.05em + black), hlinex(y: 0, start: 0, end: 2, stroke: 0.1em + black), hlinex(y: 1, start: 0, end: 2, stroke: 0.05em + black), hlinex(y: 12, start: 0, end: 2, stroke: 0.1em + black), // tinytable lines before
let i = (8,); let j = (0,1,);
if (i.contains(cell.y) and j.contains(cell.x)) { cell.content = strike(cell.content) }; let i = (7,); let j = (0,1,);
if (i.contains(cell.y) and j.contains(cell.x)) { cell.content = emph(cell.content) }; let i = (6,); let j = (0,1,);
if (i.contains(cell.y) and j.contains(cell.x)) { cell.content = strong(cell.content) };
if (cell.x == 1) { cell.align = center };
if (cell.x == 0) { cell.align = left };
[ ], [(1)], [(Intercept)], [37.885***], [], [(2.074)], [cyl], [-2.876***], [], [(0.322)], [Num.Obs.], [32], [R2], [0.726], [R2 Adj.], [0.717], [AIC], [169.3], [BIC], [173.7], [Log.Lik.], [-81.653], [RMSE], [3.10],
) // end tablex ) // end figure ] ]
block[
block[
import "@preview/tablex:0.0.8": tablex, hlinex, vlinex, colspanx
let nhead = 1;
let nrow = 4;
let ncol = 5;
figure(
kind: "tinytable", supplement: none, tablex( columns: ncol, header-rows: nhead, align: left + horizon, auto-lines: false,
hlinex(y: 0, start: 0, end: 5, stroke: 0.1em + black), hlinex(y: 1, start: 0, end: 5, stroke: 0.05em + black), hlinex(y: 5, start: 0, end: 5, stroke: 0.1em + black), // tinytable lines before
[date_lookup], [price], [price_rank], [memory], [speed_benchmark], [2024-01-15], [\$18.49], [1st], [16 GB], [60%], [2024-01-18], [\$19.99], [2nd], [12 GB], [73%], [2024-01-14], [\$24.99], [3rd], [10 GB], [82%], [2024-01-16], [\$24.99], [3rd], [8 GB], [99%],
) // end tablex ) // end figure ] ]