Closed annProg closed 5 years ago
可能的解决方案:
参考 https://pandoc.org/lua-filters.html , Default metadata file,将 -H
参数用lua-filter
加入metadata
变量header-includes
中
-- read metadata file into string
local metafile = io.open('metadata-file.yaml', 'r')
local content = metafile:read("*a")
metafile:close()
-- get metadata
local default_meta = pandoc.read(content, "markdown").meta
return {
{
Meta = function(meta)
-- use default metadata field if it hasn't been defined yet.
for k, v in pairs(default_meta) do
if meta[k] == nil then
meta[k] = v
end
end
return meta
end,
}
考虑使用 pandoc-crossref,但是
pandoc-crossref
依赖metadata
变量header-includes
,pandoc
命令行指定-H/--include-in-header
时会覆盖metadata
变量。