Questions tagged [longtable]
74 questions
16
votes
1 answer
Longtable in a knitr (PDF) document: using xtable (or kable)
I am new to knitr and I have had some very basic latex knowledge in the past, so I googled already hoping to find a solution that was already posted somewhere. However, I was not able to solve my problem. I am hoping someone will be kind enough to…

mdk
- 181
- 1
- 1
- 7
12
votes
2 answers
Repeat headers when using xtable with longtable option
Is there a way to repeat the top row / set headers when generating an xtable with a longtable option ?
For eg., if I have
tableSb <- xtable(df, caption="A Very Long Table", label="ALongTable")
print(tableSb, include.rownames=TRUE,…

xbsd
- 2,438
- 4
- 25
- 35
10
votes
3 answers
How can I restrict the size of my \multicolumn cells in a longtable?
I have a really long table in LaTeX that spans several pages and is (as it is now) also too wide for the page.
I am using the longtable package with every column width specified with the p{width} command.
The problem is, that most of the rows…

Mica
- 18,501
- 6
- 46
- 43
7
votes
1 answer
kableExtra: Continued on Next Page for longtable
I am using kableExtra for longtable with the following code.
library(knitr)
library(kableExtra)
long_dt <- rbind(mtcars, mtcars)
kable(
long_dt,
format = "latex",
longtable = T,
booktabs = T,
caption =…

MYaseen208
- 22,666
- 37
- 165
- 309
7
votes
1 answer
Set column alignment and width for xtable generated longtable
Please consider the following MWE
library(xtable)
DF <- as.data.frame(UCBAdmissions)
print(xtable(DF, align="p{0.4\textwidth}|p{0.15\textwidth} p{0.15\textwidth} p{0.15\textwidth}"), sanitize.text.function = function(x){x},
…

CptNemo
- 6,455
- 16
- 58
- 107
5
votes
1 answer
How to fix the width of longtable LATEX
I want to set the width of my longtable so it fits within the page and not crops out. I have 206 columns and 17 rows.
I use tablesgenerator.com to get my longtable, but the option "Scale table to text width" doesn't work with longtable, could use…

Landberg
- 51
- 1
- 1
- 3
5
votes
2 answers
Latex: hyperref to individual longtable rows
I have a few longtables that stretch several pages and I want to use pageref and hyperref to link to these rows.
But whatever I try, the links always refer to the start of the table.
When I look into the aux file, the labels all seem to be…

heeen
- 4,736
- 2
- 21
- 24
4
votes
1 answer
LaTeX Error: Environment ThreePartTable undefined
I am trying to create a table using apa_table(), Papaja, and RMarkdown in RStudio. Whenever I include longtable in the apa_table function, I get the error:
! LaTeX Error: Environment ThreePartTable undefined.
Strangely, the error log that's produced…

Tim Bainbridge
- 177
- 2
- 9
4
votes
1 answer
R Markdown table caption width with kable and longtable
Using R Markdown to output a pdf. kable() works great but when I add longtable=T the caption no longer extends the full width of the table. I can't seem to find an argument that will control the caption details here. I can move the caption to be…

Jordan
- 614
- 1
- 7
- 20
4
votes
1 answer
Can longtable be made to start halfway down a page?
Aware that old versions of longtable had trouble starting tables halfway down a page I have downloaded the latest longtable.sty, and it's in the same directory as my document; but there is still page break (and an approximately 75% blank page)…

James
- 24,676
- 13
- 84
- 130
4
votes
3 answers
knitr xtable highlight and add horizontal lines for the same row,
I am using knitr and xtable to automate my reporting procedure. I want to highlight a few rows of a table and have a horizontal line right above each row highlighted. The .Rnw file I am using reads as below:
\usepackage{colortbl,…

user2854008
- 1,161
- 4
- 17
- 23
4
votes
1 answer
sweave, xtable, longtable and alternating row colors...problems with `add.to.row`
This existing question covers a way to alternate row colors in a latex table by post-processing the output from print.xtable(), but I think it's possible to achieve the same thing by using the add.to.row argument of print.xtable() as described on…

mac
- 3,137
- 1
- 28
- 42
3
votes
2 answers
How to add a vertical scrollbar in html output from jupyter notebook with nbconvert?
I am automatizing some reports with jupyter and exporting it to html. I have some large tables, and I want to add a scrollbar to rigthside of table. A similar question is here: How to get a vertical scrollbar in HTML output from Jupyter notebooks.…

Mentoldo
- 43
- 1
- 7
3
votes
1 answer
Large table in Latex gets cut off when outputting to PDF?
I haven't worked with much Latex syntax so I'm not quite sure what stylization changes I need to make here.
I have a large piece of Latex as…

archingfork
- 145
- 1
- 7
3
votes
3 answers
How do I calculate new variables in R long tables?
I have a long table with multiple variables (CPI - Workers, CPI - Consumers, (Seas) Unemployment Level (thous) and many more, but am truncating the data set to 3 variables and 6 time periods for brevity. I want to create a new variable, which is a…

Coventure Joe
- 149
- 1
- 6