+@node Markup rules, Selective export, Exporting, Exporting
+@section Markup rules
+
+When exporting Org mode documents, the exporter tries to reflect the
+structure of the document as accurately as possible in the back-end. Since
+export targets like HTML or La@TeX{} allow much richer formatting, Org mode
+has rules how to prepare text for rich export. This section summarizes the
+markup rule used in an Org mode buffer.
+
+@menu
+* Document title:: How the document title is determined
+* Headings and sections:: The main structure of the exported document
+* Table of contents:: If, where, how to create a table of contents
+* Initial text:: Text before the first headline
+* Lists:: Plain lists are exported
+* Paragraphs:: What determines beginning and ending
+* Literal examples:: Source code and other examples
+* Include files:: Include the contents of a file during export
+* Tables exported:: Tables are exported richly
+* Inlined images:: How to inline images during export
+* Footnotes:: Numbers like [1]
+* Emphasis and monospace:: To bold or not to bold
+* TeX macros and LaTeX fragments:: Create special, rich export.
+* Horizontal rules:: A line across the page
+* Comment lines:: Some lines will not be exported
+@end menu
+
+@node Document title, Headings and sections, Markup rules, Markup rules
+@subheading Document title
+@cindex document title, markup rules
+
+@noindent
+The title of the exported document is taken from the special line
+
+@example
+#+TITLE: This is the title of the document
+@end example
+
+@noindent
+If this line does not exist, the title is derived from the first non-empty,
+non-comment line in the buffer. If no such line exists, or if you have
+turned off exporting of the text before the first headline (see below), the
+title will be the file name without extension.
+
+If you are exporting only a subtree by marking is as the region, the heading
+of the subtree will become the title of the document. If the subtree has a
+property @code{EXPORT_TITLE}, that will take precedence.
+
+@node Headings and sections, Table of contents, Document title, Markup rules
+@subheading Headings and sections
+@cindex headings and sections, markup rules
+
+The outline structure of the document as described in @ref{Document
+Structure} forms the basis for defining sections of the exported document.
+However, since the outline structure is also used for (for example) lists of
+tasks, only the first three outline levels will be used as headings. Deeper
+levels will become itemized lists. You can change the location of this
+switch, globally by setting the variable @code{org-headline-levels}, or on a
+per file basis with a line
+
+@example
+#+OPTIONS: H:4
+@end example
+
+@node Table of contents, Initial text, Headings and sections, Markup rules
+@subheading Table of contents
+@cindex table of contents, markup rules
+
+The table of contents is normally inserted directly before the first headline
+of the file. If you would like to get it to a different location, insert the
+string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
+location. The depth of the table of contents is by default the same as the
+number of headline levels, but you can choose a smaller number or turn off
+the table of contents entirely by configuring the variable
+@code{org-export-with-toc}, or on a per-file basis with a line like
+
+@example
+#+OPTIONS: toc:2 (only to two levels in TOC)
+#+OPTIONS: toc:nil (no TOC at all)
+@end example
+
+@node Initial text, Lists, Table of contents, Markup rules
+@subheading Text before the first headline
+@cindex text before first headline, markup rules
+@cindex #+TEXT
+
+Org mode normally exports the text before the first headline, and even uses
+the first line as the document title. The text will be fully marked up. If
+you need to include literal HTML or La@TeX{} code, use the special constructs
+described below in the sections for the individual exporters.
+
+Some people like to use the space before the first headline for setup and
+internal links and therefore would like to control the exported text before
+the first headline in a different way. You can do so by setting the variable
+@code{org-export-skip-text-before-1st-heading} to @code{t}. On a per-file
+basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
+
+@noindent
+If you still want to have some text before the first headline, use the
+@code{#+TEXT} construct:
+
+@example
+#+OPTIONS: skip:t
+#+TEXT: This text will go before the *first* headline.
+#+TEXT: [TABLE-OF-CONTENTS]
+#+TEXT: This goes between the table of contents and the first headline
+@end example
+
+@node Lists, Paragraphs, Initial text, Markup rules
+@subheading Lists
+@cindex lists, markup rules
+
+Plain lists as described in @ref{Plain lists} are translated to the back-ends
+syntax for such lists. Most back-ends support unordered, ordered, and
+description lists.
+
+@node Paragraphs, Literal examples, Lists, Markup rules
+@subheading Paragraphs, line breaks, and quoting
+@cindex paragraphs, markup rules
+
+Paragraphs are separated by at least one empty line. If you need to enforce
+a line break within a paragraph, use @samp{\\} at the end of a line.
+
+To keep the line breaks in a region, but otherwise use normal formatting, you
+can use this construct, which can also be used to format poetry.
+
+@example
+#+BEGIN_VERSE
+ Great clouds overhead
+ Tiny black birds rise and fall
+ Snow covers Emacs
+
+ -- AlexSchroeder
+#+END_VERSE
+@end example
+
+When quoting a passage from another document, it is customary to format this
+as a paragraph that is indented on both the left and the right margin. You
+can include quotations in Org mode documents like this:
+
+@example
+#+BEGIN_QUOTE
+Everything should be made as simple as possible,
+but not any simpler -- Albert Einstein
+#+END_QUOTE
+@end example
+
+
+@node Literal examples, Include files, Paragraphs, Markup rules
+@subheading Literal examples
+@cindex literal examples, markup rules
+
+You can include literal examples that should not be subjected to
+markup. Such examples will be typeset in monospace, so this is well suited
+for source code and similar examples.
+@cindex #+BEGIN_EXAMPLE
+
+@example
+#+BEGIN_EXAMPLE
+Some example from a text file.
+#+END_EXAMPLE
+@end example
+
+For simplicity when using small examples, you can also start the example
+lines with a colon:
+
+@example
+: Some example from a text file.
+@end example
+
+@cindex formatting source code, markup rules
+If the example is source code from a programming language, or any other text
+that can be marked up by font-lock in Emacs, you can ask for the example to
+look like the fontified Emacs buffer@footnote{Currently this works only for
+the HTML back-end, and requires the @file{htmlize.el} package version 1.34 or
+later.}. This is done with the @samp{src} block, where you also need to
+specify the name of the major mode that should be used to fontify the
+example:
+@cindex #+BEGIN_SRC
+
+@example
+#+BEGIN_SRC emacs-lisp
+(defun org-xor (a b)
+ "Exclusive or."
+ (if a (not b) b))
+#+END_SRC
+@end example
+
+@table @kbd
+@kindex C-c '
+@item C-c '
+Edit the source code example at point in its native mode. This works by
+switching to an indirect buffer, narrowing the buffer and switching to the
+other mode. You need to exit by pressing @kbd{C-c '} again@footnote{Upon
+exit, lines starting with @samp{*} or @samp{#} will get a comma prepended, to
+keep them from being interpreted by Org as outline nodes or special
+comments. These commas will be striped for editing with @kbd{C-c '}, and
+also for export.}. Fixed-width
+regions (where each line starts with a colon followed by a space) will be
+edited using @code{artist-mode}@footnote{You may select a different-mode with
+the variable @code{org-edit-fixed-width-region-mode}.} to allow creating
+ASCII drawings easily. Using this command in an empty line will create a new
+fixed-width region.
+@end table
+
+
+@node Include files, Tables exported, Literal examples, Markup rules
+@subheading Include files
+@cindex include files, markup rules
+
+During export, you can include the content of another file. For example, to
+include your .emacs file, you could use:
+@cindex #+INCLUDE
+
+@example
+#+INCLUDE: "~/.emacs" src emacs-lisp
+@end example
+
+The optional second and third parameter are the markup (@samp{quote},
+@samp{example}, or @samp{src}), and, if the markup is @samp{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 @code{:prefix1} and @code{:prefix} to specify prefixes for the
+first line and for each following line. For example, to include a file as an
+item, use
+
+@example
+#+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
+@end example
+
+@table @kbd
+@kindex C-c '
+@item C-c '
+Visit the include file at point.
+@end table
+
+@node Tables exported, Inlined images, Include files, Markup rules
+@subheading Tables
+@cindex tables, markup rules
+
+Both the native Org mode tables (@pxref{Tables}) and tables formatted with
+the @file{table.el} package will be exported properly. For Org mode tables,
+the lines before the first horizontal separator line will become table header
+lines. You can use the following lines somewhere before the table to assign
+a caption and a label for cross references:
+
+@example
+#+CAPTION: This is the caption for the next table (or link)
+#+LABEL: tbl:basic-data
+@end example
+
+@node Inlined images, Footnotes, Tables exported, Markup rules
+@subheading Inlined Images
+@cindex inlined images, markup rules
+
+Some backends (HTML and LaTeX) allow to directly include images into the
+exported document. Org does this, if a link to an image files does not have
+a description part, for example @code{[[./img/a.jpg]]}. If you wish to
+define a caption for the image and maybe a label for internal cross
+references, you can use (before, but close to the link)
+
+@example
+#+CAPTION: This is the caption for the next figure link (or table)
+#+LABEL: fig:SED-HR4049
+@end example
+
+You may also define additional attributes for the figure. As this is
+backend-specific, see the sections about the individual backends for more
+information.
+
+@node Footnotes, Emphasis and monospace, Inlined images, Markup rules
+@subheading Footnotes
+@cindex footnotes, markup rules
+@cindex @file{footnote.el}
+
+@kindex C-c !
+Numbers in square brackets are treated as footnote markers, and lines
+starting with such a marker are interpreted as the footnote itself. You can
+use the Emacs package @file{footnote.el} to create footnotes@footnote{The
+@file{footnote} package uses @kbd{C-c !} to invoke its commands. This
+binding conflicts with the Org mode command for inserting inactive time
+stamps. You could use the variable @code{footnote-prefix} to switch
+footnotes commands to another key. Or, if you are too used to this binding,
+you could use @code{org-replace-disputed-keys} and @code{org-disputed-keys}
+to change the settings in Org.}. For example:
+
+@example
+The Org homepage[1] now looks a lot better than it used to.
+
+[1] The link is: http://orgmode.org
+@end example
+
+@node Emphasis and monospace, TeX macros and LaTeX fragments, Footnotes, Markup rules
+@subheading Emphasis and monospace
+
+@cindex underlined text, markup rules
+@cindex bold text, markup rules
+@cindex italic text, markup rules
+@cindex verbatim text, markup rules
+@cindex code text, markup rules
+@cindex strike-through text, markup rules
+You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
+and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
+in the code and verbatim string is not processed for Org mode specific
+syntax, it is exported verbatim.
+
+@node TeX macros and LaTeX fragments, Horizontal rules, Emphasis and monospace, Markup rules
+@subheading @TeX{} macros and La@TeX{} fragments
+@cindex LaTeX fragments, markup rules
+@cindex TeX macros, markup rules
+@cindex HTML entities
+@cindex LaTeX entities
+
+A @TeX{}-like syntax is used to specify special characters. Where possible,
+these will be transformed into the native format of the exporter back-end.
+Strings like @code{\alpha} will be exported as @code{α} in the HTML
+output, and as @code{$\alpha$} in the La@TeX{} output. Similarly,
+@code{\nbsp} will become @code{ } in HTML and @code{~} in La@TeX{}.
+This applies for a large number of entities, with names taken from both HTML
+and La@TeX{}, see the variable @code{org-html-entities} for the complete
+list. If you are unsure about a name, use @kbd{M-@key{TAB}} for completion
+after having types the backslash and maybe a few characters
+(@pxref{Completion}).
+
+La@TeX{} fragments are converted into images for HTML export, and they are
+written literally into the La@TeX{} export. See also @ref{Embedded LaTeX}.
+
+Finally, @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
+@samp{...} are all converted into special commands creating hyphens of
+different lengths or a compact set of dots.
+
+@node Horizontal rules, Comment lines, TeX macros and LaTeX fragments, Markup rules
+@subheading Horizontal rules
+@cindex horizontal rules, markup rules
+A line consisting of only dashes, and at least 5 of them, will be
+exported as a horizontal line (@samp{<hr/>} in HTML).
+
+@node Comment lines, , Horizontal rules, Markup rules
+@subheading Comment lines
+@cindex comment lines
+@cindex exporting, not
+
+Lines starting with @samp{#} in column zero are treated as comments and will
+never be exported. Also entire subtrees starting with the word
+@samp{COMMENT} will never be exported. Finally, regions surrounded by
+@samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
+
+@table @kbd
+@kindex C-c ;
+@item C-c ;
+Toggle the COMMENT keyword at the beginning of an entry.
+@end table
+
+@node Selective export, Export options, Markup rules, Exporting
+@section Selective export
+@cindex export, selective by tags
+
+You may use tags to select the parts of a document that should be exported,
+or to exclude parts from export. This behavior is governed by two variables:
+@code{org-export-select-tags} and @code{org-export-exclude-tags}.
+
+Org first checks if any of the @emph{select} tags is present in the buffer.
+If yes, all trees that do not carry one of these tags will be excluded. If a
+selected tree is a subtree, the heading hierarchy above it will also be
+selected for export, but not the text below those headings.
+
+@noindent
+If none of the select tags is found, the whole buffer will be selected for
+export.
+
+@noindent
+Finally, all subtrees that are marked by any of the @emph{exclude} tags will
+be removed from the export buffer.
+
+@node Export options, The export dispatcher, Selective export, Exporting
+@section Export options
+@cindex options, for export
+
+@cindex completion, of option keywords
+The exporter recognizes special lines in the buffer which provide
+additional information. These lines may be put anywhere in the file.
+The whole set of lines can be inserted into the buffer with @kbd{C-c
+C-e t}. For individual lines, a good way to make sure the keyword is
+correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
+(@pxref{Completion}).
+
+@table @kbd
+@kindex C-c C-e t
+@item C-c C-e t
+Insert template with export options, see example below.
+@end table
+
+@cindex #+TITLE:
+@cindex #+AUTHOR:
+@cindex #+DATE:
+@cindex #+EMAIL:
+@cindex #+LANGUAGE:
+@cindex #+TEXT:
+@cindex #+OPTIONS:
+@cindex #+LINK_UP:
+@cindex #+LINK_HOME:
+@cindex #+EXPORT_SELECT_TAGS:
+@cindex #+EXPORT_EXCLUDE_TAGS:
+@example
+#+TITLE: the title to be shown (default is the buffer name)
+#+AUTHOR: the author (default taken from @code{user-full-name})
+#+DATE: A date, fixed, of a format string for @code{format-time-string}
+#+EMAIL: his/her email address (default from @code{user-mail-address})
+#+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
+#+TEXT: Some descriptive text to be inserted at the beginning.
+#+TEXT: Several lines may be given.
+#+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
+#+LINK_UP: the ``up'' link of an exported page
+#+LINK_HOME: the ``home'' link of an exported page
+#+EXPORT_SELECT_TAGS: Tags that select a tree for export
+#+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
+@end example
+
+@noindent
+The OPTIONS line is a compact@footnote{If you want to configure many options
+this way, you can use several OPTIONS lines.} form to specify export settings. Here
+you can:
+@cindex headline levels
+@cindex section-numbers
+@cindex table of contents
+@cindex line-break preservation
+@cindex quoted HTML tags
+@cindex fixed-width sections
+@cindex tables
+@cindex @TeX{}-like syntax for sub- and superscripts
+@cindex footnotes
+@cindex special strings
+@cindex emphasized text
+@cindex @TeX{} macros
+@cindex La@TeX{} fragments
+@cindex author info, in export
+@cindex time info, in export
+@example
+H: @r{set the number of headline levels for export}
+num: @r{turn on/off section-numbers}
+toc: @r{turn on/off table of contents, or set level limit (integer)}
+\n: @r{turn on/off line-break-preservation}
+@@: @r{turn on/off quoted HTML tags}
+:: @r{turn on/off fixed-width sections}
+|: @r{turn on/off tables}
+^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
+ @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
+ @r{the simple @code{a_b} will be left as it is.}
+-: @r{turn on/off conversion of special strings.}
+f: @r{turn on/off footnotes like this[1].}
+todo: @r{turn on/off inclusion of TODO keywords into exported text}
+pri: @r{turn on/off priority cookies}
+tags: @r{turn on/off inclusion of tags, may also be @code{not-in-toc}}
+<: @r{turn on/off inclusion of any time/date stamps like DEADLINES}
+*: @r{turn on/off emphasized text (bold, italic, underlined)}
+TeX: @r{turn on/off simple @TeX{} macros in plain text}
+LaTeX: @r{turn on/off La@TeX{} fragments}
+skip: @r{turn on/off skipping the text before the first heading}
+author: @r{turn on/off inclusion of author name/email into exported file}
+creator: @r{turn on/off inclusion of creator info into exported file}
+timestamp: @r{turn on/off inclusion creation time into exported file}
+d: @r{turn on/off inclusion of drawers}
+@end example
+
+These options take effect in both the HTML and La@TeX{} export, except
+for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
+@code{nil} for the La@TeX{} export.
+
+When exporting only a single subtree by selecting it with @kbd{C-c @@} before
+calling an export command, the subtree can overrule some of the file's export
+settings with properties @code{EXPORT_FILE_NAME}, @code{EXPORT_TITLE},
+@code{EXPORT_TEXT}, and @code{EXPORT_OPTIONS}.
+
+@node The export dispatcher, ASCII export, Export options, Exporting
+@section The export dispatcher
+@cindex dispatcher, for export commands
+
+All export commands can be reached using the export dispatcher, which is a
+prefix key that prompts for an additional key specifying the command.
+Normally the entire file is exported, but if there is an active region that
+contains one outline tree, the first heading is used as document title and
+the subtrees are exported.
+
+@table @kbd
+@kindex C-c C-e
+@item C-c C-e
+Dispatcher for export and publishing commands. Displays a help-window
+listing the additional key(s) needed to launch an export or publishing
+command. The prefix arg is passed through to the exporter. A double prefix
+@kbd{C-u C-u} causes most commands to be executed in the background, in a
+separate emacs process@footnote{To make this behavior the default, customize
+the variable @code{org-export-run-in-background}.}.
+@kindex C-c C-e v
+@item C-c C-e v
+Like @kbd{C-c C-e}, but only export the text that is currently visible
+(i.e. not hidden by outline visibility).
+@kindex C-u C-u C-c C-e
+@item C-u C-u C-c C-e
+Call an the exporter, but reverse the setting of
+@code{org-export-run-in-background}, i.e. request background processing if
+not set, or force processing in the current Emacs process if st.
+@end table
+
+@node ASCII export, HTML export, The export dispatcher, Exporting