我正在尝试使用长表和兰斯角一起作为一个宽表,跨越多个页面。当我这样做时,表标题从页面的整个宽度一直压缩到页面的中间。
我曾尝试使用以下建议,但未能奏效。R Markdown table caption width with kable and longtable
我是新手,而且我对latek一点也不熟悉,所以遵循上面的说明让我很困惑,尽管我已经尝试了所有我认为是正确的选项。有人能给我非常明确的一步一步的指示吗?在YAML中应该放些什么来解决这个问题?还是有人有别的工作要做?谢谢你的帮助
test <- data.frame(col1=rep("MyLongWordsareLong",5),
col2=rep("MyLongWordsareLong",5),
col3=rep("MyLongWordsareLong",5),
col4=rep("MyLongWordsareLong",5),
col5=rep("MyLongWordsareLong",5),
col6=rep("MyLongWordsareLong",5))
kable(test,format='latex',booktabs=TRUE,
caption="This is my example caption. See how, when I don't use
longtable, it extends the full width of the table, but when I use the
longtable option, it compresses down to only a portion of the table's width.
Is this weird or is it just me?") %>%
landscape()
kable(test,longtable=TRUE,format='latex',booktabs=TRUE,caption="This is my
example caption. See how, when I don't use longtable, it extends the full
width of the table, but when I use the longtable option, it compresses down
to only a portion of the table's width. Is this weird or is it just me?")
%>%
landscape()**编辑:我正在编织PDF!
发布于 2020-12-14 23:11:47
---
title: "Untitled"
author: "anonymous"
date: "14/12/2020"
header-includes:
- \usepackage{caption}
output:
pdf_document:
keep_tex: yes
html_document: default
---
```{r setup, include=FALSE}knitr::opts_chunk$set(echo =真)
图书馆(Tidyverse)
图书馆(KableExtra)
```{r}测试<- data.frame(col1=rep("MyLongWordsareLong",5)
col2=rep("MyLongWordsareLong",5), col3=rep("MyLongWordsareLong",5), col4=rep("MyLongWordsareLong",5), col5=rep("MyLongWordsareLong",5), col6=rep("MyLongWordsareLong",5))kable(test,booktabs=TRUE,caption=“这是我的示例标题。看看当我不使用长表时,它如何扩展了表的全部宽度,但是当我使用长表选项时,它只压缩到表宽度的一部分。这是奇怪的还是只有我自己?”) %>%?
景观()
kable(test,longtable=TRUE,booktabs=TRUE,caption=“这是我的示例说明。看看当我不使用only table时,它如何扩展了表的全部宽度,但是当我使用长表选项时,它只压缩到表宽度的一部分。这是奇怪的还是只有我自己?”) %>%?
景观()
根据R Markdown table caption width with kable and longtable解决方案
https://stackoverflow.com/questions/65291341
复制相似问题