2017-09-10 59 views
1

我看了this question,但给出的方法似乎不适用于脚注(请参阅MWE)。我想知道如何使用kableExtra包在表脚注中添加超链接。kableExtra:表格脚注中的超链接

knitr::kable(
       x  = mtcars[1:4, 1:5] 
      , format = "latex" 
      , caption = "Table Caption with hyperlink[note]" 
      , escape = FALSE 
      ) %>% 
    kableExtra::add_footnote("\\href{https://github.com/haozhu233/kableExtra}{kableExtra}") 

回答

2

使用kableExtra> 0.5.0时,脚注中可以使用escape

library(kableExtra) 
knitr::kable(mtcars[1:4, 1:5], 
     format = "latex", 
     caption = "Table Caption with hyperlink[note]", 
     escape = FALSE 
     ) %>% 
    add_footnote("\\href{https://github.com/haozhu233/kableExtra}{kableExtra}", 
         escape = F) 
+0

感谢@Hao的精彩包和漂亮的解决方案。 'kableExtra'上有[另一个问题](https://stackoverflow.com/q/46156841/707145)。如果你有机会看看并帮助我,我将不胜感激。谢谢 – MYaseen208