From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Wrong numbering after removal of headline Date: Mon, 30 Jun 2014 09:37:55 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1hP8-0000Sk-8I for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 15:38:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1hP0-0006Hp-Kv for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 15:38:18 -0400 Received: from gproxy7-pub.mail.unifiedlayer.com ([70.40.196.235]:56592) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1X1hP0-0006HM-1v for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 15:38:10 -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 Aloha York, York Zhao writes: > Hi list, > > 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) > > And I added tag "ignorheading" to the "Level1" heading. It works and produced: > > > 0.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . > 0.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . . > > > However, the headline numbering now starts from 0 which is wrong , what I want > is: > > 1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . > 1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . . > > Can anyone please tell me how I could achieve this? You could promote the Level2 subtree. hth, Tom -- Thomas S. Dye http://www.tsdye.com