组织模式包括标题(Org Mode include heading)

编程入门 行业动态 更新时间:2024-10-27 04:23:58
组织模式包括标题(Org Mode include heading)

我用org-mode写论文和幻灯片。 生成表格和图形的代码放在源块中。 大多数时候我在幻灯片中使用与我的论文中相同的表格,但是生成表格需要大量的预处理代码。 我想将这些表的生成放在自己的组织模式文件中,并且只能在纸张或幻灯片文档中包含某些标题。 例如,我将有一个名为mytables.org的组织模式文档:

* Heading 1 ** Regressions #+BEGIN_SRC R cat("hello world") #+END_SRC R * Heading 2

另一份文件mypaper.org:

* Section 1 #+INCLUDE: "mytables.org" :heading "Heading 1/Regressions" * Section 2

mytables.org中**回归标题下方的内容将包含在mypaper.org的导出中。 能够使用Cc'跟随INCLUDE到文件也很棒。 Org为这些包括提供了一些设施,但不允许标题( http://orgmode.org/manual/Include-files.html )。 显然org没有:heading参数,但是非常感谢任何有关解决方案的建议。

谢谢。

I use org-mode to write both papers and slides. The code to generate tables and figures is placed in source blocks. Most of the time I use the same tables in my slides as in my papers, but a lot of preprocessing code is needed to generate the tables. I'd like to put the generation of these tables in its own org-mode file and just be able to include certain headings in the paper or slide document. For example, I would have an org-mode document called mytables.org:

* Heading 1 ** Regressions #+BEGIN_SRC R cat("hello world") #+END_SRC R * Heading 2

And another document mypaper.org:

* Section 1 #+INCLUDE: "mytables.org" :heading "Heading 1/Regressions" * Section 2

The content from below the ** Regression headline in mytables.org would be included on export in mypaper.org. It would also be great to be able to follow the INCLUDE to the file with C-c '. Org provides some facilities for these includes, but does not allow for headings ( http://orgmode.org/manual/Include-files.html ). Obviously org does not have the :heading parameter, but any suggestions for a solution to make this work are greatly appreciated.

Thanks.

最满意答案

Org模式8.3 支持这个(我使用的是8.3beta )。

例如:

#+INCLUDE: "./paper.org::*conclusion" :lines 1-20

将包括标题结尾的前20行。

此外,要通过其CUSTOM_ID属性包含标题(假设它是Sec: Introduction ):

#+INCLUDE: "./paper.org::#Sec: Introduction"

我发现:only-contents t适用于我的应用程序(我在另一个org文件中包含了一个用于beamer演示的子树):

#+INCLUDE: "./paper.org::*conclusion" :only-contents t

Org mode 8.3 supports this (I'm using 8.3beta).

For example:

#+INCLUDE: "./paper.org::*conclusion" :lines 1-20

will include the first 20 lines of the headline named conclusion.

Also, to include a heading by its CUSTOM_ID property (suppose it is Sec: Introduction):

#+INCLUDE: "./paper.org::#Sec: Introduction"

I found :only-contents t works well for my application (I'm including a subtree from another org file for a beamer presentation):

#+INCLUDE: "./paper.org::*conclusion" :only-contents t

更多推荐

本文发布于:2023-08-02 19:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1380029.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模式   组织   标题   Org   include

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!