为了建立一个教学大纲,我想知道是否可以插入一个引文作为一个完整的引文。现在,我有以下标记代码:
# Session 1
@zhu2015.这在pdf中转换(pandoc "document.md" -o "document.pdf" --from markdown --template "eisvogel" --listings --citeproc)为
会话1
朱和巴沙尔(2015)。
书目
朱,观音和塔米尔巴沙尔。2015年。博弈论--网络物理控制系统的鲁棒性、安全性和弹性的理论方法:最佳跨层弹性控制系统的博弈原理。控制系统,IEEE 35 (1):46-65.
然而,是否可以在文本中插入引用作为全文引用?
例如:
会话1
朱,观音和塔米尔巴沙尔。2015年。博弈论--网络物理控制系统的鲁棒性、安全性和弹性的理论方法:最佳跨层弹性控制系统的博弈原理。控制系统,IEEE 35 (1):46-65.
谢谢你的帮忙!
发布于 2021-03-12 18:50:08
下面是如何使用Lua滤波器实现此操作:首先,筛选器查找生成的书目条目,并将其保存到表中,并通过引用键进行索引。然后查找引文并将其替换为完整条目。
local refs = {}
local function store_refs (div)
local ref_id = div.identifier:match 'ref%-(.*)$'
if ref_id then
refs[ref_id] = div.content
end
end
local function replace_cite (cite)
local citation = cite.citations[1]
if citation and refs[citation.id] and #cite.citations == 1 then
return pandoc.utils.blocks_to_inlines(refs[citation.id])
end
end
return {
{Div = store_refs},
{Cite = replace_cite},
}将上面的内容保存到一个文件中,并使用--lua-filter命令行选项将该文件传递给pandoc。过滤器必须在citeproc处理器完成其工作之后运行,因此它应该是最后一个命令行参数。用最新的pandoc版本2.12进行测试(它不再需要pandoc-citeproc,但它应该以任何方式工作)。
https://stackoverflow.com/questions/66600105
复制相似问题