如何在Org模式中进行内嵌注释? [英] How to make inline comments in Org-mode?
问题描述
在组织模式中,有几种发表评论的方式。但我不知道有任何方式做内联的评论。根据手动
由'#+ BEGIN_COMMENT'...'#+ END_COMMENT'包围的区域不会导出
。
但是这只有在上述区域开始一行时才成立。
以下
#+ TITLE:Test
text#+ BEGIN_COMMENT comment 1# END_COMMENT text
text
#+ BEGIN_COMMENT comment 2#+ END_COMMENT text
只有评论2才会被视为评论。它将(例如 Ce A )导出为
text#+ BEGIN_COMMENT comment 1#+ END_COMMENT text
text
此外, / code>不适用于通过在区域上使用它来创建内嵌注释,
注释区域
甚至不创建注释。
那么,如何在Org模式下进行内嵌注释?
Jonathan Leech-Pepin的意见您在 \printbibliography上的问题
给了我一个想法。您可以对内嵌注释使用宏。注意,在注释定义之后需要尾随空格。
#+ macro:comment
...
{{{comment(这里是注释)}}}
编辑:因为这应该是一个宏奇数输入可能螺丝起来。我有点惊讶,
{{{comment(here is a)}} comment)}}} $ b $ code> {{{comment(here is a comment)more}}}
。我假设除了相当简单的文本之外的任何东西,如果他们决定改变他们解析宏的方式,将来相当脆弱。
In Org-mode there are several ways to make comments. But I do not know of any way to make inline comments. According to the manual
regions surrounded by ‘#+BEGIN_COMMENT’ ... ‘#+END_COMMENT’ will not be exported.
But this is only true if the said region starts a line.
In the following
#+TITLE: Test
text #+BEGIN_COMMENT comment 1 #+END_COMMENT text
text
#+BEGIN_COMMENT comment 2 #+END_COMMENT text
only comment 2 is treated as a comment. It exports (e.g. C-e A) as
text #+BEGIN_COMMENT comment 1 #+END_COMMENT text
text
Also, org-toggle-comment
does not work for making inline comments by using it on regions and comment-region
does not even create a comment.
So, how can I make inline comments in Org-mode?
Jonathan Leech-Pepin's comment on your question on \printbibliography
gave me an idea. You can use a macro for inline comments. Note that you need trailing space after the comment definition.
#+macro: comment
...
{{{comment(here is a comment)}}}
EDIT: Since this is supposed to be a macro odd input may screw things up. I'm a little surprised that
{{{comment(here is a)}} comment)}}}
works for me, although
{{{comment(here is a comment) more}}}
does not. I would assume that anything other than fairly simple text would be fairly fragile if they decide to change the way they parse macros in the future.
这篇关于如何在Org模式中进行内嵌注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!