0

Consider the item "2-3)" in the "Complexity" list on http://en.cppreference.com/w/cpp/container/vector/vector. How could I achieve the same thing in reStructuredText/Sphinx?

The closest I got was writing

| 1) ...
| 2-3) ...
| 4) ...

but this destroys the list formatting (enumerators and split lines are not properly indented). Another option would be to use tables, but I don't want a table formatting.

gTcV
  • 2,446
  • 1
  • 15
  • 32

1 Answers1

0

Found the following workaround. Define your list as

.. rst-class:: custom-enumeration

==== ===
 \1) ...
2-3) ...
 \4) ...
==== ===

and add the following snippet to your CSS file.

/* Define enumerations with custom enumerators */
table.custom-enumeration td {
    border: 0px none;
}
table.custom-enumeration td:first-child {
    padding-right: 5px;
    text-align: right;
}
gTcV
  • 2,446
  • 1
  • 15
  • 32