diff --git a/R/style_typst.R b/R/style_typst.R index 7a515b0e..6eeae506 100644 --- a/R/style_typst.R +++ b/R/style_typst.R @@ -112,6 +112,7 @@ style_apply_typst <- function(x) { for (s in styles) { x@table_string <- lines_insert(x@table_string, s, "tinytable cell style after", "after") + x@table_string <- lines_insert(x@table_string, s, "tinytable cell align after", "after") } # diff --git a/inst/templates/typst.typ b/inst/templates/typst.typ index a39e49b0..d94e92af 100644 --- a/inst/templates/typst.typ +++ b/inst/templates/typst.typ @@ -42,19 +42,21 @@ block[ // start block #table( // tinytable table start stroke: none, align: (x, y) => { - let a = left - if style-array.len() == 0 { + let align-array = ( + // tinytable cell align after + ) + if align-array.len() == 0 { + left + } else { let a = right - } - if style-array.len() > 0 { // for style in style-array { // let m = style.pairs.find(k => k.at(0) == x and k.at(1) == y) // if m != none and ("align" in style) { // let a = style.align // } // } + a } - a }, fill: (x, y) => { for style in style-array {