确保 Pandoc 将脚注开头嵌套的“ibid”大写

确保 Pandoc 将脚注开头嵌套的“ibid”大写

和很多人一样,我用 Markdown 写文档,然后使用 Pandoc 转换为 LaTeX。Pandoc 以 格式呈现 Markdown 引文[@citekey]\autocite{citekey}我使用基于 verbose-inote 的脚注样式。这在大多数情况下都运行良好;Pandoc 会自动处理多个引文以及后注和前注。

然而,有时必须将这些引用嵌套在明确的脚注中,如下所示:

^[Here is some discursive text that could go in a pre-note: [@citkey1].
But here is some more text followed by another citation that should be
in the same footnote. LaTeX won't allow nested citations of course, so
we need to use a footnote: [@citekey2].]

问题是,如果你打开脚注时引用了最终被渲染为 ibid 的引文,该\autocite命令将使其不大写。所以

^[[@citekey].]

变成

\footnote{\autocite{citekey}.}

并在 PDF 中呈现为“ibid”。

假设我没有遗漏其他显而易见的东西,解决方案似乎是用 替换任何\autocite直接跟随\footnote{的内容\Autocite。我的问题是,实现这一目标的最佳方法是什么?正则表达式替换非常简单,但据我所知,Pandoc 在转换过程中将其过滤器直接应用于其本机 AST。

相关内容