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 11:37:07 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1jGR-0005s1-UO for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 17:37:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1jGK-0002g6-Tp for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 17:37:27 -0400 Received: from gproxy1-pub.mail.unifiedlayer.com ([69.89.25.95]:56768) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1X1jGK-0002fh-Lc for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 17:37:20 -0400 In-Reply-To: (York Zhao's message of "Mon, 30 Jun 2014 17:32:15 -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 M-S-left with point on the Level2 heading? Tom York Zhao writes: >> You could promote the Level2 subtree. > > I had thought about this, but I don't think this will be trivial. > > On Mon, Jun 30, 2014 at 3:37 PM, Thomas S. Dye wrote: >> 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 > > -- Thomas S. Dye http://www.tsdye.com