UP | HOME

Babel: Languages

Table of Contents

Babel Languages

Note: Many languages in this table still require documentation. A template is provided in the worg git repository for the addition of language documentation.

Babel has support for the following languages.
LanguageDocumentationIdentifierRequirements
Asymptoteasymptoteasymptote, asy-mode
AwkawkAwk
Cob-doc-Ccnone
C++ob-doc-Ccppnone
Calccalcnone
Clojureob-doc-clojureclojureclojure, clojure-mode, slime, swank-clojure
CSScssnone
Ditaaditaaditaa (bundled with Org-mode)
Dot (Graphviz)dotdot
Emacs Lispemacs-lispnone
Fomusfomus (contrib)fomus (music notation)
FortranF90fortran
Gnuplotob-doc-gnuplotgnuplotgnuplot, gnuplot-mode
Haskellhaskellhaskell, haskell-mode, inf-haskell, lhs2tex
Javajavajava
Javascriptjsnode.js
LaTeXob-doc-latexlatexlatex, auctex, reftex
Ledgerob-doc-ledgerledgerledger
Lilypondob-doc-lilypondlylilypond music notation
Lisplispslime
Matlabob-doc-octave-matlabmatlabmatlab, matlab.el
Maximamaxmaxima
Mscgenob-doc-mscgenmscgenMscgen
Objective Camlocamlocaml, tuareg-mode
Octaveob-doc-octave-matlaboctaveoctave
Orgorgnone
OZob-doc-ozoz (contrib)Mozart which includes a major mode
Perlperlperl, cperl-mode (optional)
Picolispob-doc-picolisppicolispPicoLisp
PlantUMLplantuml
Pythonpythonpython, python-mode (optional)
Rob-doc-RRR, ess-mode, tikzDevice
Rubyrubyruby, irb, ruby-mode, inf-ruby mode
Sasssasssass, sass-mode
Schemeschemenone
Shenshenshen
shellsha shell
SQLsqlnone
Sqlitesqlitenone

Configure active languages

To add support for a particular language to your Babel installation first make sure that the requirements of the language are met, then you may customize the org-babel-load-languages variable, update the variable's value manually by adding1

(lang . t)

to its definition. A line like the following to explicitly remove support for a language.

(lang . nil)

Here is an example manual configuration of this variable, which enables support for R, and disables support for emacs-lisp.

;; active Babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)
   (emacs-lisp . nil)
   ))

Develop support for new languages

The core Babel functions (viewing, export, tangling, etc…) are language agnostic and will work even for languages that are not explicitly supported. Explicit language-specific support is required only for evaluation of code blocks in a language.

Babel is designed to be easily extended to support new languages. Language support is added by defining language-specific functions using a simple naming convention. The full suite of possible language specific functions need not be implemented all at once, but rather it is possible (and encouraged) to develop language-specific functionality in an incremental fashion – Babel will make use of those functions which are available, and will fail gracefully when functionality has not yet been implemented.

There is a short Emacs Lisp template (ob-template.el) which can be used as a starting point for implementing support for new languages. Developers are encouraged to read the Org-mode contribution instructions in the hope that the language support can be included into the Org-mode core.

Footnotes:

1 languages in the contrib directory are marked with "(contrib)" in the "Identifier" section above are not loadable through the org-babel-do-load-languages variable, but rather must be explicitly required (e.g. (require 'ob-oz)) after the contrib directory has been added to you load path.

Documentation from the http://orgmode.org/worg/ website (either in its HTML format or in its Org format) is licensed under the GNU Free Documentation License version 1.3 or later. The code examples and css stylesheets are licensed under the GNU General Public License v3 or later.