M-S-left with point on the Level2 heading?

Tom

York Zhao <gtdplatf...@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 <t...@tsdye.com> wrote:
>> Aloha York,
>>
>> York Zhao <gtdplatf...@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

Reply via email to