Breaking changes
- The
extract_body()
function now, by default, will not display columns that have been hidden (e.g., bycols_hide()
orcols_merge*()
); the previous behavior can be restored by usingincl_hidden_cols = TRUE
.
Improvements to the LaTeX output format
-
PDF output now defaults to a full-width floating environment using
tabular*
. Float position can be controlled by thelatex.tbl.pos
argument intab_options
. Quarto users can alternatively use thetbl-pos
argument to control positioning. To use alongtable
environment instead, usetab_option(latex.use_longtable = TRUE)
. (@AronGullickson, #1588) -
Creating a caption with
tab_caption()
will now be preserved in LaTeX output withas_latex()
. Cross-referencing a table using the internal cross-referencing system of bookdown is now enabled for PDF and HTML outputs (for HTML, setoptions("htmltools.preserve.raw" = FALSE)
). Quarto users should use thetbl-cap
andlabel
cell options. (@nielsbock, #1800) -
Improved the centering of the stubhead label in Latex when
row_group_as_column = TRUE
and the width of the row name column is specified. (@kbrevoort, #1804) -
LaTeX now correctly renders if text size is changed (#1885). (@olivroy, #1899)
-
Fixed a bug that caused an error in LaTeX when (1)
row_group_as_column = TRUE
, (2) the row groups were specified usingtab_row_group()
, and (3) the user specified a width for the row label column. (@kbrevoort, #1804) -
Fixed an issue where column widths weren't set properly using
col_widths()
for LaTeX output (#1837). (@snhansen, #1867)
Interactive table support
-
Interactive tables will show no border if
opt_table_lines(extent = "none")
is specified (#1307). -
Interactive tables now respect more styling options, namely:
column_labels.background.color
,row_group.background.color
,row_group.font.weight
,table_body.hlines.style
,table.font.weight
,table.font.size
, andstub.font.weight
. (#1693) -
opt_interactive()
now works when columns are merged withcols_merge()
. (@olivroy, #1785) -
opt_interactive()
now works when columns are substituted withsub_*()
. (@olivroy, #1759) -
More support for
cells_stubhead()
styling and footnotes in interactive tables.
Minor improvements and bug fixes
-
New arguments have been added to
extract_body()
to better control which columns will be present in the returned data (#1875). (#1889) -
The
locale
argument ofgt()
now defaults togetOption("gt.locale")
if set. (#1894) -
The optional argument
levels
was added tocells_column_spanners()
to constrain targeting of column spanners by their level. (@obsaditelnost, #1858) -
Fixed a bug in using
pct()
column widths withas_gtable()
(#1771). (@teunbrand, #1776) -
Fixed a bug where
gt(row_group_as_column = TRUE)
would create the wrong layout withas_gtable()
when all groups are unique. (@olivroy, #1803) -
Showing currency symbols in grid output now works. (@olivroy, #1788)
-
data_color()
no longer errors when a tidyselect selection is empty (likefmt_*()
functions) (#1665). (@olivroy, #1795) -
Fixed an issue when using
text_case_match(.replace = "all", .locations = cells_column_spanners())
. (@olivroy, #1823) -
Improved performance during footnote rendering. (@olivroy, #1818)
-
Improved footnote rendering in Quarto with
fmt_markdown()
(#1773). (@olivroy, #1860) -
Fixed an issue where
md("")
would fail in Quarto (#1769). (@olivroy, #1772) -
Fixed a bug where spanners didn't render correctly in Quarto (#1839). (#1856)
-
vec_fmt_markdown()
works correctly inside Quarto again (#1840). (@olivroy, #1841) -
Fixed an issue where
tab_spanner_delim()
would fail to resolve a duplicate ID value. (@olivroy, #1821) -
Fixed an issue with multiple
text_replace()
calls would produce bad results withcells_column_labels()
. (@olivroy, #1824) -
cols_add()
works correctly in more cases. (#1893) -
tab_footnote()
now correctly adds footnote marks in thecells_stub_summary()
andcells_stub_grand_summary()
locations (#1832). (@olivroy, #1833) -
tidyselect::where()
,tidyselect::all_of()
, andtidyselect::any_of()
are now re-exported by gt. (#1830) -
Fixed an issue where
md()
andfmt_markdown()
would render factors as their numeric levels rather than their text labels (#1882). (@rossellhayes, #1883) -
vec_fmt_*()
(and incidentallycols_nanoplot()
) should be faster now. (@olivroy, #1888, #1891, #1896, #1901) -
Improved error messages for the
text_transform()
function iflocations
couldn't be resolved. (@olivroy, #1774) -
tab_row_group()
gives a more precise error message whenrows
can't be resolved correctly (#1535). (@olivroy, #1770)