15.9 Languages
Code blocks in the following languages are supported.
Language | Identifier | Language | Identifier |
---|---|---|---|
Asymptote | ‘asymptote ’ | Lisp | ‘lisp ’ |
Awk | ‘awk ’ | Lua | ‘lua ’ |
C | ‘C ’ | MATLAB | ‘matlab ’ |
C++ | ‘C++ ’1 | Mscgen | ‘mscgen ’ |
Clojure | ‘clojure ’ | Objective Caml | ‘ocaml ’ |
CSS | ‘css ’ | Octave | ‘octave ’ |
D | ‘D ’2 | Org mode | ‘org ’ |
ditaa | ‘ditaa ’ | Oz | ‘oz ’ |
Emacs Calc | ‘calc ’ | Perl | ‘perl ’ |
Emacs Lisp | ‘emacs-lisp ’ | Plantuml | ‘plantuml ’ |
Eshell | ‘eshell ’ | Processing.js | ‘processing ’ |
Fortran | ‘fortran ’ | Python | ‘python ’ |
Gnuplot | ‘gnuplot ’ | R | ‘R ’ |
GNU Screen | ‘screen ’ | Ruby | ‘ruby ’ |
Graphviz | ‘dot ’ | Sass | ‘sass ’ |
Haskell | ‘haskell ’ | Scheme | ‘scheme ’ |
Java | ‘java ’ | Sed | ‘sed ’ |
Javascript | ‘js ’ | shell | ‘sh ’ |
LaTeX | ‘latex ’ | SQL | ‘sql ’ |
Ledger | ‘ledger ’ | SQLite | ‘sqlite ’ |
Lilypond | ‘lilypond ’ | Vala | ‘vala ’ |
Additional documentation for some languages is at https://orgmode.org/worg/org-contrib/babel/languages.html.
By default, only Emacs Lisp is enabled for evaluation. To enable or disable other languages, customize the org-babel-load-languages
variable either through the Emacs customization interface, or by adding code to the init file as shown next.
In this example, evaluation is disabled for Emacs Lisp, and enabled for R.
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . nil)
(R . t)))
Note that this is not the only way to enable a language. Org also enables languages when loaded with require
statement. For example, the following enables execution of Clojure code blocks:
(require 'ob-clojure)