Caption above figure using knitr (LaTeX/PDF)

后端 未结 3 761
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 15:47

I would like to place the caption above the figure using knitr in texmaker. I know that this question has already been asked, and I understand that the solution suggested so

3条回答
  •  暖寄归人
    2020-12-03 16:20

    Try using hook:

    <>=
    f <- function(x, options) {
      paste("\\end{kframe}\n", 
            "\\caption{", options$capT, "}\n", 
            hook_plot_tex(x, options), 
            "\n\\begin{kframe}", sep = "")
    }
    knit_hooks$set(plot = f)
    @
    
    \begin{figure} 
    <>= 
    plot(1) 
    @ 
    \end{figure} 
    

    enter image description here

提交回复
热议问题