Next: , Previous: Literal examples, Up: Markup

11.4 Include files

During export, you can include the content of another file. For example, to include your .emacs file, you could use:

     #+INCLUDE: "~/.emacs" src emacs-lisp

The optional second and third parameter are the markup (e.g., ‘quote’, ‘example’, or ‘src’), and, if the markup is ‘src’, the language for formatting the contents. The markup is optional; if it is not given, the text will be assumed to be in Org mode format and will be processed normally. The include line will also allow additional keyword parameters :prefix1 and :prefix to specify prefixes for the first line and for each following line, :minlevel in order to get Org mode content demoted to a specified level, as well as any options accepted by the selected markup. For example, to include a file as an item, use

     #+INCLUDE: "~/snippets/xx" :prefix1 "   + " :prefix "     "

You can also include a portion of a file by specifying a lines range using the :lines parameter. The line at the upper end of the range will not be included. The start and/or the end of the range may be omitted to use the obvious defaults.

     #+INCLUDE: "~/.emacs" :lines "5-10"   Include lines 5 to 10, 10 excluded
     #+INCLUDE: "~/.emacs" :lines "-10"    Include lines 1 to 10, 10 excluded
     #+INCLUDE: "~/.emacs" :lines "10-"    Include lines from 10 to EOF
C-c '
Visit the include file at point.