From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Wrong numbering after removal of headline Date: Mon, 30 Jun 2014 23:38:28 +0200 Message-ID: <87d2dqnkmj.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1jH0-0006KC-Fp for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 17:38:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1jGq-0002sO-Ac for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 17:38:02 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:36501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1jGp-0002sB-Vo for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 17:37:52 -0400 In-Reply-To: (York Zhao's message of "Mon, 30 Jun 2014 15:02:07 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: York Zhao Cc: emacs-orgmode Hello, York Zhao writes: > As an example, I have the follow org-mode buffer: > > * Level1 > ** Level2 > *** Level3 > > If I export this to LaTeX (C-x C-e l p), it produces the following: > > > Contents > > 1 Level1 > 1.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . > 1.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . . > > > Which is good. However, since what I need is that I don't want to produce the > "level1" heading, so I added the following code: > > (defun yz/org-export-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))) > > (add-to-list 'org-export-filter-headline-functions > 'yz/org-export-ignore-headline) Don't do that at the filter level, which is too late for heavy structure editing. Use `org-export-before-parsing-hook' instead. See section 12.14 in manual for an example. Regards, -- Nicolas Goaziou