Questions tagged [org-babel]

feature of Org mode that handles source code for multiple languages. It can execute source code from within Org mode documents, making it convenient for producing literate programming documents and managing reproducible research. Note that [tag:org-babel] is now incorporated into [tag:orgmode] as `working with source code` and no longer a separate extension.

Filter by
Sorted by
Tagged with
12
votes
2answers
2k views

Is there a way to make Org mode ignore src blocks when exporting to html?

I have an org document with scattered with source blocks that I'd like excluded when I export the file to html. Is there a variable or option I can set which will ignore the src blocks? I have tried ...
14
votes
1answer
11k views

“no org-babel-execute function for c” and “no-org-babel-execute function for c++”

my emacs version is 24.3.1. i understand i have to put the ob-C.el (available from here) in a path where Emacs can read it. i first copy-pasted the code from that .el file to my .emacs file and ...
7
votes
1answer
774 views

Using org-src-preserve-indentation only on specific code blocks (or buffers, or anything beyond the global context, really)

I've been Googling and digging through the org-babel docs, but it's coming out with not a lot. The thing is, one of things I'm working on is using org-babel to tangle Makefile source. In it, the ...
1
vote
1answer
182 views

Is it possible to include Babel header line when publishing Org-mode files to HTML?

Is it possible to include Babel header lines when publishing Org-mode files to HTML with org-html-publish-to-html? I would like to have the org-mode keywords exported in addition to the code. Ideally ...
2
votes
0answers
235 views

org-babel evaluation of code block always creates new window

Running org-ctrl-c-ctrl-c to evaluate a src block in an org file behaves strangely with windows. With a single window in the frame, it spawns a new window looking at the same buffer in a split and ...
5
votes
1answer
194 views

How do I import __future__ in org-mode babel

Attempting to eval a babel source block that contains a __future__ import and also uses a :var causes Python to spit out File "<stdin>", line 2 SyntaxError: from __future__ imports must occur ...
0
votes
1answer
250 views

How to make org-babel-load-file use umlauts (åäö) correctly?

I have this in my init.el (defvar dropbox-d "C:/Dropbox") (defvar dropbox-emacs-d (expand-file-name "emacs" dropbox-d)) (org-babel-load-file (expand-file-name "config.org" dropbox-emacs-d)) In ...
1
vote
1answer
303 views

