kableExtra:表格脚注中的超链接 [英] kableExtra: Hyperlink in footnote of a table

查看:65
本文介绍了kableExtra:表格脚注中的超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查看了这个问题,但是给定的方法似乎不适用于脚注(请参阅MWE).我想知道如何使用 kableExtra 包在表脚注中添加超链接.

I looked this question but the given method does not seem work with footnotes (See MWE). I wonder how to add hyperlink in table footnotes using kableExtra package.

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

推荐答案

如果kableExtra> 0.5.0,则可以在脚注中使用 escape .

With kableExtra > 0.5.0, you can use escape in footnote.

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)

这篇关于kableExtra:表格脚注中的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