How to hold figure position with figure caption in pdf output of knitr?

后端 未结 7 1897
不知归路
不知归路 2020-11-29 18:45

I am using knitr (1.9.5 and 1.9.17) and rmarkdown (0.5.3.1), and would like to hold figure position in the pdf output. The generated pdf file is working fine when chunk opti

相关标签:
7条回答
  • 2020-11-29 19:16

    For me adding the float package and then \floatplacement{figure}{H} in YAML solved the issue like :

    ---
    title: "test"
    date: "`r Sys.Date()`"
    output: 
      pdf_document :
        keep_tex: true
        number_sections: true
    header-includes:
     \usepackage{booktabs}
     \usepackage{longtable}
     \usepackage{array}
     \usepackage{multirow}
     \usepackage[table]{xcolor}
     \usepackage{wrapfig}
     \usepackage{float}
     \floatplacement{figure}{H}
    ---
    
    0 讨论(0)
提交回复
热议问题