Skip to main content

16.2 Structure Templates

With just a few keystrokes, it is possible to insert empty structural blocks, such as ‘#+BEGIN_SRC’ … ‘#+END_SRC’, or to wrap existing text in such a block.

C-c C-, (org-insert-structure-template)

Prompt for a type of block structure, and insert the block at point. If the region is active, it is wrapped in the block. First prompts the user for keys, which are used to look up a structure type from the variable below. If the key is TAB, RET, or SPC, the user is prompted to enter a block type.

Available structure types are defined in org-structure-template-alist, see the docstring for adding or changing values.

Org Tempo expands snippets to structures defined in org-structure-template-alist and org-tempo-keywords-alist. For example, < s TAB creates a code block. Enable it by customizing org-modules or add ‘(require 'org-tempo)’ to your Emacs init file1.

a#+BEGIN_EXPORT ascii’ … ‘#+END_EXPORT
c#+BEGIN_CENTER’ … ‘#+END_CENTER
C#+BEGIN_COMMENT’ … ‘#+END_COMMENT
e#+BEGIN_EXAMPLE’ … ‘#+END_EXAMPLE
E#+BEGIN_EXPORT’ … ‘#+END_EXPORT
h#+BEGIN_EXPORT html’ … ‘#+END_EXPORT
l#+BEGIN_EXPORT latex’ … ‘#+END_EXPORT
q#+BEGIN_QUOTE’ … ‘#+END_QUOTE
s#+BEGIN_SRC’ … ‘#+END_SRC
v#+BEGIN_VERSE’ … ‘#+END_VERSE

  1. For more information, please refer to the commentary section in ‘org-tempo.el’.