r-markdown - 如何在用 kable 生成的表格的脚注中插入引文?
问题描述
我试图在脚注(甚至表格中的任何文本)中添加引文,但它不起作用,引文文本按原样显示。我以为我需要将格式表更改为markdown
而不是latex
使用bookdown::pdf_document2
,但两者都没有解决问题。另一种尝试是使用单独的代码块在 kable 外部创建引用文本,然后paste
在内部footnote
也不起作用。这是我的代码:
---
title: "scientific report"
output:
pdf_document:
fig_caption: true
keep_tex: true
number_sections: yes
latex_engine: xelatex
csl: elsevier-with-titles.csl
bibliography: citations.bib
link-citations: true
linkcolor: blue
---
# This is an exaample
the 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")
)
我将非常感谢任何有用的信息。
解决方案
好吧,经过多次尝试,它与这里的传统交叉引用一起工作。所以如果其他人有同样的问题,我只是这样做:
(ref:caption) The source is [@Burg_2019]
在块之外,然后在脚注内footnote(general ="A general footnote",alphabet = "(ref:caption)" )
推荐阅读
- linux - 在 Intel 和 nvidia 上读取 gpu 负载
- identityserver4 - 使用 IdentityServer4 对 Web API 进行基于角色的授权
- scala - 如何找到两个数据帧之间的精确匹配和非精确匹配?
- rest - 为什么基于约定的路由在 RESTful API URI 模式中效率较低?
- struts1 - Apache Struts 1.x 无漏洞版本
- ruby-on-rails - Rails 5 Puma 服务器不断冻结和挂起,除非我将工人数设置为 20
- django - 同时更新实例成员的多个字段
- azure - 如何使用 azure powershell 命令获取特定 azure 资源组中存在的 azure 逻辑应用列表
- marklogic - 带约束的 MarkLogic 搜索返回错误结果
- .net - .NET core 2.1 模板缺失