From 7b60eefcb21c2a62b1ab7f248f6a0b993d89cc4d Mon Sep 17 00:00:00 2001 From: Mark Edgington
Date: Sat, 2 Aug 2014 00:32:29 -0400 Subject: [PATCH] * ox-extra.el: add ignore-headlines filter --- contrib/lisp/ox-extra.el | 82 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/contrib/lisp/ox-extra.el b/contrib/lisp/ox-extra.el index f4f0b76..01368cb 100644 --- a/contrib/lisp/ox-extra.el +++ b/contrib/lisp/ox-extra.el @@ -23,6 +23,12 @@ ;; are not part of org's core. Call `ox-extras-activate' passing a ;; list of symbols naming extras, which will be installed globally in ;; your org session. +;; +;; For example, you could include the following in your .emacs file: +;; +;; (require 'ox-extra) +;; (ox-extras-activate '(latex-header-blocks ignore-headlines)) +;; ;; Currently available extras: @@ -35,6 +41,12 @@ ;; ... ;; #+end_latex +;; - `ignore-headlines' -- allow a headline (but not its children) to +;; be ignored. Any headline tagged with the 'ignore' tag will be +;; ignored (i.e. will not be included in the export), but any child +;; headlines will not be ignored (unless explicitly tagged to be +;; ignored), and will instead have their levels promoted by one. + ;; TODO: ;; - add a function to org-mode-hook that looks for a ox-extras local ;; variable and activates the specified extras buffer-locally @@ -75,8 +87,76 @@ ;; earlier in the file (reverse positions))))) + +;; During export headlines which have the "ignore" tag are removed +;; from the parse tree. Their contents are retained (leading to a +;; possibly invalid parse tree, which nevertheless appears to function +;; correctly with most export backends) all children headlines are +;; retained and are promoted to the level of the ignored parent +;; headline. +;; +;; This makes it possible to add structure to the original Org-mode +;; document which does not effect the exported version, such as in the +;; following examples. +;; +;; Wrapping an abstract in a headline +;; +;; * Abstract :ignore: +;; #+LaTeX: \begin{abstract} +;; #+HTML: