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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill Powell Subject: Re: headline numbering in html export Date: Tue, 02 Feb 2010 09:12:42 -0500 Message-ID: <87zl3rzpyd.wl%bill@billpowellisalive.com> References: <4B67DF92.4040506@ifi.uio.no> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcJTS-0006HH-15 for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 09:11:26 -0500 Received: from [199.232.76.173] (port=49970 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcJTQ-0006H9-Kv for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 09:11:24 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcJTM-0001lR-Ll for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 09:11:24 -0500 Received: from billpowellisalive.com ([206.130.115.110]:47066) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NcJTL-0001kB-VZ for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 09:11:20 -0500 In-Reply-To: <4B67DF92.4040506@ifi.uio.no> 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: =?UTF-8?B?Ik1hcnRpbiBHLiBTa2rDpnZlbGFuZCI=?= Cc: emacs-orgmode@gnu.org Thanks for sharing this! I'm sure I'll find this useful. Bill Powell At Tue, 02 Feb 2010 09:17:22 +0100, Martin G. Skjæveland wrote: >=20 > Hi, >=20 > I thought I'd share some stuff I'm quite happy with so that others can=20 > enjoy it if it is good, and so that I can stop using or improve it if it = > is not so good! :) >=20 > I am writing a set of exercises for a course and publishing a chapter=20 > 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=20 > (week 2): >=20 > #+LATEX_HEADER: \setcounter{section}{1} >=20 > For the html export I could not find a similar easy setting, but then I=20 > found that css2 has introduced counters: >=20 > http://www.w3.org/TR/CSS2/generate.html#counters >=20 > So by adding the css stylesheet below, I can start my numbering for html = > in a similar fashion as for pdf export: >=20 > #+STYLE: >=20 >=20 > Thanks! > Martin >=20 > ---------------- >=20 > The stylesheet: >=20 > #+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) "."=20 > counter(subsubsection) " "; > } > #+end_src >=20 >=20 > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >=20