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
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}