emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] headline numbering in html export


From: Bill Powell
Subject: Re: [Orgmode] headline numbering in html export
Date: Tue, 02 Feb 2010 09:12:42 -0500
User-agent: Wanderlust/2.15.7 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

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:
> 
> 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: <style>h1{counter-reset:section 1;}</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
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 




reply via email to

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