diff --git a/NEWS.md b/NEWS.md index c6373b92..0d79e35a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -36,6 +36,7 @@ Bugs: * Typst notes returned an error since the last release. Thanks to @DominikVogel for report #357. * Duplicate group labels are allowed in LaTeX with `group_tt()`. Thanks to @eeemda for report #362. + ## 0.5.0 New: diff --git a/R/style_tabularray.R b/R/style_tabularray.R index c43445c7..c3f14936 100644 --- a/R/style_tabularray.R +++ b/R/style_tabularray.R @@ -38,14 +38,6 @@ setMethod( sty$alignv[which(sty$alignv == "t")] <- "h" sty$alignv[which(sty$alignv == "m")] <- "m" - for (spec in stats::na.omit(sty$tabularray_inner)) { - x@table_string <- tabularray_insert(x@table_string, content = spec, type = "inner") - } - - for (spec in stats::na.omit(sty$tabularray_outer)) { - x@table_string <- tabularray_insert(x@table_string, content = spec, type = "inner") - } - set <- span <- rep("", nrow(rec)) # d-column are column-wise, so we treat them here @@ -240,6 +232,15 @@ setMethod( x@table_string <- tabularray_insert(x@table_string, content = s, type = "inner") } + for (spec in unique(stats::na.omit(sty$tabularray_inner))) { + x@table_string <- tabularray_insert(x@table_string, content = spec, type = "inner") + } + + for (spec in unique(stats::na.omit(sty$tabularray_outer))) { + x@table_string <- tabularray_insert(x@table_string, content = spec, type = "inner") + } + + return(x) } ) diff --git a/inst/tinytest/_tinysnapshot/latex-theme_grid.txt b/inst/tinytest/_tinysnapshot/latex-theme_grid.txt index 81f546cc..4fdd5315 100644 --- a/inst/tinytest/_tinysnapshot/latex-theme_grid.txt +++ b/inst/tinytest/_tinysnapshot/latex-theme_grid.txt @@ -5,15 +5,11 @@ { %% tabularray inner open colspec={Q[]Q[]Q[]Q[]Q[]}, hlines, vlines, -hlines, vlines, -hlines, vlines, -hlines, vlines, -hlines, vlines, } %% tabularray inner close mpg & cyl & disp & hp & drat \\ 21.0 & 6 & 160 & 110 & 3.90 \\ 21.0 & 6 & 160 & 110 & 3.90 \\ -22.8 & 4 & 108 & 93 & 3.85 \\ +22.8 & 4 & 108 & 93 & 3.85 \\ 21.4 & 6 & 258 & 110 & 3.08 \\ \end{tblr} \end{table} diff --git a/inst/tinytest/_tinysnapshot/latex-theme_striped.txt b/inst/tinytest/_tinysnapshot/latex-theme_striped.txt index 4e6dcac5..f92c2781 100644 --- a/inst/tinytest/_tinysnapshot/latex-theme_striped.txt +++ b/inst/tinytest/_tinysnapshot/latex-theme_striped.txt @@ -4,19 +4,15 @@ ] %% tabularray outer close { %% tabularray inner open colspec={Q[]Q[]Q[]Q[]Q[]}, -row{even}={bg=black!5!white}, -row{even}={bg=black!5!white}, -row{even}={bg=black!5!white}, -row{even}={bg=black!5!white}, -row{even}={bg=black!5!white}, row{2,4}={}{bg=cededed,}, +row{even}={bg=black!5!white}, } %% tabularray inner close \tinytableDefineColor{cededed}{HTML}{ededed} \toprule mpg & cyl & disp & hp & drat \\ \midrule %% TinyTableHeader 21.0 & 6 & 160 & 110 & 3.90 \\ 21.0 & 6 & 160 & 110 & 3.90 \\ -22.8 & 4 & 108 & 93 & 3.85 \\ +22.8 & 4 & 108 & 93 & 3.85 \\ 21.4 & 6 & 258 & 110 & 3.08 \\ \bottomrule \end{tblr}