Quantcast
Viewing latest article 14
Browse Latest Browse All 106

how to insert citation in a footnote of table generated with kable?

I was trying to add citation in a footnote (or even in any text in the table) but it's not working, the citation text appears as it is. I thought I need to change the format table to markdown instead of latex and using bookdown::pdf_document2 but both did not solve the problem. another attempt was to create a citation text outside kable with a separate code chunk and then paste it inside the footnote also didn't work.this is my code:

---title: "scientific report"output:  pdf_document:   fig_caption: true   keep_tex: true   number_sections: yes   latex_engine: xelatexcsl: elsevier-with-titles.cslbibliography: citations.biblink-citations: truelinkcolor: blue---# This is an exaamplethe number of the table below is [\ref{do}]P.S. I wrote the superscript (a) manually in the xlsx file.```{r  echo=FALSE }library(knitr)library(kableExtra)library("readxl")dfdf <-  read_excel("dyss_count.xlsx")df <- as.data.frame(dfdf)options(knitr.kable.NA = '')kable(df, "latex", longtable = T, booktabs = T,escape = F ,caption = 'dosage \\label{do}',align = "c") %>%  kable_styling(latex_options = c('repeat_header'), font_size = 7) %>% footnote(general ="A general footnote",           alphabet = 'the source is @Burg_2019',           general_title = "General: ", number_title = "Type I: ",           alphabet_title = "Type II: ",            footnote_as_chunk = T, title_format = c("italic", "underline")           )

result is:

I would be very thankful for any useful information.


Viewing latest article 14
Browse Latest Browse All 106

Trending Articles