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

Add basic support for specifying column widths in LaTeX table outputs #1371

Merged
merged 7 commits into from Jul 10, 2023

Conversation

rich-iannone
Copy link
Member

This adds rudimentary support for defining column widths for LaTeX output tables. Accepts length values in px which, in LaTeX, is equivalent to bp (big point, 1/72 in; 1 pt almost equivalent to 1 bp) units.

Here is a working example table that defines widths for the stub's rowname column, and two columns in the table body. It is okay to define only a few column widths.

dplyr::tibble(
  row = "one",
  group = "a",
  a = "The development of industrial typefaces began in the late 19th century and was greatly influenced by the industrial and technological advancements of the time. Industrial typefaces are distinguished by their strong sans serif letterforms, straightforward appearance, and use of geometric shapes and straight lines.",
  b = 23.6
) |>
  gt(rowname_col = "row", groupname_col = "group", row_group_as_column = TRUE) |>
  cols_width(row ~ px(80), a ~ px(150), b ~ px(100))
col-widths-latex-table

Fixes: #851
Fixes: #634

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for quarto-gt-examples failed.

Name Link
🔨 Latest commit d90b333
🔍 Latest deploy log https://app.netlify.com/sites/quarto-gt-examples/deploys/64ac3f75c9c0840008ca2053

@rich-iannone rich-iannone marked this pull request as ready for review July 10, 2023 17:27
@rich-iannone rich-iannone merged commit 98ed67d into master Jul 10, 2023
13 of 18 checks passed
@rich-iannone rich-iannone deleted the latex-column-widths branch July 10, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to create latex rules Column widths not porting to LaTeX
1 participant