emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Excluding just heading from export
@ 2010-02-06 13:17 Paul Mead
  2010-02-06 14:22 ` Matt Lundin
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Mead @ 2010-02-06 13:17 UTC (permalink / raw)
  To: emacs-orgmode

Hi

is there any way of excluding just a heading from export, whilst exporting
the text below it in the usual way? If I use :noexport: it does what it
says in the documentation - prevents the entire subtree from exporting.

For my current work though, I'd like to use headings to rough out a
structure write notes - noexport is fine for this. Then in each section
I want to export the final 'written up' version. I can separate those
with different headings, but don't want the headings to show up in the
exported text.

Example:

* Essay title
** Notes on paragraph 1  :noexport:
These are notes which I want to remain hidden, including the heading
** Paragraph 1
This is the text I want to see exported, but I don't want the heading


Is this possible?
Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Excluding just heading from export
  2010-02-06 13:17 Excluding just heading from export Paul Mead
@ 2010-02-06 14:22 ` Matt Lundin
  2010-02-06 14:58   ` Paul Mead
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Lundin @ 2010-02-06 14:22 UTC (permalink / raw)
  To: Paul Mead; +Cc: emacs-orgmode

Paul Mead <paul.d.mead@gmail.com> writes:

> is there any way of excluding just a heading from export, whilst exporting
> the text below it in the usual way? If I use :noexport: it does what it
> says in the documentation - prevents the entire subtree from exporting.
>
> For my current work though, I'd like to use headings to rough out a
> structure write notes - noexport is fine for this. Then in each section
> I want to export the final 'written up' version. I can separate those
> with different headings, but don't want the headings to show up in the
> exported text.
>
> Example:
>
> * Essay title
> ** Notes on paragraph 1  :noexport:
> These are notes which I want to remain hidden, including the heading
> ** Paragraph 1
> This is the text I want to see exported, but I don't want the heading
>

One hack would be to use an export hook to remove headings with a
particular tag. E.g.,

--8<---------------cut here---------------start------------->8---
(defvar my-org-export-remove-heading-tag "killtag")

(defun my-org-export-remove-headings-with-tag ()
  (while (re-search-forward (concat ":" my-org-export-remove-heading-tag ":") nil t)
    (beginning-of-line)
    (kill-line)))
      
(add-hook 
 'org-export-preprocess-after-tree-selection-hook 
 'my-org-export-remove-headings-with-tag)
--8<---------------cut here---------------end--------------->8---

Best,
Matt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Excluding just heading from export
  2010-02-06 14:22 ` Matt Lundin
@ 2010-02-06 14:58   ` Paul Mead
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Mead @ 2010-02-06 14:58 UTC (permalink / raw)
  To: Matt Lundin; +Cc: emacs-orgmode

Matt Lundin <mdl@imapmail.org> writes:

>
> One hack would be to use an export hook to remove headings with a
> particular tag. E.g.,
>
> (defvar my-org-export-remove-heading-tag "killtag")
>
> (defun my-org-export-remove-headings-with-tag ()
>   (while (re-search-forward (concat ":" my-org-export-remove-heading-tag ":") nil t)
>     (beginning-of-line)
>     (kill-line)))
>       
> (add-hook 
>  'org-export-preprocess-after-tree-selection-hook 
>  'my-org-export-remove-headings-with-tag)
>
> Best,
> Matt
>
Thanks Matt, I'll give that a try and see if it does what I need.

Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-06 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-06 13:17 Excluding just heading from export Paul Mead
2010-02-06 14:22 ` Matt Lundin
2010-02-06 14:58   ` Paul Mead

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).