From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Lomov Subject: Re: Change section (headings) numbering style Date: Tue, 14 Jan 2014 21:43:59 +0900 Message-ID: <20140114124359.GA898@smoon> References: <52D4F70E.1000803@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W33Lo-0004hC-PL for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 07:44:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W33Lg-0003FI-BG for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 07:44:12 -0500 Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:46456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W33Lg-0003F8-3I for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 07:44:04 -0500 Received: by mail-lb0-f181.google.com with SMTP id z5so3936700lbh.26 for ; Tue, 14 Jan 2014 04:44:02 -0800 (PST) Received: from smoon ([109.248.111.165]) by mx.google.com with ESMTPSA id z3sm337973lag.10.2014.01.14.04.44.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2014 04:44:01 -0800 (PST) Content-Disposition: inline In-Reply-To: <52D4F70E.1000803@mac.com> 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 Hello, ** Axel E. Retif [2014-01-14 02:36:30 -0600]: > Greetings! > I need to change the numbering style of the first level sections (*) in the > exported html file. > Right now they are exported as > 1 First section ;; for * First section > 1.1 First subsection ;; for ** First subsection > etc. > For the first part of the document that's all right, but for the next part I > need > A First new section ;; for * First new section > A.1 First new subsection ;; for ** First new subsection > and so on. > I've tried with different combinations of #+ATTR_HTML and #+OPTIONS with > section-number-2 with no success. I can suggest CSS way to accomplish this. I checked that it works with firefox, but not sure for other browsers. Minimal Org example: #+BEGIN_SRC org #+TITLE: An example ,#+OPTIONS: num:nil ,#+HTML_HEAD_EXTRA: ,* This is title on top level Text for document body. ,** Title for subtop level Text for body of subtop level. ,* This is title of next top level heading Text text text. ,** Title of second order Text text text. #+END_SRC Additional CSS #+BEGIN_SRC css body { counter-reset: level; } #table-of-contents > h2:before { content: normal; counter-increment: level; } h2:before { content: counter(level, upper-latin) " "; counter-increment: level; } h2 { counter-reset: sublevel; } h3:before { content: counter(level, upper-latin) "." counter(sublevel) " "; counter-increment: sublevel; } #+END_SRC Note, that use have to turn off 'automatic' numbering when exporting from Org, this is because export routine inserts numbers 'by-hand' don't relying on CSS (imho, not bad because there are browsers that don't support CSS, but it would be great to have option to switch this on/off). Second, in example only headings of two levels (top, subtop) will have desired format. --- WBR, Vladimir Lomov -- The difference between the right word and the almost right word is the difference between lightning and the lightning bug. -- Mark Twain