![](/img/trans.png)
[英]pandoc lua filter to apply Quotations style to a Div when converting to docx
[英]pandoc lua filter to apply Emphasis character style to Emph elements when converting to docx
我正在使用 pandoc 从 latex 转换为 docx。 在 pandoc AST 中,强调的文本用“Emph”标记,如下所示:
, Emph [ Str "Variety" ]
并在写入 docx 文件时呈现为斜体。 我想使用 lua 过滤器将参考 docx 文件中定义的强调字符样式应用于此类文本。 我已经阅读了所有文档,但仍然缺乏自己编写过滤器的必要信息和技能。 任何帮助将不胜感激。
这可以通过将Emph
更改为具有custom-style
属性的Span
来完成:
function Emph (emph)
return pandoc.Span(emph.content, {['custom-style'] = 'Emphasis'})
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.