Q: How can I tell org-mode
to exclude specific headlines from the table of contents when exporting?
For example, exporting
* Headline 1: Put me in TOC
* Headline 2: Put me in TOC
* Headline 3: DO NOT put me in TOC
to HTML produces
...
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1. Headline 1: Put me in TOC</a></li>
<li><a href="#sec-2">2. Headline 2: Put me in TOC</a></li>
<li><a href="#sec-3">3. Headline 3: DO NOT put me in TOC</a></li>
</ul>
</div>
...
but I want it to produce
...
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1. Headline 1: Put me in TOC</a></li>
<li><a href="#sec-2">2. Headline 2: Put me in TOC</a></li>
</ul>
</div>
...
The Table of contents section of the org-mode
manual doesn't have any information on this.
Also, I know that I can keep org-mode
from exporting headlines by setting the COMMENT
keyword via C-c ; (org-toggle-comment
) or by tagging them with :noexport:
. While this does keep affected headlines from showing up in the TOC, it also causes their contents to be omitted from the resulting document, which is not what I want.
EXPORT_OPTIONS: toc:nil
almost does what you want, but only when you export only just the subtree. To clarify, do you want the section to still be numbered, or do you want something akin to LaTeX's\section*
?