Skip to content
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: gt
Title: Easily Create Presentation-Ready Display Tables
Version: 1.2.0.9000
Version: 1.2.0.9001
Authors@R: c(
person("Richard", "Iannone", , "rich@posit.co", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-3925-190X")),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# gt (development version)

* Update how long text that has a line break or is horizontally aligned in a cell (stubs, labels, table body).

# gt 1.2.0

* The new `fmt_number_si()` function format numeric values with SI prefixes and an optional unit (which could be also be obtained from a separate column), automatically selecting the appropriate prefix to keep the mantissa in a readable range (#1999). (#2060)
Expand Down
7 changes: 6 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,12 @@ markdown_to_latex <- function(text, md_engine) {
}

if(grepl("..gt\\_linebreak\\_indicator..", x, fixed = TRUE)){
x <- paste0("\\shortstack[l]{" ,gsub("..gt\\_linebreak\\_indicator..", " \\\\", x, fixed = TRUE), "}")
## if there is a linebreak, wrap the text in a shortstack, and put it into a parbox that has the width set to linewidth
x <- paste0("\\shortstack[l]{" ,
parbox_wrapper(
gsub("..gt\\_linebreak\\_indicator..", " \\\\", x, fixed = TRUE),
"\\linewidth"),
"}")
}

x
Expand Down
Loading