emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Numbering only *some* subheadings?


From: Christian Moe
Subject: Re: [O] Numbering only *some* subheadings?
Date: Thu, 30 Apr 2015 09:50:48 +0200
User-agent: mu4e 0.9.9.5-dev6; emacs 24.4.1


You can do the opposite and number only the topmost headings, e.g. with

#+OPTIONS: num:1

but I don't think Org has a way to number only sub-headings. In HTML
export, you can get there with CSS hacks. For the exact example you
gave,

#+HTML_HEAD: <style>.section-number-2 {display: none;}</style>

should hide heading numbering for the top heading level (add
more CSS if you have more heading levels). It won't fix the TOC, though;
with numbered headline export, the numbers are hardcoded in the TOC.

You could export without heading numbering, and add numbering to both
headlines and TOC items with CSS, but it's more involved. Again, for
your simple example you could do something like this.

#+OPTIONS: num:nil
#+HTML_HEAD: <style>h3::before {counter-increment: subheadnum; 
#+HTML_HEAD:                    content: counter(subheadnum) ". "}
#+HTML_HEAD:        h2 {counter-reset: subheadnum}
#+HTML_HEAD:        #text-table-of-contents ul ul {list-style-type: 
decimal}</style>

Yours,
Christian



Matt Price writes:

> I would like to number only a single subset of subheadings in an html
> export, so that, e.g.,
>
> * Introduction
> lorem ipsum
> * Coiurse Requirements
> lorem ipsum
> * Course Outline
> ** Introduction
> some long multi paragraph text.
> ** Origins of the French Revolution
> more text. Readings.
> ** Liberty, Equality, Fraternity?
> ... etc
>
> becomes:
>
> Introduction
>
> Course Requirements
>
> Course Outline
>
> 1. Introduction
> bla bla bla
> 2. Origins of hte French Revolution
> bla bla bla.
> Readings:  bla bla bla
> 3. Liberty, Eaquality, Fraternity
>
> ... etc
>
> Is this possible? Anyone have a suggestion?
>
> Thanks as always,
> Matt




reply via email to

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