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

* Re: :ignoreheading: works with LaTeX export, but not HTML
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2015-03-27 10:53 UTC (permalink / raw)
  To: Richard Stanton; +Cc: emacs-orgmode

Hello,

Richard Stanton <stanton@haas.berkeley.edu> writes:

> 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

:ignoreheading: is a feature implemented in "ox-beamer.el" only. This is
not a common feature for all back-ends.

Regards,

-- 
Nicolas Goaziou

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

* Re: :ignoreheading: works with LaTeX export, but not HTML
  2015-03-27 10:53 ` Nicolas Goaziou
@ 2015-03-27 13:29   ` Jacob Gerlach
  0 siblings, 0 replies; 3+ messages in thread
From: Jacob Gerlach @ 2015-03-27 13:29 UTC (permalink / raw)
  To: Richard Stanton, Org-mode

On Fri, Mar 27, 2015 at 6:53 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> :ignoreheading: is a feature implemented in "ox-beamer.el" only. This is
> not a common feature for all back-ends.

IIUC, this question is about performance of the filter shown in the
OP, not about the built in feature in ox-beamer.

Removed the escaped backquote from the string-match regexp seems to
work for both Latex and HTML, but I can't comment on why this is the
case or whether it might have unintended consequences.

Regards,
Jake

^ 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

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