r-markdown - 我可以避免 Rmarkdown pdf 文档中 kableExtra table 上的 table 脚注左侧缩进吗?

我将 R markdown 与 kableExtra 一起用于 PDF 文档。每当我使用 kableExtra::footnote() 在 table 的底部添加注释时,注释都会缩进一点。但我需要 table 脚注与左侧的 table 边框对齐。这可能吗?

这是我现在使用的代码:

mainfont: Times New Roman  
fontsize: 12pt   
geometry: "left=3cm,right=3cm,top=2cm,bottom=2cm"  
output:   
  pdf_document:  
      toc: false  
      latex_engine: xelatex  
header-includes:  
    - \usepackage{caption}  
---

\captionsetup[table]{labelformat=empty} 

\captionsetup{justification=centering}  
\renewcommand{\arraystretch}{2}
{r results='asis',echo=FALSE}

library(data.table)
library(kableExtra)

a = c(3,    72.3,   67.9, NA, NA,   79.5)           
b = c(4,    73.2,   68.8,   68.5, 79.7, 76.3)

mytable = rbind(a,b)
row.names(mytable)=NULL
colnames(mytable) = c("Grade", "Mathematics", "Reading", "Writing", "Science", "Social Studies")
opts = options(knitr.kable.NA = "")

mytable %>%
  kbl(caption = '\\textbf{Table Title}',format='latex',booktabs=T,align='c') %>%

  kable_styling(latex_options = c("striped","HOLD_position","scale_down"),position='center',full_width = FALSE) %>%
  
  footnote(general_title="Notes: ",
    general= c("1. Consistency indicates the proportion of students that would be classified to the same performance   levels should they have been administered a parallel test form. The numbers are on 0-100% scale.", "2. Accuracy indicates the proportion of students that are accurately classified and the numbers are on a 0-100% scale."),threeparttable=T) %>%
  column_spec(6, width = "4em") %>%
  row_spec(0,bold=T) %>% 
  add_header_above(c(" ", "Design Consistency" = 2, "Design Accuracy" = 3),bold=TRUE,align='c',line=TRUE,line_sep=0)

回答1

我认为这来自选项 threeparttable,如果您将其设置为等于 FALSE,缩进应该消失(但它可能不再那么好看了)

相似文章

php - while 循环只在 FPDF 中打印 1 个结果

我想根据“where$bulan”调用数据,在数据库中$bulan有一些相同的数据,但如果我调用只显示第一个输入。我已经使用了while但它不起作用你们能帮忙吗?我有这样的代码<?phprequire...