emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] :ignoreheading: works with LaTeX export, but not HTML


From: Richard Stanton
Subject: [O] :ignoreheading: works with LaTeX export, but not HTML
Date: Thu, 26 Mar 2015 19:45:23 -0700

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]