This package simplifies the way to manipulate the HTML or 'LaTeX' codes generated by 'kable()' and allows users to construct complex tables and customize styles using a readable syntax. A character string. Possible values are latex, html, markdown, pandoc, and rst; this will be automatically determined if the function is called within knitr; it can also be set in the global option knitr.table.format.If format is a function, it must return a character string. The caption argument is controlled in the chunk option, under the option, fig.cap. Function 'kable()' is a light weight table generator coming from 'knitr'. digits. Perhaps it is not possible to do what I want to do and if so I would appreciate knowing that. Thanks!!! Arguments x. format. \documentclass{article} \begin{document} \begin{figure} \caption[caption]{This is the caption\\\hspace{\textwidth}This is the second line} \end{figure} \end{document} The reason why \\ does not work originally is that the caption is small enough to fit on one line. Generally, I use kable in knitr to create tables. An R object, typically a matrix or data frame. 15 Common Problems with rmarkdown (and some solutions). We might want to add a top header over the five columns that show years, to distinguish that those are all similar types of columns. There are some things that I run into fairly frequently (and some not so much) when I’m rendering my rmarkdown documents. With kableExtra, this can be added with the function add_header_above.The convention for this argument is to include a value for header that’s a vector; this vector will give the names to use for top-level headers as well as the number of columns they should span. No kable output in nested for loops yihui/knitr-examples#53. ps: kable seems to be semi-intelligent in that it will use format = 'markdown' automatically if you ask knitr to only output the markdown file in the YAML header. Kable not showing output in a for loop #1377. FYI I am running this file under RStudio Version 1.2.1335, which is running R version 3.6.0. This section details some the common problems, and the solution that I have found works for me. In my latest project, I needed to insert the table of transformations for Yeo - Johnson Transformation for normality, which is given here. I am a college student, and use R markdown to create the reports for my assignments. x: For kable(), x is an R object, which is typically a matrix or data frame. So to insert a figure, we do the following. Turns out, the solution is quite simple: the RMarkdown compiler does not show captions for two consecutive figures, like this: ```{r myLabel1, fig.cap='My Caption 1'} qplot(1:10, 10:1) ``` ```{r myLabel2, fig.cap='My Caption 2'} qplot(1:10, 10:1) ``` or for a figure not … Closed yihui mentioned this issue Apr 19, 2017. Possible values are latex, html, pipe (Pandoc's pipe tables), simple (Pandoc's simple tables), and rst.The value of this argument will be automatically determined if the function is called within a knitr document. I have had the same problem, i.e. Closed Copy link CiriLyon commented Aug 23, 2017. Figures captions and labels in knitr Short caption in knitr::kable() How to make a figure caption in Rmarkdown? As soon as you ask for html though (even if you tell it to keep the markdown file), kable will go with format = 'pandoc', which leads to the problem you're experiencing. For kables(), a list with each element being a returned value from kable().. format: A character string. Setting the option '' results='asis'" solve the problem for me. Turns out, the solution is quite simple: the RMarkdown compiler does not show captions for two consecutive figures, like this: ```{r myLabel1, fig.cap='My Caption 1'} qplot(1:10, 10:1) ``` ```{r myLabel2, fig.cap='My Caption 2'} qplot(1:10, 10:1) ``` or for a figure not … Inserting a caption for a figure is a little bit different. Build complex HTML or 'LaTeX' tables using 'kable()' from 'knitr' and the piping syntax from 'magrittr'. 9.5.1 Captions for figures.