gpt4 book ai didi

regex - 在 Pandoc Markdown 输出中生成内联而不是列表样式的脚注?

转载 作者:行者123 更新时间:2023-12-01 07:45:28 25 4
gpt4 key购买 nike

在 Pandoc 中从某种格式(比如 HTML 或 Docx)转换为 Markdown 时,是否可以以内联样式(“这是主要文本^[这是脚注]”)呈现所有脚注,而不是作为在文档末尾带有相应列表的编号引用文献?我想将我的 Markdown 文档(从我论文的 Docx 转换而来)作为主文本,但现在如果我添加一个新的脚注,它会弄乱编号。

或者,是否有另一种方便的方式(即不是 Pandoc)可以做到这一点?在文件的一部分中剪切文本并在另一部分中添加相应的文本似乎有点超出了简单的正则表达式。

在此先感谢您的帮助。

编辑:我刚刚破解了an extremely simple Python script这样做,以防其他人遇到同样的问题。

最佳答案

Pandoc 的 Markdown 语法对于 footnotes 相当灵活:

The footnotes themselves need not be placed at the end of the document. They may appear anywhere except inside other block elements (lists, block quotes, tables, etc.).

喜欢:

Here is a footnote reference[^1] and some more text.

[^1]: Here is the footnote.

Here's the next paragraph.

但是,Markdown Writer(生成 markdown 文件的模块,而不是读取它们)目前只是 places all of them at the end的文件。但这可以在标志后面实现,类似于 --reference-links 标志。欢迎提交问题或拉取请求!

关于regex - 在 Pandoc Markdown 输出中生成内联而不是列表样式的脚注?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33984689/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com