From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan L Tyree Subject: Re: [patch, ox] Unnumbered headlines Date: Sat, 09 Aug 2014 08:35:37 +1000 Message-ID: <53E550B9.5000601@gmail.com> References: <87lhqzyubg.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFslH-0002h7-0p for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 18:35:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFslC-0004Zy-U4 for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 18:35:46 -0400 Received: from mail-pd0-x22d.google.com ([2607:f8b0:400e:c02::22d]:48745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFslC-0004Yu-MT for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 18:35:42 -0400 Received: by mail-pd0-f173.google.com with SMTP id w10so7718839pde.32 for ; Fri, 08 Aug 2014 15:35:41 -0700 (PDT) In-Reply-To: <87lhqzyubg.fsf@gmx.us> 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@gnu.org Cc: rasmus@gmx.us 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:typhoon@iptel.org