Quantcast
Channel: Active questions tagged kable - Stack Overflow
Viewing all articles
Browse latest Browse all 106

Let knitr/kable display latex code for further editing (.Rmd file)

$
0
0

Similar to a previous question, I have to convert the chunk of code I used to create a kableExtra table from a Rmarkdown file into pure LaTeX format in Overleaf. Unfortunately, I still have not understood how I can get the latex code by running the KableExtra table in the Rmd file.

The following is the YAML header:

---[...]output:  pdf_document: default  html_document:---

the following is my code:

{r, results='asis', echo=FALSE}res_kbl = kableExtra::kbl(merg, longtable=TRUE, booktabs = T, caption = "Table 1", digits = 2) %>%  kableExtra::kable_styling(latex_options = c("striped", "HOLD_position"), font_size = 10) %>%  kableExtra::add_header_above(c(" " = 1, "in Complete sample" = 2, "in Restricted sample" = 2, "MAJ" = 4, "MIN" = 4, "MAJ" = 4, "MIN" = 4)) %>%  kableExtra::add_header_above(c(" " = 1, "No. of funds" = 4, "Fund Size Complete sample (USD million nominal)" = 8, "Fund Size Restricted sample (USD million nominal)" = 8)) %>%  kableExtra::add_header_above(c(" " = 5, "Complete sample" = 8, "Restricted sample" = 8)) %>%  kableExtra::row_spec(row = nrow(merg) - 1, underline = T, extra_css = "border-bottom: 2px solid;")

My question: How can I get the Latex code for the res_kbl table I have created?

Any suggestion would be very much appreciated!


Viewing all articles
Browse latest Browse all 106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>