1

为了创建教学大纲,我想知道是否可以插入引文作为完整引文。现在,我有以下降价代码:

# Session 1

@zhu2015.

这会将pandoc "document.md" -o "document.pdf" --from markdown --template "eisvogel" --listings --citeprocpdf 中的 ( ) 转换为


第一节

朱和巴萨(2015)。

参考书目

朱、全彦和 Tamer Basar。2015.“网络物理控制系统的鲁棒性、安全性和弹性的博弈论方法:最佳跨层弹性控制系统的游戏原则。” 控制系统,IEEE 35 (1): 46–65。


但是,是否可以将参考文献作为全文引用插入?

如:


第一节

朱、全彦和 Tamer Basar。2015.“网络物理控制系统的鲁棒性、安全性和弹性的博弈论方法:最佳跨层弹性控制系统的游戏原则。” 控制系统,IEEE 35 (1): 46–65。


谢谢你的帮助!

4

1 回答 1

0

以下是使用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,但它应该可以工作)。

于 2021-03-12T18:50:08.410 回答