org-babel, org-table and package-install: “Package `dired+-' is unavailable

I'm currently using org-mode to organize my init files — specifically, working off a fork of emacs24-starter-kit. Recently, I had come across the idea of using org-tables to organize some of my things ...
2
votes
0answers
258 views

Stopping a runaway process using C-c C-c

When i evaluate some source code blocks using C-c C-c sometimes i might have an error and the system hangs on me . The only way to exit at this point is by quitting emacs. Are there any solutions to ...
3
votes
1answer
181 views

Timestamp on babel-execute results block?

When I execute a source block, I'd like to get a timestamp on the +RESULTS block so that I can remember when it was last executed. Is there a built-in option for this or do I need to go in and add a ...
1
vote
1answer
338 views

Python blocks evaled; elisp blocks not: org-babel export to latex

I need to have automatic evaluation turned on for elisp (or emacs-lisp) because I have huge documents that I export to PDF with batch scripts, and it's intolerable to have to go in and manually ...
6
votes
1answer
812 views

How to turn off `emacs-lisp-checkdoc` of flycheck when edit source block in org-mode file?

I have a emacs-lisp block in org-mode and when I try to edit it by press C-c ', flycheck always report errors as below: 0 warning The first line should be of the form: ";;; package --- ...
1
vote
1answer
227 views

Getting maxima source block to return and display latex equations

I'd like my maxima source blocks to return either valid latex that I can display in the org-buffer, or an image of the results (a la imaxima). Ideally, the pure latex solution would be best. Here is ...
1
vote
1answer
142 views

Why is my output of this org doc with lilypond code different than shown?

This page about ob-lilypond has an example of PDF output of this org file. The PDF looks great--small sheet music snippets under explanatory text. The whole thing fits on 2 pages. However, when I grab ...
5
votes
1answer
761 views

Autocompletion using company in org src buffer?

I can't seem to get completion when editing an org-babel source code block. Elpy and company-mode both appear to be enabled minor modes for the buffer, but no completion candidates appear as they do ...
12
votes
3answers
1k views

Org Mode Babel - Interactive code block evaluation

I would like to evaluate in org mode source code blocks in C++ containing "cin" instructions but I can't find a way to have an interactive evaluation (with user input) during evaluation. Example of ...
1
vote
0answers
136 views

Org-mode - What internals make python session mode so picky with blank lines?

I understand and work around the limitation of session mode python code blocks. But why is it like this? Is it possible that this could be fixed so that people don't have to adjust their usage ...
1
vote
0answers
743 views

Indentation of source block result

How should one indent text in org-mode with org-indent-mode disabled? I expect something like this: * A Some text. - item 1 - item 2 ** B More text. EDIT: This seems to depend on the ...
1
vote
0answers
122 views

org src fontify won't highlight some multiline comments

The option org-src-fontify-natively doesn't care about some multi-line comments. See: As shown in the picture above, the html comment isn't highlighted correctly. I tried hacking through the code and ...
1
vote
1answer
141 views

Why is there a case sensitivity problem with org mode source block tags?

So I am entering source code into org documents by using source code blocks such as: #+BEGIN_SRC C++ #include <iostream> using namespace std; int main() { cout << "Hello ...
6
votes
1answer
5k views

How to embed latex in org-mode

I want to be able to output nicely formated math code. So I decided to learn latex and maxima (and use all that in org-mode). That's when I came across this tutorial http://maxima.sourceforge.net/...
4
votes
3answers
403 views

Display org-mode src R results horizontally

Is there a way to show the results of a Source Block horizontally, or equivalently to transpose an org-table? For example, I have the following: #+begin_src R :results table c('a','b','c') #+end_src ...
9
votes
1answer
1k views

Code blocks that produce org tables to be later consumed by other code blocks

I am having a bit of trouble with code blocks that produce org tables to be later consumed by other code blocks. For example: #+NAME: upper_air #+BEGIN_SRC clojure :results output raw (clojure....
7
votes
2answers
1k views

org-babel and remote sql commands

I'm using org-babel to do litterate programming and I find it very convenient. I am able to execute shell commands on remote hosts, and local database commands with the postgres client. To open a file ...
3
votes
1answer
1k views

executing scheme in org-mode babel

I want to write a scheme program in an org file. I want to be able to execute the #+SRC blcoks and see the result in #+RESULT: block. However, when I execute the #+SRC_BEGIN/END I get no output. ...
1
vote
0answers
150 views

Debugging org-babel snippets

I'm using org-babel blocks to generate a Graphiz diagram for a presentation. Normally the output goes to a file which is what I want. However if the file is empty something went wrong. Is there an ...
9
votes
2answers
703 views

How to automatically tangle another source block to file when evaluate a source block in org-mode?

The source block what I want to evaluate (src2) need to source a file which should be the tangle result of another source block (src1). How could it make the tangle to file automatically everything ...
5
votes
1answer
1k views

How do I set org-mode to use racket instead of Guile?

How do I set org-mode to use racket instead of Guile? I want to use emacs,org-mode and racket to go through the SICP. I can start Geiser, choosing Racket in the Start Geiser for scheme ...
9
votes
1answer
613 views

Can Org Babel conditionally tangle code blocks based on system-type?

Edit: While I'm still learning the ropes of Babel, I've read about the system-type, emacs-version, and window-system variables, which sound like they contain all the information I need to get the ...
4
votes
1answer
257 views

Can I use org-mode to structure other dotfiles?

I really like the idea of structuring my init.el file with orgmode. Now I wonder if this would also work with other configuration files like vimrc.
4
votes
1answer
130 views

Org Babel failing with Recursive Functions

I’ve done quite a lot of source level blocks in org-mode, but I think I have a failure scenario if called functions inside the source code blocks are recursive. The ifconfig program displays all the ...
7
votes
1answer
1k views

How to pass environment variables to org source BASH script block?

I have a BASH script in org-mode file as org-babel source block. I hope to pass value contains environment variable to it through :var. something like these: #+begin_src sh :var VAR1="~/foo" mkdir ...
4
votes
2answers
496 views

Is it possible to tangle Results block?

Is it possible to tangle #+RESULTS: block? For example, #+BEGIN_SRC rst :tangle ./test.txt :noweb yes <<Tangle_Test>> #+END_SRC #+BEGIN_SRC python :exports results :results output raw ...
10
votes
0answers
485 views

Edebug orgmode source code blocks with input variables

What is the standard method to debug emacs-lisp orgmode source code blocks with input variables as header arguments? I found the hacky solution to insert the following snipped in front of a source ...
6
votes
1answer
2k views

Specify global tangle file for source code export in Org mode 8.x

I want to specify a default output file for all my tangle exports. I'm using Org mode 8.x. (For Org mode ≥9.0, see How to tangle all code blocks to a common file) This works: #+BEGIN_SRC js :tangle "...
0
votes
0answers
167 views

how to quote parameters in source blocks

I have two (org-mode) source blocks, both with parameters: select-union(tbl=a_table) and column-names(tbl=a_table) Both produce SQL artifacts from the table data. Now I want to write a new source ...
12
votes
2answers
901 views

Syncing changes on a tangled file back to the original org file

I am using org-mode with fountain mode to write a screenplay. Org for organization and fountain for screenplay formatting. This is the code I use for this purpose : Settings for working with (...
68
votes
5answers
19k views

Quickly insert source blocks in org mode

org-mode has the ability to render source code, with blocks of the following syntax: #+NAME: <name> #+BEGIN_SRC <language> <switches> <header arguments> <body> #+...
1
vote
1answer
103 views

org-babel not concatenating strings before sending to code block variable

I have just started using org-mode and org-babel as a lab notebook. I am trying to use a code block to fill in two columns of a table. The code block seems to work for the first column because those ...
2
votes
1answer
186 views

Does org-babel for groovy take arguments?

I am trying to pass an argument to a groovy babel block but I'm not sure it accepts arguments? The documentation says that it is language-specific but I didn't find any documentation for ob-groovy. ...
3
votes
1answer
114 views

org-babel for Jython?

Is there an org-babel for the Jython (not Python, it must be Jython) programming language? I am especially interested in session based evaluation for Jython. I am considering writing my own ob-jython....
1
vote
0answers
151 views

How to get org-mode to stop prompting me to save org-mode files that contain Babel blocks?

When I open an org-mode file that has a babel block in emacs-lisp format, afterwards, whenever I run save-some-buffers, I get the File to save in: prompt for the current org-mode file. I get this ...
9
votes
3answers
3k views

With org-babel, how to name the results of a function call and reuse them

In org-mode, I am trying to define a function, a variable, and then assigning to another variable the result of the function call on the first variable. However, then it seems that I cannot use this ...
3
votes
2answers
884 views

Wrap org src block results

I'd like to include a custom latex wrapper around src blocks result. For example, given: #+BEGIN_SRC sh :results latex which awk #+END_SRC I'd like to generate #+RESULTS: #+BEGIN_LaTeX \begin{...
0
votes
1answer
454 views

Why is Org adding a label in custom Babel environment?

I can't tell in what update exactly did this happen but since not so long ago Org adds a label{orgsrcblock#} to custom listings environments. Unfortunately, I can't find a way to tell listings to ...
3
votes
0answers
147 views

Jump sequence for placeholders in yasnippet not working in org-property blocks

I use the yasnippet bundle and it works like charm. When I want to include placeholders in a PROPERTIES section of an org-document it is not working. Here's the snipper: #type: snippet # -- :...
2
votes
0answers
222 views

Format <<<target links>>> in org-mode for printing

Is there a way to format target links created by org-mode when using radio targets such as the following: <<<some text>>> where that some text is linked back When outputting to ...
10
votes
3answers
415 views

Editing multiple source blocks in one buffer

I've got multiple source blocks which are all tangled to the same file. When I invoke C-c ' inside one block, only this specific block is shown in a new buffer. Is there a possibility to show all ...
23
votes
3answers
1k views

Smooth (mouse) scroll for inline images?

I display images in-line with begin_src & result blocks. However, for large-images, when I scroll past the bottom of the image, I get a 'jerk' and the whole image is scrolled away. Similarly if I ...
2
votes
1answer
139 views

Problem with add-to-list in babel src block

When I execute a babel src block with add-to-list function like this: #+begin_src emacs-lisp (add-to-list 'org-src-lang-modes (quote ("plantuml" . fundamental))) #+end_src I will get this error ...

1 6 7 8 9 10