Hi,
regarding list numbering
#. An Item
#. A Subitem
#. A subsub item
#. Another subsub item
#. Another sub item
(be careful about indentation)
then in _static/custom.css of your source repertory
the following contents
ol {
counter-reset: item;
}
ol > li {
counter-increment: item;
}
ol ol > li {
display: block;
}
ol ol > li:before {
content: counters(item, ".") ". ";
margin-left: -20px;
}
(copied over from https://stackoverflow.com/a/30326819/4184837)
It works for me for this html output specific approach
(tested with Sphinx 1.6.2 with alabaster 0.7.10,
should work with any earlier version of alabaster
obeying the automatic take-into-account of _static/custom.css)
For latex, you will need specific approach to configure
in a way analogous to html+css the list numbering
(add `\usepackage{enumitem}` to preamble and redefine
appropriately the enumerate environment following enumitem
documentation -- I can't help much more, because I am
not too familiar with it, use ``texdoc enumitem`` to access
documentation)
Jean-François
Le 20/06/2017 à 07:31, Kjetil Wormnes a écrit :
Thanks for the reply.
But when I do that I still get the same behaviour, namely:
[image: Inline images 1]
I.e. I dont get the subitem labelling that I am looking for, which would
have been something like this
1. An Item
1.1 A subitem
1.1.1 A subsub item
1.1.2 Another subsub item
1.2 Another sub item
Thanks
On 19 June 2017 at 22:28, Peter Burdine <[email protected]> wrote:
Since this is reST, you need to be careful with line numbers. To make
autonumbered sub-items, you just need use the normal auto number (#.), but
have blank lines and indentations around each level change, eg:
#. An Item
#. A Subitem
#. A subsub item
#. Another subsub item
#. Another sub item
Each time you indent to a new level, it gives you the next level of sub
items.
As for referring to a specific one, I don't know of an obvious/easy one.
A guess of a non-obvious one would be to declare a reST replacement node
that defines a new anchor, then include that inline with the item you want
(like trying to declare an inline image), then try to link to it (you can
try :numref: or :any:). But I don't think that will give you the item
number. Also, it maydepend on which version of Sphinx you are using.
1.4.x doesn't have a method to get the section number for headers, I think
that was added in 1.5.x. I'm not sure that extends to numbered lists as
well.
--Peter
On Sunday, June 18, 2017 at 11:35:13 PM UTC-7, kworm wrote:
Hi Daniele,
Thanks for the answer. You seem to indicate that it was in answer to my
second question, which was how to make sub-numbered list. I fail to see how
to do that though. The link you posted explains how I can create a list
like this
1. An item
1. A sub item
1. A sub sub item
2. Another sub sub item
2. Another sub item
2. Another item
but not how to get sub-numbers.
It did however, partially explain my other question which is how to link
to a list item. I.e. I can do so by putting the label at the right
indentation. It still does not include the number though which is what I
would like.
Thanks
On Thursday, 15 June 2017 17:42:56 UTC+10, daniele wrote:
2017-06-15 4:41 GMT+02:00 kworm <[email protected]>:
A second question is whether it is possible to create sub-numbered
lists.
Something that renders like this:
stackoverflow.com/questions/34450064/how-to-make-nested-list
s-with-automatic-numbering-in-sphinx
regards
--
Daniele
www.fugamatematica.blogspot.com
giusto!
nel verso
forse è perché non guardiamo le cose
Quando non ci capiamo,
--
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.