Changing section numbering in HTML and Latex

294 views
Skip to first unread message

Gaël Varoquaux

unread,
Aug 23, 2011, 10:47:24 AM8/23/11
to sphin...@googlegroups.com
Hi there,

I have a biggish document written in Sphinx (yeah go go go Sphinx!):
http://scipy-lectures.github.com/

It has 'parts', and chapters below them, as you can see from the above page.

So far the parts where just implemented as an extra layer of headers. The problem is that it induces a heavily nested structured, with section numbers such as 2.1.1.2.1.

I'd like to:

Either insert titles in the middle of the toc, as it is currently the case on http://scipy-lectures.github.com/. These would act as part separators. It tried by putting two toctree one after the other, but the number starts again at 1 in each new toc.

Either change the number on the parts to be capital alphabetic characters, as in "A.1.1.2.1".

Any suggestions on how to achieve similar goals?

Cheers,

Gaël

Guenter Milde

unread,
Aug 31, 2011, 5:30:02 AM8/31/11
to sphin...@googlegroups.com

> I'd like to:

The rst "sectnum" directive has options for the start number and a number
prefix.

I don't know, how this interacts with Sphinx document merging, though.

http://docutils.sf.net/docs/ref/rst/directives.html#automatic-section-numbering


Also, the Docutils LaTeX writer has a

--use-part-section Add parts on top of the section hierarchy.

config setting, that in connection with

--no-section-numbering Disable section numbering by Docutils.
(i.e. enable numbering by LaTeX)

will use \part for the top section level.

Again, I don't know how this works out in Sphinx.

Günter

Reply all
Reply to author
Forward
0 new messages