From: tsd@tsdye.com (Thomas S. Dye)
To: York Zhao <gtdplatform@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Wrong numbering after removal of headline
Date: Mon, 30 Jun 2014 11:37:07 -1000 [thread overview]
Message-ID: <m27g3y3wqk.fsf@tsdye.com> (raw)
In-Reply-To: <CAD3zm23YxiOknuoEM+3bCi-n30L1+GDOnVn6o20hChOh4_iP2w@mail.gmail.com> (York Zhao's message of "Mon, 30 Jun 2014 17:32:15 -0400")
M-S-left with point on the Level2 heading?
Tom
York Zhao <gtdplatform@gmail.com> 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 <tsd@tsdye.com> wrote:
>> Aloha York,
>>
>> York Zhao <gtdplatform@gmail.com> 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
next prev parent reply other threads:[~2014-06-30 21:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 19:02 Wrong numbering after removal of headline York Zhao
2014-06-30 19:37 ` Thomas S. Dye
2014-06-30 21:32 ` York Zhao
2014-06-30 21:37 ` Thomas S. Dye [this message]
2014-06-30 21:38 ` Nicolas Goaziou
2014-06-30 22:23 ` York Zhao
2014-06-30 23:01 ` York Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m27g3y3wqk.fsf@tsdye.com \
--to=tsd@tsdye.com \
--cc=emacs-orgmode@gnu.org \
--cc=gtdplatform@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).