Skip to content

Commit

Permalink
typst: template align improvements. no go
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Oct 25, 2024
1 parent d89aede commit 086ad10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions R/style_typst.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

#
Expand Down
12 changes: 7 additions & 5 deletions inst/templates/typst.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 086ad10

Please sign in to comment.