From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Zhao Subject: Re: Wrong numbering after removal of headline Date: Mon, 30 Jun 2014 17:32:15 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1jBQ-0003r6-Qw for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 17:32:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1jBP-0000XG-QZ for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 17:32:16 -0400 Received: from mail-ve0-x233.google.com ([2607:f8b0:400c:c01::233]:46949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1jBP-0000X6-L4 for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 17:32:15 -0400 Received: by mail-ve0-f179.google.com with SMTP id sa20so8786341veb.38 for ; Mon, 30 Jun 2014 14:32:15 -0700 (PDT) In-Reply-To: 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: "Thomas S. Dye" Cc: emacs-orgmode > 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