emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* :ignoreheading: works with LaTeX export, but not HTML
@ 2015-03-27  2:45 Richard Stanton
  2015-03-27 10:53 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stanton @ 2015-03-27  2:45 UTC (permalink / raw)
  To: emacs-orgmode

I want to put some headers in my org file that don't get exported. If I put :ignoreheading: after the title, it correctly does not get exported to LaTeX, but it still appears when I export to HTML (with the text :ignoreheading: on the same line). Am I missing something? In my setup I have the lines

(defun sa-ignore-headline (contents backend info)
  "Ignore headlines with tag `ignoreheading'"
  (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
                  (string-match "\\`.*ignoreheading.*\n"
                                (downcase contents)))
    (replace-match "" nil nil contents)))

(defun headline-nonumber (contents backend info)
  "Make headlines with nonumber."
  (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
                  (string-match "\\`.*nonumber.*\n"
                                (downcase contents)))
    (let ((output contents))
      (setq output (replace-regexp-in-string "section{" "section*{" contents))
      (setq output (replace-regexp-in-string "\\\\hfill{}\\\\textsc{nonumber}" "" output))

(add-to-list 'org-export-filter-headline-functions 'sa-ignore-headline)
(add-to-list 'org-export-filter-headline-functions 'headline-nonumber)

Thanks for any suggestions.

By the way, this is with org-mode release_8.3beta-951-g2f58e3

Richard Stanton

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

end of thread, other threads:[~2015-03-27 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-27  2:45 :ignoreheading: works with LaTeX export, but not HTML Richard Stanton
2015-03-27 10:53 ` Nicolas Goaziou
2015-03-27 13:29   ` Jacob Gerlach

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


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).