From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Zhao Subject: Wrong numbering after removal of headline Date: Mon, 30 Jun 2014 15:02:07 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1gq9-00048U-AF for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 15:02:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1gq8-0007fH-GQ for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 15:02:09 -0400 Received: from mail-vc0-x234.google.com ([2607:f8b0:400c:c03::234]:36402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1gq8-0007fC-BY for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 15:02:08 -0400 Received: by mail-vc0-f180.google.com with SMTP id im17so7840316vcb.25 for ; Mon, 30 Jun 2014 12:02:07 -0700 (PDT) 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: emacs-orgmode 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: --8<---------------cut here---------------start------------->8--- Contents 1 Level1 1.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . . --8<---------------cut here---------------end--------------->8--- 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: --8<---------------cut here---------------start------------->8--- 0.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . . --8<---------------cut here---------------end--------------->8--- 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? Thanks in advance York