表格无序出现在附录部分(R-降价)

表格无序出现在附录部分(R-降价),r,r-markdown,R,R Markdown,我正在用R markdown写我的Ms论文,附录部分有问题。我需要把一些表格放在附录部分,但当我呈现它时,小节的标题出现在de表格下面。像这样: 我想知道是否有办法解决这个问题 我编写代码的方式是: # Appendix {-} ## Subsection title chunk with table R标记块: title: "Title of my thesis" subtitle: author: - "Student :" -

我正在用R markdown写我的Ms论文,附录部分有问题。我需要把一些表格放在附录部分,但当我呈现它时,小节的标题出现在de表格下面。像这样:

我想知道是否有办法解决这个问题

我编写代码的方式是:


# Appendix {-}

## Subsection title

chunk with table 

R标记块:

title: "Title of my thesis"
subtitle: 
author: 
 - "Student :"
 - "Director: "
output: 
 pdf_document:
  number_sections: true
 latex_engine: xelatex
 template: NULL
 word_document: default
degree: Ms Biology
field: Experimental biology
year: 2021
geometry: left=2cm,right= 2 cm,top=2 cm, bottom=2 cm
papersize: a4
header-includes: 
 - \usepackage{amsmath} 
 - \usepackage{booktabs}
 - \usepackage{pdflscape}
 - \usepackage[justification=raggedright,labelfont=bf,singlelinecheck=false]{caption}
 - \usepackage{setspace}
bibliography: library.bib
csl: apa7.csl
fontsize: 11 pt
indent: true
spacing: 1.5

和块选项

knitr::opts_chunk$set(
      echo = FALSE, 
      warning = FALSE, 
      message = FALSE,
      error =FALSE)

好吧,为了停止把桌子放在de副标题下,我必须加上

 - \usepackage{flafter}
然后表格会出现在下一页,为了避免出现这种情况,我补充道

kbl(data)%>%
kable_styling(latex_options = "hold_position")

仅此而已。

能否提供rmarkdown区块的详细信息,包括您正在使用的区块选项;大概输出是pdf?表是如何创建的?请尝试在小节标题之前添加\clearpage。仍然不工作:c