From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?=22Martin_G=2E_Skj=E6veland=22?= Subject: headline numbering in html export Date: Tue, 02 Feb 2010 09:17:22 +0100 Message-ID: <4B67DF92.4040506@ifi.uio.no> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcDuw-0006RJ-ED for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 03:15:26 -0500 Received: from [140.186.70.92] (port=43625 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcDuu-0006Q2-WB for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 03:15:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NcDut-0003YF-Lt for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 03:15:24 -0500 Received: from mail-out2.uio.no ([129.240.10.58]:58322) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NcDut-0003Y7-4L for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 03:15:23 -0500 Received: from mail-mx3.uio.no ([129.240.10.44]) by mail-out2.uio.no with esmtp (Exim 4.69) (envelope-from ) id 1NcDuq-0006YZ-QL for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 09:15:20 +0100 Received: from 1x-193-157-204-137.uio.no ([193.157.204.137]) by mail-mx3.uio.no with esmtpsa (TLSv1:AES256-SHA:256) user martige (Exim 4.69) (envelope-from ) id 1NcDuq-0002U9-F0 for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 09:15:20 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, I thought I'd share some stuff I'm quite happy with so that others can enjoy it if it is good, and so that I can stop using or improve it if it is not so good! :) I am writing a set of exercises for a course and publishing a chapter once a week in both pdf and html. I like having the exercises for week 2 start the headline numbering with 2 (and so on), so for the latex export I set the section counter to the appropriate value, in this example (week 2): #+LATEX_HEADER: \setcounter{section}{1} For the html export I could not find a similar easy setting, but then I found that css2 has introduced counters: http://www.w3.org/TR/CSS2/generate.html#counters So by adding the css stylesheet below, I can start my numbering for html in a similar fashion as for pdf export: #+STYLE: Thanks! Martin ---------------- The stylesheet: #+begin_src css :tangle exercises.css /* Do not display numbering entered by org-mode, but use css2 counters instead. */ .section-number-2, .section-number-3, .section-number-4, .section-number-5 { display: none; } h2 { counter-reset:subsection; } h2:before { counter-increment:section; content:counter(section); } h2.footnotes:before { content:""; } h3 { counter-reset:subsubsection; } h3:before { counter-increment:subsection; content:counter(section) "." counter(subsection) " "; } h4:before { counter-increment:subsubsection; content:counter(section) "." counter(subsection) "." counter(subsubsection) " "; } #+end_src