Open cswingle opened 2 years ago
Any updates on this? I've run into the exact same issue and this would be awesome to have!
Relates to #1177, #1630
Hi! I just wanted to encourage the development of this feature! It is something that is missing for me, and that would make me shift from the other packages to gt
.
Proposal
When a table is converted to LaTeX the column labels are only printed on the first page of output. If the table extends onto subsequent pages, only the data rows are show. It would be handy to have an option to include headers and/or column labels at the top of each page. In the
longtable
environment, this is fairly simply done by adding\endhead
at the end of what is considered the table header.For example, here's a random table of numbers that spans two pages in LaTeX:
The raw TeX (
t
) is:The top of the second page looks like this when the TeX is rendered to PDF:
If
\\endhead\n
is placed just after\\midrule\n
in the raw output, the table will be rendered with the "id" and "random" headers on each page.Like this:
I took a quick look at the code and it seems like this could be added to
latex_heading_row
and/orlatex_group_row
ofR/utils_render_latex.R
, but I'm not sure how options might get passed in here and there would be some additional logic to handle the placement of\endhead
when there's both gt headers and column labels.Maybe similar to #194