longtable

R Markdown table caption width with kable and longtable

邮差的信 提交于 2021-01-01 06:05:13
问题 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 output for each code chunk but would rather use the built in functionality within kable if possible. Thanks! --- title: "test" author: "" date: "September 6, 2017" output: pdf_document: latex_engine: xelatex --- ```{r setup, include=FALSE} knitr::opts

LaTeX Error: Environment ThreePartTable undefined

我只是一个虾纸丫 提交于 2020-01-04 06:01:46
问题 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 includes: (/home/tim/.TinyTeX/texmf-dist/tex/latex/threeparttable/threeparttable.sty Package: threeparttable 2003/06/13 v 3.0 and Package caption Info: threeparttable package is loaded. Note the different capitalization between the error and the

How can I restrict the size of my \multicolumn cells in a longtable?

家住魔仙堡 提交于 2019-12-08 18:18:38
问题 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 contain a multicolumn call, and thus are not adhering to the preamble p{width} command, which causes the total width of the table to be too large. Minimal example: \begin{longtable}{|p{1in}|p{0.75in}|p{0.5in}|p{0.5in}|>{p{1in}|p{1in}|} \caption{some cap}

sweave, xtable, longtable and alternating row colors…problems with `add.to.row`

旧巷老猫 提交于 2019-12-07 18:04:47
问题 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 stats.stackexchange, avoiding the need for post-processing, which is nice with Sweave. That answer deals with coloring the background of one specific row, but I think it can be extended to coloring all the odd rows. The problem I'm running into has

Longtable in a knitr (PDF) document: using xtable (or kable)

纵饮孤独 提交于 2019-12-07 00:23:03
问题 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 provide help. I have a data frame of 14 columns and many rows, let's say 60. Using the data I need to produce a PDF report in landscape layout and present this data frame as a table there. The closest solution I found is here at tex.stackexchange

How to only show table caption once in “list of table” for a table split onto multiple pages

我与影子孤独终老i 提交于 2019-12-06 12:56:49
问题 I am using R packages ( xtable and knitr ) and Latex packages ( longtable and hyperref ) to prepare a document. One of my tables is very long and splits onto multiple pages. It turned out that the "List of Table" shows every page number at which this table appears, but all hyperlinks bring me to the beginning of this table. My question is, in "List of Table" how can I just show the first page number at which this table appears. \documentclass{article} \usepackage{longtable} \usepackage

sweave, xtable, longtable and alternating row colors…problems with `add.to.row`

元气小坏坏 提交于 2019-12-06 03:23:11
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 stats.stackexchange , avoiding the need for post-processing, which is nice with Sweave. That answer deals with coloring the background of one specific row, but I think it can be extended to coloring all the odd rows. The problem I'm running into has to do with the add.to.row argument, making the length of list pos equal the length of character vector

Longtable in a knitr (PDF) document: using xtable (or kable)

时光总嘲笑我的痴心妄想 提交于 2019-12-05 05:17:39
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 provide help. I have a data frame of 14 columns and many rows, let's say 60. Using the data I need to produce a PDF report in landscape layout and present this data frame as a table there. The closest solution I found is here at tex.stackexchange.com: LaTex Longtable spanning several pages I used some of the hints there. However, the table is not

How to only show table caption once in “list of table” for a table split onto multiple pages

此生再无相见时 提交于 2019-12-04 19:08:46
I am using R packages ( xtable and knitr ) and Latex packages ( longtable and hyperref ) to prepare a document. One of my tables is very long and splits onto multiple pages. It turned out that the "List of Table" shows every page number at which this table appears, but all hyperlinks bring me to the beginning of this table. My question is, in "List of Table" how can I just show the first page number at which this table appears. \documentclass{article} \usepackage{longtable} \usepackage{hyperref} <<setup, include=FALSE, cache=FALSE>>= library(knitr) library(xtable) @ \begin{document}

Repeat headers when using xtable with longtable option

試著忘記壹切 提交于 2019-12-04 18:28:01
问题 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, tabular.environment="longtable", floating=FALSE) This works fine, but when the tables roll over into a new page the headers are not repeated. Any suggestions ? 回答1: In order to accomplish this, you'll need to use the add.to.row option of the print function (run