gpt4 book ai didi

r - knitr::kable() 中的短标题

转载 作者:行者123 更新时间:2023-12-01 23:50:31 26 4
gpt4 key购买 nike

如何在 kable 中创建短标题?

library(dplyr)
library(knitr)
library(kableExtra)

df <- data.frame( X = sample(letters, 10), y = runif(10), z = sample(10:20, 10))

kable(df,
booktabs = TRUE,
caption = "This caption is way too long and doesnt look good when formatted in the Table of Contents. What you really need here is a much shorter caption so that your eyes dont go crazy trying to figure out what information the author is trying to convey. Often there is too much information in the caption anyway so why not shorten it?.",
escape = FALSE,
format = 'latex') %>%
kable_styling(latex_options = c("striped", "hold_position"))

最佳答案

我发现了一个很不起眼的reference对于kable,选择此选项。

要使标题简短,只需使用例如caption.short =“这是一个短标题”

library(dplyr)
library(knitr)
library(kableExtra)
df <- data.frame( X = sample(letters, 10), y = runif(10), z = sample(10:20, 10))

kable(df,
booktabs = TRUE,
caption = "This caption is way too long and doesnt look good when formatted in the Table of Contents. What you really need here is a much shorter caption so that your eyes dont go crazy trying to figure out what information the author is trying to convey. Often there is too much information in the caption anyway so why not shorten it?.",
caption.short = "This is a shorter caption.",
escape = FALSE,
format = 'latex') %>%
kable_styling(latex_options = c("striped", "hold_position"))

关于r - knitr::kable() 中的短标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50164548/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com