kable

kable: Vertical alignment does not work with pdf output

时光毁灭记忆、已成空白 提交于 2020-07-09 06:14:59
问题 I am trying to produce a large table in pdf mixing text and figures using kable . I am trying to align every row to the top. I made an example using a figure test.jpg located inside the working directory. I am using the version 1.22 of knitr . --- output: pdf_document --- ```{r} table <- data.frame( col1 = "test", col2 = "![test](test.jpg){width=150px}") knitr::kable(table) ``` It behaves correctly and aligns the figure and the text to the top if I knit it in html but it aligns the figure and

kableExtra::pack_rows() - grouping not working for last row in long table and no indentation for wrapped text

断了今生、忘了曾经 提交于 2020-07-03 05:25:11
问题 I use the kableExtra package to generate a long table in an R markdown documents knitted to PDF. Sets of rows of the table are grouped together using kableExtra::pack_rows() (formerly kableExtra::group_rows() ) Two issues arise: If the last row forms a set, its grouping is not displayed if one sets longtable = TRUE to allow the long table to span across multiple pages and at the same time uses kable_styling(..., latex_options = c("repeat_header")) to repeat the header of the table on each

kableExtra: Vertical alignment not working in PDF output with many columns

南楼画角 提交于 2020-06-13 07:08:22
问题 The bounty expires in 2 days . Answers to this question are eligible for a +50 reputation bounty. mavericks wants to draw more attention to this question. I would like to align all columns in a kableExtra table to the top. The valign = "top" option does not seem to solve the issue here. Also, the third column is somehow dropped on top of the second for some reason, and citations are not working too. The MWE below is based on this related SO question, which only needs 2 columns: kable:

kableExtra: Vertical alignment not working in PDF output with many columns

扶醉桌前 提交于 2020-06-13 07:06:28
问题 The bounty expires in 2 days . Answers to this question are eligible for a +50 reputation bounty. mavericks wants to draw more attention to this question. I would like to align all columns in a kableExtra table to the top. The valign = "top" option does not seem to solve the issue here. Also, the third column is somehow dropped on top of the second for some reason, and citations are not working too. The MWE below is based on this related SO question, which only needs 2 columns: kable:

Increase line/row spacing with kableExtra

≡放荡痞女 提交于 2020-06-12 04:35:22
问题 Is there a way to increase the line spacing with kableExtra for a pdf output in r-markdown or bookdown? library(knitr) library(kableExtra) kable( head(iris, 5), caption = 'Iris Table', booktabs = TRUE) %>% kable_styling(latex_options = "striped") 回答1: You can just do it using the LaTeX command \arraystretch : --- output: pdf_document --- ```{r setup, include=FALSE} library(kableExtra) library(tidyverse) ``` \renewcommand{\arraystretch}{2} ```{r, echo=FALSE} library(knitr) library(kableExtra)