emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Richard Stanton <stanton@haas.berkeley.edu>
To: emacs-orgmode@gnu.org
Subject: :ignoreheading: works with LaTeX export, but not HTML
Date: Thu, 26 Mar 2015 19:45:23 -0700	[thread overview]
Message-ID: <A2E8873D-DB87-4487-A658-0FED4DB31FD6@haas.berkeley.edu> (raw)

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	other threads:[~2015-03-27  2:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27  2:45 Richard Stanton [this message]
2015-03-27 10:53 ` Nicolas Goaziou
2015-03-27 13:29   ` Jacob Gerlach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A2E8873D-DB87-4487-A658-0FED4DB31FD6@haas.berkeley.edu \
    --to=stanton@haas.berkeley.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).