问题标签 [org-babel]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
emacs - 如何使用 org-mode 隐式组织识字代码?
我正在为 Emacs 开发 Stack Exchange 模式,并且正在尝试使用识字编程(with org-mode
)来组织项目。
我发现自己重复了很多信息。我正在对文档采取(可能过度)结构化的方法。说我有一个标题Questions
;在该标题下存在子标题Read
和Write
,我有一个顶级
如何更改Read
和Write
标题的属性,以便内部的所有源代码块(除非另有说明)都将放入各自的 noweb 缠结中?
这是我目前所做的:
这是我想做的:
(Ctrl+F**
查看属性抽屉。)
python - 使用 Org–Babel 控制缩进
使用Org–Babel编写有文化的 Python 时,我需要能够控制缩进级别(显式地:indentation-level 3
或隐式地使用一些巧妙的指示)。
这是一个演示问题的示例文件。
emacs - Export org-mode code block and result with different styles
I am preparing a presentation using org-mode and babel, and want to export to beamer pdf.
In the output, the source code and the results are with the same style (verbatim in latex). Thus it is difficult to distinguish them.
Would it be possible to export source code and results with different styles (preferably different color)?
Thanks a lot!
emacs - 如何在源代码和结果导出到 PDF 之间添加一些文本?
当我想导出带有结果的源代码块时,我想在中间添加一些文本,例如“输出:”,因为否则读者很难理解程序在哪里结束和输出从哪里开始 - 怎么做我实现了在两者之间添加“输出:”?
例子:
emacs - 在 org 模式下将变量传递给 awk 代码块
我在 Org-Babel 中有一个小代码块,它应该取决于一些参数。我已经在 awk 中编写了代码,但我没有成功使用代码中的参数。
一个小(不工作)的例子:
我的参数叫做 test,它的值是……值。结果如下:
变量 test 似乎没有被定义,尽管:var test="value"
但是,当尝试 awk 以外的其他语言(例如 sh 的 python)时,似乎没问题:
我正在使用 org 7.8.02。任何想法?谢谢!
emacs - 为什么不应用这个 org-mode header-arg?
当我尝试运行它时:
我得到错误sh: 2: Syntax error: end of file unexpected
。
如果我添加:noweb yes
到代码头,它会按预期执行。我认为该:header-args:
属性应该自动执行此操作,但显然不是。我已经尝试删除分隔片段的空格,并且(不出所料)它没有任何区别。我已经尝试指定该属性是用于 sh ( :header-args:sh:
) 的,但也没有这样做。为什么不应用 header-arg ?
emacs - org-mode 文件特定函数
我正在 org 模式下开发一个识字程序。我的 .emacs 中有几个函数用于为程序设置 repl,是否可以将这些函数移动到 org-mode 文件并在每次打开文件时对其进行评估(如缓冲区本地变量,但使用功能。)
emacs - 在 Emacs org-mode 中评估代码块时如何输入密码?
我在 Org 文件中有一个 shell 代码块。里面有“sudo”命令。所以我应该被要求输入密码。但是当我评估它时,它只会返回“sudo”命令的错误。有什么方法可以使评估具有互动性吗?
emacs - Orgmode:如何过滤要缠结的块?
在 Orgmode 中,有没有办法将子树匹配(或不匹配)特定标签中的块缠在一起?
例如下面的代码
沿标签D导出,缠结 C 文件将仅包含printf("Exported");
我org-mode
用来组织我的 emacs 配置,我的目标是从 master派生不同emacs-config.org
的配置。(例如,通过仅标记特定的 lightconfig)
emacs - 如何在 emacs org 文件中引用调用块的结果?
我正在使用 emacs org 模式进行可重复的研究。我无法将调用结果链接到代码块。作为我正在尝试做的一个最小示例:
当我打电话时f2
,它失败了,因为x
is nil
。如果我从 on 调用中删除名称f1
,则 f2 可以工作,但如果我更改f1
.
如何告诉 org 模式我想查看函数调用的结果,而无需在每次计算结果时手动重命名?