像文本一样转义组织模式脚注

发布于 2024-12-15 19:01:40 字数 577 浏览 2 评论 0原文

我在 org-mode 文件中有“[16]”,这是您在 ipython shell 中看到的文本。如何转义该文本,使其不会生成组织模式脚注?在示例块中可以,但在一般文本中则不行。第一个 [16] 很麻烦,当我导出文件时,到目前为止我尝试过的所有内容都没有在 html 输出中产生直接正常的“[16]”。

#+BEGIN_SRC python
def setfrequency():
    print 'Setting frequency'
    # Write code here to set the frequency

setfrequency()
#+END_SRC

# This next line is the footnote problem
Run it again and you should see this, but the command number [16]
will be different for you:

#+BEGIN_EXAMPLE 
In [16]: run sonar  # This does not export as a footnote.
Setting frequency
#+END_EXAMPLE

谢谢!

I've got "[16]" in an org-mode file that is the text you would see in an ipython shell. How do I escape that text so that it does not generate an org-mode footnote? It's fine inside of an example block, but not in the general text. The first [16] is trouble and everything I've tried so far has not produced just straight normal "[16]" in the html output when I export the file.

#+BEGIN_SRC python
def setfrequency():
    print 'Setting frequency'
    # Write code here to set the frequency

setfrequency()
#+END_SRC

# This next line is the footnote problem
Run it again and you should see this, but the command number [16]
will be different for you:

#+BEGIN_EXAMPLE 
In [16]: run sonar  # This does not export as a footnote.
Setting frequency
#+END_EXAMPLE

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一紙繁鸢 2024-12-22 19:01:40

您可以使用 =[1]=(代码)或 ~[1]~(逐字)块转义语法。请参阅组织手册中有关强调和等宽字体的部分。

* This will export the footnote style brackets verbatim
  [1] by itself will fail
  =[1]= and ~[1]~ will export as is.

HTML 导出的相关部分是

<p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a>
</sup> by itself will fail
  <code>[1]</code> and <code>[1]</code> will export as is.
</p>

<p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a>
</sup> DEFINITION NOT FOUND: 1

You can escape syntax using =[1]= (code) or ~[1]~ (verbatim) blocks. See the Org-Manual section on Emphasis and Monospace.

* This will export the footnote style brackets verbatim
  [1] by itself will fail
  =[1]= and ~[1]~ will export as is.

The relevant portion of HTML export for this is

<p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a>
</sup> by itself will fail
  <code>[1]</code> and <code>[1]</code> will export as is.
</p>

<p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a>
</sup> DEFINITION NOT FOUND: 1
静水深流 2024-12-22 19:01:40

我尝试了这个方法。

    Run it again and you should see this, but the command number 
    #+latex: [16]
    will be different for you:

I tried this way.

    Run it again and you should see this, but the command number 
    #+latex: [16]
    will be different for you:
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文