Repository navigation
Fix #777: (part II) LaTeX output "too deeply nested" - #3096
Conversation
|
Tested with this source, allowing deepest level equal to 10 : (edited because original had an indentation error and in fact went to a quoted block at level 11, which did not raise a LaTeX error on compilation due to an off by one test in original commit, fixed since; also the image has been replaced because the key name was changed to Welcome to temp's documentation!
================================
Nesting lists
-------------
1. a
1. b
1. c
1. d
1. e
1. f
1. g
1. h
1. This should work (level 9)
and we can even go one level deeper (this is quoted)
- with a non-number list
.. code-block:: python
def foo(): # and a code block in it
- did it work ?
we used ``'maxlistdepth' : '10'``
- a
- b
- c
- d
- e
- f
- g
- h
1. This should work (level 9)
and we can even go one level deeper (this is quoted)
1. with a numbered list
.. code-block:: python
def foo(): # and a code block in it
2. did it work ?
we used ``'maxlistdepth' : '10'``which, with a4paper and edit: the |
|
Nothing from my side. |
The standard classes have a severe cap on maximal nesting of list-like environments (a total of six levels, and four for each of enumerate and itemize). This commit defines a new key ``'maxlistdepth'``. _Only_ if it is set (i.e. non-empty) will sphinx.sty do some hack to lift the LaTeX limitations and extend the maximal list depth to the desired value.
will facilitate adding options in the future, with a "key=value" syntax.
48079dd to
4470e7d
Compare
|
thanks @tk0miya! I have squashed all commits and added use of package "kvoptions" (which anyhow is already required by "hyperref"), to facilitate handling of "key=value" options if more are added in the future. This already streamlines my ad hoc handling of This could help user-styling of LaTeX via for example a single |
|
I wanted to add a root test, but there is nothing to check in LaTeX output, the test should do at least one |
a7b5efd to
4e2bdf6
Compare
|
merging now as testing looks ok. Projects using "enumitem" to circumvent the LaTeX default limitations will not be affected by this. New projects may use the novel key as a quick work-around, if needed. |
What check do you want to do? Viewing generated PDF? Checking logs of pdflatex? |
|
@tk0miya my question was more elementary: simply check that doing pdflatex once works; all the tests I checked in test_build_latex.py seem to be about verifying that the produced latex file contains something. But in the case of the input as in my comment #3096 (comment) and |
|
The I can make a helper function to invoke pdflatex if you want. |
|
@tk0miya thanks for explanation I now understand better. I made for experiment a branch https://github.com/jfbu/sphinx/tree/testtest to get
This is purely for me learning how it works. I agree we should be careful not to overload tests. |
|
I added About 1st case, Personally, I want to reduce the content of |

The standard classes have a severe cap on maximal nesting of list-like
environments (a total of six levels, and four for each of enumerate and
itemize). This commit defines a new key
'maxnestingdepth''maxlistdepth'. Only if it is set, sphinx.sty will do some hack to remove theLaTeX limitations.
Note: merged PR makes the key silently inoperative if package "enumitem"
is detected, so as to not change anything to projects already using "enumitem"
facilities.