emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [patch, ox] Unnumbered headlines


From: Alan L Tyree
Subject: Re: [O] [patch, ox] Unnumbered headlines
Date: Sat, 09 Aug 2014 08:35:37 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0


On 08/08/14 23:39, Rasmus wrote:
Hi,

In a recent thread¹ Tom and Alan mention that authors sometimes need
unnumbered headlines, e.g. for prefaces.  This patch (tries to) add
this feature via the tag :nonumber: (customizable via Custom or
in-file).

I make two assumptions.  First, the tag is recursive, so if the parent
is not numbered the child is not numbered.  Secondly, I depart from
the LaTeX tradition of ignoring unnumbered headlines in the TOC
(except in the case of ox-latex.el where it depends on
org-latex-classes).  (See example below).

Needless to say such a feature needs to be discussed and I not sure
whether the greater Org community finds it useful or needless clutter.

In my opinion a :nonumber: tag is a natural continuation of :export:
and :noexport: and unlike :ignoreheading: the implementation is fairly
clean (or maybe I'm cheating myself here).  A reason for why to
include it is that it seems relatively easy to do *during* export, but
it's hard to consistently get it right on in both headlines and the
TOC via filters.

The patch is messing with ox.el, and thus I would appreciate a review
and potentially testing, in the case that it is agreed that such a
feature would be OK to add to ox.

It seems to work well with ox-latex.el, ox-ascii.el and ox-html.el.
It doesn't play well with ox-odt.el (headlines are still numbered).  I
will fix this as well as adding documentation if a consensus of the
worthwhileness of the patch can be reached.

Finally, here's an example output using ox-ascii

#+begin_src org
     * a (not numbered)               :nonum:
     ** aa (not numbert)
     * b (1)
     ** ba (not numbered)             :nonum:
     *** baa (not numbered)
     ** bb (1.1)

#+end_src

#+RESULTS: (TOC only, but the rest is as expected)
     a (not numbered)
     .. aa (not numbert)
     1 b (1)
     .. ba (not numbered)
     ..... baa (not numbered)
     .. 1.1 bb (1.1)


Thanks,
Rasmus

Footnotes:
¹   http://permalink.gmane.org/gmane.emacs.orgmode/89515

--
Vote for proprietary math!
Rasmus, you're my hero!

Regarding the two assumptions:

- Recursive tags: I think this is correct. I don't think it matters too much for my use case since things like the Preface will ordinarily be top level headlines and unlikely to have children. If there are child headlines, then I don't see why numbering would be required.

- Table of contents: I'm sure this is correct. I always ended up adding to the TOC when using LaTeX anyway.

The frontmatter of a book has two distinct types of pages:
- title pages, copyright pages and so forth. If these pages are headlined at all, then the :ignore: tag and Eric's filter takes care of them;

- things like the Preface, Forward and (in my case) Table of Statutes and Table of cases. This type wants to be referenced in the TOC but they definitely do not want to be sequentially numbered as chapters.

The Wikipedia entry on Book Design lists 12 types of frontmatter pages: http://en.wikipedia.org/wiki/Book_design. It's easy to see which ones fit into which category.

I think this facility will *greatly* enhance org-mode for book authors/publishers. It will certainly make the conversion to ePub go more smoothly.

Cheers,
Alan


--
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206              sip:address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]