Skip to content

Specify width of LaTeX table #119

@krlmlr

Description

@krlmlr

The setting tab_options(table.width = pct(100)) doesn't seem to be respected when rendering to LaTeX, see reprex below. Is this something you'd consider supporting?

It seems that the longtable LaTeX environment is used to render all tables. The fairly new xltabular package could be an option to render long tables with support for the X column modifier, which could perhaps be applied to all columns that are left-aligned.

Related: setting column width (#111).

library(gt)

default_latex <-
  data.frame(a = 1, b = 2) %>%
  gt() %>%
  as_latex()

full_width_latex <-
  data.frame(a = 1, b = 2) %>%
  gt() %>%
  tab_options(table.width = pct(100)) %>%
  as_latex()

identical(default_latex, full_width_latex)
#> [1] TRUE

Created on 2019-01-01 by the reprex package (v0.2.1.9000)

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions