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.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

org-babel-insert-result: Wrong type argument: markerp, nil

I use org-mode to structure my emacs configuration files. Recently, I have the following problem: some of my emacs-lisp blocks generate the following error at runtime: org-babel-insert-result: Wrong ...
0
votes
0answers
24 views

Emacs hangs on org-babel-execute-src-block for Haskell blocks

I have a minimal org file with a Haskell code block: #+begin_src haskell putStrLn "Hello World" #+end_src When I do M-x org-babel-execute-src-block, Emacs hangs with minibuffer saying: ...
0
votes
0answers
11 views

Empty ipython shell buffer when executing org-babel source code block

For some reason, when I try to execute a Python code block, example below, Emacs creates an empty Python buffer and hangs indefinitely. #+begin_src python :results output :session print "Hello ...
1
vote
1answer
34 views

Specify arbitrary attributes for code blocks and keep them when converting with pandoc

Markdown and its different flavours have a number of interesting extensions, notably the [hl_lines attribute][0], which allows to highlight specific lines in a fenced code block, as illustrated here ...
4
votes
1answer
32 views

Variable for line-wide colouring in emacs org-mode source blocks

What org-mode variable determines whether or not the org-mode block-background applies line wide like so: instead of like so: I am using the gruvbox-dark theme. I will attach the defface as soon as ...
0
votes
0answers
29 views

How to indent Org Babel list output with multiline text correctly?

I'm using Babel to generate some text in an Org file. I'm using :results value list header switch described here to format the output in Org's list structure. It doesn't quite format multiline text ...
0
votes
1answer
35 views

Use org-babel table results as input to another org-babel snippet

I have a snippet of Python code that outputs an Org mode formatted table. After I'm satisfied with the table, I would like to generate the LaTeX markup via orgtbl-to-latex function. For example, I ...
0
votes
0answers
16 views

Disable indentation in sh babel src block on hitting `RET`

I've implemented many snippets to my init.el (bottom of this post) to no avail. Any other ideas to have RET in an sh block returning the cursor to a new line's beginning instead of giving: Setting up ...
0
votes
0answers
24 views

org-babel code block wrong type argument

I'm stumped as to why I can no longer export an org-babel file with R code chunks and can not work out where the error is cropping up. A simple example that doesn't include the graph... #+STARTUP: ...
0
votes
0answers
30 views

Org src code block exporting even with :exports none

As in the title, If I have an org file with a python source block of the form #+BEGIN_SRC python :results none :session py-sess :exports none import numpy as np import matplotlib.pyplot as plt print(&...
0
votes
1answer
23 views

Separate November 29 org-9.5.1 directory under elpa directory

I just noticed that I have under my ~/.emacs.d/elpa directory a ~/.emacs.d/elpa/org-9.5.1/ directory wherein all the entries have the date 29 Nov. So when I look for ob-haskell.el it's not in ~/.emacs....
1
vote
1answer
35 views

Tangle babel code to specific location in source file?

Let's say I'm creating many babel code blocks in a growing org-mode buffer and I'm tangling them all to a single file. However, I want certain blocks to appear above others. For example, #+begin_src ...
1
vote
1answer
36 views

Difference in emacs org-mode for bash/shell

Among other parameters, the Emacs setup I'm using contains the instruction (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (python . t) (shell . t) (ditaa . t))) ...
0
votes
0answers
7 views

How to disable prefix addition on tangle?

How can I disable the addition of a newline prefix on tangling noweb source blocks? #+NAME: my_src #+begin_src sh :async t :results output /usr/bin/rsync -a src dst ;\ sudo /usr/bin/rsync -a \ ...
1
vote
0answers
43 views

Lsp-mode on org-mode babel

In my quest to find ways of making emacs more snappy, I installed lsp-mode. The main language I work with is R, and indeed using lsp-mode in .R files is much quicker than the ess built-in completion. ...
1
vote
1answer
34 views

Hanging interface in heavy processing scripts

Emacs org-babel is an excellent notebook tool for exploratory and interactive statistics in ESS. Now, I need to run very heavy scripts in R and the entire interface of emacs hungs for the duration of ...
0
votes
0answers
19 views

Syntax highlighting and formatting in org-src-mode editing mode

If I installed the correct mode and create a block like this. #+BEGIN_EXAMPLE k8s ... #+END_EXAMPLE I got correct syntax highlighting in the example block, but no syntax formatting. If I enter edit ...
0
votes
1answer
50 views

What to put into 'init.el' vs 'config.el' in Org-mode?

I'm using Org-mode to configure Emacs in a file 'config.el', which is really unstructured meanwhile. On the other hand, lots of configurations (for exemple the configs made with the menu) are in Emacs'...
0
votes
1answer
36 views

Trouble rendering lilypond source block in org-babel

I am relatively new to org mode and, as someone who enjoys writing about music, i decided to try org-babel-lilypond. I use MacOSx Monterey. I have lilypond installed via Macports, as was recommended ...
0
votes
1answer
38 views

org-babel shell session not starting

I'm trying to write some shell code blocks in a session, but it seems no session has been started, and all the code blocks are run independently. Here is a simple example: * org-babel :PROPERTIES: :...
0
votes
1answer
37 views

Org Babel ignores `org-plantuml-executable-args`

I cannot make plantuml set the UTF-8 charset, I've set '(org-plantuml-executable-args '("-headless -charset UTF-8")) in the init.el, but when I check in the message buffer the command ...
4
votes
1answer
222 views

Is there indentation in org src blocks?

I'm going kinda crazy trying to understand what's going on here... Asked this question on the r/emacs subreddit so apologies if any of you are seeing this again. Do org blocks allow TAB indentation ...
0
votes
1answer
38 views

How to evaluate Python code blocks with pipenv instead of system environment?

I'm trying to use org-mode as an alternative to Jupyter. I'm able to evaluate code blocks with system environment by doing C-c C-c on blocks, but I don't know how to evaluate it through pipenv ...
0
votes
1answer
23 views

Skeleton for org source blocks causing issues

I've tried to setup a skeleton to speed up entering org source blocks (define-skeleton skel-org-block "Insert an org block, querying for type." "Type: " "#+begin_" ...
0
votes
1answer
18 views

conf "language" in org-babel

#+NAME: certfile #+begin_src emacs-lisp (cond ((eq system-type 'gnu/linux) "/etc/ssl/cert.pem") ((eq system-type 'darwin) "~/Mail/certificates/root-certificates.pem")) #+end_src ...
0
votes
0answers
31 views

org-babel how to run d3.js code in code block

Anyone can help direct me about how to run d3.js code to draw graph in org-babel code block? d3.js is a javascript library but it need to output svg to html body. I saw markdown language support it ...
0
votes
0answers
14 views

org-babel named block for static string(constant)

I'm trying to extract a constant that is used by several blocks in my org-babel file. #+name: myconst 6522332123432 Unfortunately it somehow adds a new line symbol to that string which breaks my ...
1
vote
0answers
56 views

How can I generate images from LaTeX without using ghostscript/ImageMagick?

My question here is about generating images from LaTeX source blocks in .org files The following source block (edited down to a simple use case) works fine and produces a .pdf, but this does not ...
0
votes
0answers
15 views

Using sage-shell-mode, ob-sagemath with conda-env

A while back I installed the SageMath package via Anaconda, meaning I have a separate environment that I have to activate before using sage. After getting used to org-mode and org-babel source blocks, ...
1
vote
1answer
24 views

clean weird characters from org source shell

When I run a shell command in Org I sometimes get back weird control characters: #+begin_src sh :results output :session test guix pull #+end_src #+RESULTS: : : Updating channel 'guix' from Git ...
1
vote
0answers
33 views

How to setup the structure of org mode with a known html file?

I want to create an Org file, then export to HTML such that the final site looks something like this: https://html5up.net/dimension. If you go to their index.html file, their structure in HTML looks ...
1
vote
1answer
27 views

org-babel source block language specifier issue

I've installed j-mode and it works. But in an org-babel code block I have a strange issue. Spelling like begin_src J (capital J) allows me to evaluate the block, but has no syntax highlighting: #+...
1
vote
1answer
39 views

Open org-src code edit buffer automatically upon starting edit

Editing src blocks directly in org file is nice but you cannot benefit from all minor modes that would be enabled in dedicated code edit buffer, more then that for a big babel file the performance ...
0
votes
2answers
59 views

Org Tangle if file does not exist

I've been trying to work out if it's possible to tangle a file if it's not existent on the system. I came across Can Org Babel conditionally tangle code blocks based on system-type? which gave me a ...
0
votes
0answers
34 views

Why is the org-babel cache not populated on export

This whole question is an org-mode document that can be pasted into your local Emacs for a type-along question. First evaluate the below code block to enable caching of org-babel results, include ...
0
votes
1answer
64 views

(Org) TikZ for exporting both LaTeX and HTML/MathJax

I'm exporting an Org Mode project both to LaTeX and to HTML (with MatJax). Now I need to add a TikZ picture which can be exported nativelly on LaTeX and must be rendered in svg for HTML. Writing the ...
1
vote
0answers
74 views

Direct inclusion of resulting link file during export in Org mode

I'm preparing static html site with interactive Javascript components visualizing my research data in Org mode. Javascript components are returned by the Org Babel Python script in form of HTML string ...
0
votes
0answers
11 views

org-babel: How do I make tex source blocks show images of the pages produced as their output?

I am thinking of sth like https://xenodium.com/previewing-swiftui-layouts-in-emacs-revisited/ , but for tex source blocks:
0
votes
0answers
29 views

Inline image not showing

I am trying to display images inline in emacs, but for however reason the behaviour is not stable within the same document. Here is the problem: The below chunk works as expected: However, in the ...
1
vote
0answers
35 views

How to output orgmode julia DataFrame as orgtbl?

In the following link, we see that we can use a table package in Python to return in orgtbl format. #+begin_src python :results value raw :output :return tabulate(df, headers=df.columns, tablefmt='...
1
vote
0answers
24 views

org-babel not sourcing remote .bashrc when using tramp

When editing a remote file with tramp, I want org-babel source blocks to source the remote machine's .bashrc. I found this workaround that does what I want: #+BEGIN_SRC bash :preamble ". ~/....
0
votes
0answers
27 views

How to capture the column sort in Org-mode inside a formula?

Let's say, I have a following table: |-------+---------| | NAME | VALUE | |---------+-------| | DAVID | 3.83 | | JULIA | 0.89 | | ALICE | 0.59 | |-------+---------| | SUM | ...
0
votes
0answers
16 views

How to change the size of the popup window from org-edit-special?

When I type C-c ' on an org-babel source block, a horizontal split buffer appears where I can edit the source code. If I want to resize this pane, I can do it with window resizing commands or just ...
1
vote
2answers
75 views

Using yaml src block in following python src block

I am trying to use multiple src blocks to explain a yaml config file usage in python. Below is my org file, #+name: config.yaml #+begin_src yaml name: john why: check # below is a dict example # see ...
2
votes
1answer
55 views

Setting :prologue in header args as elisp has "scope" problems when running (org-sbe), "wrong" `org-element-context`?

To cut down on some repetitive boilerplate, I'm attempting to make my header arguments more "dynamic", but I have run into what I believe is a "scope" issue, that I cannot yet get ...
0
votes
0answers
39 views

How to add ATTR_LATEX to all babel blocks efficiently?

I recently figured out how to make my babel codes to have a border background when export as pdf. I did it by adding the following before the BEGIN_SRC: #+ATTR_LATEX: :options frame=single This ...
0
votes
1answer
14 views

org-babel pass bibtex sample to python code block

Is it possible to pass a sample bibtex document into a python source code block to be evaluated? :PROPERTIES: :ID: d7154890-6d45-44c0-9b0c-9c0f6533c11e :header-args: :session bibtex :END: #+...
0
votes
0answers
97 views

How to use PlantUML Server with Org mode?

plantuml-mode supports execution using a PlantUML server, with (setq plantuml-default-exec-mode 'server). I can set the server location with (setq plantuml-server-url "https://myserver.plantuml....
2
votes
1answer
40 views

How to start a background process from Org?

The following code waits until process is finished, which is unexpected #+begin_src shell perl -wE 'sleep(3)' & disown #+end_src The work-around for that is to close STDIN and STDOUT explicitly #...
1
vote
0answers
15 views

Why does babel insert whitespace after parentheses in :var values?

I am running GNU Emacs 27.2 (build 1, x86_64-w64-mingw32) of 2021-03-26 on Windows 10 with org-mode 8.3.4-102-gebe7aa-elpa. When I #+CALL a code block passing in a var with a parenthesis, a space ...

1
2 3 4 5
14