Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabularray inner end #390

Merged
merged 5 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 9 additions & 8 deletions R/style_tabularray.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
)
Expand Down
6 changes: 1 addition & 5 deletions inst/tinytest/_tinysnapshot/latex-theme_grid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
8 changes: 2 additions & 6 deletions inst/tinytest/_tinysnapshot/latex-theme_striped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Loading