【问题标题】:How can I use inline footnote in markdown in blogdown?如何在 blogdown 的 markdown 中使用内联脚注?
【发布时间】:2021-03-15 19:46:43
【问题描述】:

我发现谢一辉在他的blog(source)中使用了内嵌脚注。

they use literate programming to explain TeX code.^[Is that because TeX code is particularly difficult to understand? I don't know. I don't understand TeX well.]

我使用hugo-ivy theme 创建了一个网站,并在homepage 中使用了内联脚注。

内容是:

---
title: Home
---

Here is an inline note^[Inline footnote does not work.].

Here is a footnote reference[^1].

[^1]: Reference footnote works.

但内联脚注不起作用。

如何在亿辉等markdown文件中使用内联脚注?

您可以访问demo website并克隆source code进行测试。

环境:Hugo 0.79.0,Blogdown 0.21.47

【问题讨论】:

    标签: markdown hugo blogdown


    【解决方案1】:

    我现在是still using Hugo 0.25.1。它的 Markdown 渲染器是 Blackfriday,它支持内联脚注。 Hugo switched the default Markdown renderer to Goldmark 从 v0.60.0 开始。不幸的是,Goldmark 不支持内联脚注,其作者 doesn't seem to be interested 也支持此功能。

    You could useBlackfriday 作为 Markdown 渲染器,但最终会被弃用,所以除非你确定要坚持使用特定版本的 Hugo,否则这可能不是一个好方法。另一种方法是使用更容易编写脚注的编辑器,例如RStudio visual Markdown editor(这样您就无需考虑脚注 ID)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-19
      • 2016-03-03
      • 1970-01-01
      • 2019-09-15
      • 2018-04-15
      • 1970-01-01
      • 2012-03-10
      • 1970-01-01
      相关资源
      最近更新 更多