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 Org-babel is now incorporated into Org-mode as 'working with source code' and no longer a separate extension.
852
questions
1
vote
2
answers
38
views
Org babel add extra "," after indent for no reason
Insert the following text in an org buffer with electric-indent-mode on.
#+begin_src python
s='''
#+1
#+1'''
#+end_src
add a newline to s, and the buffer will become:
#+begin_src python
s='''
,#+...
1
vote
1
answer
41
views
Python Org Babel producing garbled result
I have the following settings on for org-babel
#+PROPERTY: header-args:python :python ~/env/pt/bin/python :session a :results drawer output replace
When I evaluate a code block, the results are some ...
0
votes
1
answer
22
views
How can I make this section-level Org-Mode header work at the top-level?
I find that the following org-mode header works just fine if I put it in a section
* SQL world
:PROPERTIES:
:header-args:sql: :exports both
:header-args:sql+: :cmdline -S 123.45.0.6,1999 -U sa -P &...
2
votes
1
answer
81
views
How can I make SQL output readable?
I'm trying to find an Emacs replacement for SQL Server Management Studio (SSMS). I have managed to query my Microsoft SQL Server from Emacs – and what a task that was! – through SQL Mode. However, the ...
0
votes
0
answers
20
views
Display custom message after completing org-babel-tangle
I'm using org-babel-tangle to tangle one of my org file into an the emacs config file. After completion, I get a message showing how many blocks have been tangled like Tangled 48 code blocks from My-...
2
votes
2
answers
82
views
replace expressions with output in code-blocks before org-babel-tangle
How to evaluate the expressions or functions in a code-block before tangling a source code block?
I generate my init.el file using org-babel-tangle
AND
I'm using chemacs2 - which allows using ...
0
votes
0
answers
19
views
org-babel: Pass flags when filtering source code blocks?
I'm currently using org-mode to make some beamer slides, where I'm generating some code blocks and results using org-bable. I'm currently using org-export-filter-src-block-functions to modify the ...
0
votes
1
answer
30
views
lexical binding in a tangled init.el file
How can I enable lexical binding in an init.el file that is tangled from an org mode file? I have an org mode file called Emacs.org which is used to tangle the init.el file using the command M-x org-...
0
votes
1
answer
39
views
Org-mode code blocks and results side-by-side in beamer export?
I'm using org-mode to generate slides for a class I'm teaching, and one of the things I do is use org-babel to show code snippets, run them and display the results.
However, in the generated Beamer ...
0
votes
1
answer
28
views
Org-babel ignores RESULTS when generating beamer?
I'm using Org-babel to generate a bunch of pdfs from a single Org-mode file, compiling using Beamer.
Each subtree starts something like this:
* Introduction
:PROPERTIES:
:EXPORT_FILE_NAME: pdf/...
0
votes
1
answer
33
views
Conditionally evaluate scattered source code blocks in org mode
I have an org document with various source code blocks. Some of blocks should be evaluated conditionally on org-babel-execute-buffer; however, these blocks are scattered throughout the document, which ...
0
votes
0
answers
17
views
Prevent empty line in first output of org-babel bash session
In Emacs 28.2 with org-mode 9.5.5 and --no-init-file on Debian 12 the output of the first evaluation of a bash session is polluted by an empty newline.
#+begin_src bash :session c ...
0
votes
1
answer
28
views
Is there an org-mode code block that echoes its content back?
Is there a code block type in org-mode that can echo its context (text) back when executed?
So, in pseudo-code, the code block:
#+begin_src echo
{ "id": 1, "name": "James ...
0
votes
0
answers
30
views
Can identical example and source blocks be made to look different in a PDF export?
I use both #+begin_src and #+begin_example blocks in my org-mode markup that gets exported to PDF. If I put identical text in to these blocks, then they look identical in the PDF export. Is there any ...
0
votes
1
answer
25
views
Using File Input in Org Source Block?
I'm trying to run this C source block using input from a text file.
#+BEGIN_SRC C :includes <stdio.h>
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
#+...