Next: , Previous: , Up: Working with Source Code   [Contents][Index]


15.9 Languages

Code blocks in the following languages are supported.

LanguageIdentifierLanguageIdentifier
AsymptoteasymptoteLisplisp
AwkawkLualua
CCMATLABmatlab
C++C++145Mscgenmscgen
ClojureclojureObjective Camlocaml
CSScssOctaveoctave
DD146Org modeorg
ditaaditaaOzoz
Emacs CalccalcPerlperl
Emacs Lispemacs-lispPlantumlplantuml
EshelleshellProcessing.jsprocessing
FortranfortranPythonpython
GnuplotgnuplotRR
GNU ScreenscreenRubyruby
GraphvizdotSasssass
HaskellhaskellSchemescheme
JavajavaSedsed
Javascriptjsshellsh
LaTeXlatexSQLsql
LedgerledgerSQLitesqlite
LilypondlilypondValavala

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)

Footnotes

(145)

C++ language is handled in ‘ob-C.el’. Even though the identifier for such source blocks is ‘C++’, you activate it by loading the C language.

(146)

D language is handled in ‘ob-C.el’. Even though the identifier for such source blocks is ‘D’, you activate it by loading the C language.