-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latex output "too deeply nested" #777
Comments
From Anonymous on 2011-12-29 08:26:07+00:00 You will find really 100s of exercises available that will help you gain muscles and this can be done by doing bench presses, dead lifts or by utilizing hand weights. These workouts are the very best if this involves firming and strengthening the muscles. |
From kaiwa on 2012-07-18 12:31:15+00:00 +1 for using enumitem package |
From Martin Ortbauer on 2012-09-05 12:36:10+00:00 I encountered the same problem. did you or somebody already implement that? or did you find some workaround? |
From tonycpsu on 2012-09-05 14:49:20+00:00 I don't know of any workarounds other than lowering the number of nesting levels in my documents. I would love it if Sphinx could switch to using enumitem to get rid of this limit. |
From Nicolas M. Thiéry on 2013-08-29 15:12:46+00:00 +1 to using enumitem as well. We stumbled on this problem in Sage [1]: Probably a bit more work will actually be needed, for there seems to be a bug in the @listdepth incrementation/decrementation with Sphinx+enumitem: for a file which is not soo deeply nested (10 maybe?) but quite long, we actually need to use \setlistdepth{264} ! Cheers, |
From Nicolas M. Thiéry on 2014-06-13 08:36:59+00:00 I got annoyed because we now need to use To everyone here: does this fix your own compilation errors? To the sphinx devs: does this seem like a sensible change to do to sphinx.sty? |
From Nicolas M. Thiéry on 2014-06-13 09:16:52+00:00 I proposed a pull request for this on: https://bitbucket.org/birkenfeld/sphinx/pull-request/250/ |
Ping? Does using trivlist sound reasonable? |
This reverts commits 2820, 4afd1 and f5be. ReadTheDocs PDF builds fail with "! LaTeX Error: Too deeply nested.". Two of these errors are fixed by adding the LaTeX preamble: \usepackage{enumitem} \setlistdepth{10} But increasing the list depth to 1000 did not fix a third error. Monkeypatching the definition of Verbatim (from sphinx.sty) in the preamble also did not fix the error. sphinx-doc/sphinx#777 Monkeypatch: http://trac.sagemath.org/ticket/9107#comment:75 http://git.sagemath.org/sage.git/commit/?id=891c3fad654e89e6b96bcf8f79114f631c8b7bba
Resurrecting the discussion. Using |
yes using |
Use \trivlist in Sphinx Verbatim.
Patch use of quote environment by LaTeX writer to prevent increase of \@listdepth
Initially I thought from comment by @kiwifb the issue was with Verbatim, and I self-assigned to me. I fixed that but this only spares one level of nesting. Reading the whole thread I realized the issue was more general, related to lists. The package enumitem was mentioned, but the simplest would be to remove from LaTeX's |
No luck. I am doing a serial build to disentangle things and give you a clean output, that will take a little while. |
I can provide the log if necessary or any other files you may need. |
Thank you for trying PR #2624. Your project has no issue with |
well, my question was silly because you surely have earlier reported "too deeply nested". But perhaps there were other issues than the "too deeply nested" one. I don't see how |
Actually I probably should run a check with pure 1.4.3. That issue as been going on for a long time and I don't know how many people did try runs apart from me at this stage. |
Well that's interesting same error.
So we have moved from the nesting issue. Going with |
Same error when replacing list by trivlist in 1.4.3 so it must be something new. |
Thank you for reporting.
|
Getting the same However, the error occurs with Error context:
|
ah! sorry to everyone. This should be |
This is \list --> \trivlist replacement in Sphinx wrapper of original Verbatim from package fancyvrb. This gains one level for allowed location of a code-block in nested lists/quotes.
Allow code-blocks at maximal nesting depth of lists/quotes in LaTeX (which by default is 6), by patching fancyvrb's original Verbatim dealings. If code-block appears at nesting depth 6 and \@listvii (which is supposed to configure margins) exists, it will be used, else the \csname ... \endcsname in fancyvrb's \FV@ListNesting creates a \relax. This is second commit improving maximal depth for code-blocks in nested lists or quote blocks. It used to be 4, it is now at 6.
Reopening because b2be594 only addresses partially the issue. Together with PR #2651 when it will be merged, the situation with code-blocks will be that they are allowed at maximal nesting depth within lists/quotes. With latex defaults if no list package is loaded, this is 6 levels of nesting. Memo: by default latex allows 4 levels of enumerated lists, 4 levels of labeled lists, and 6 levels total of lists, inclusive of quotes, which also are a list in disguise in latex. Prior to b2be594 code-blocks however could happen only at max depth 4. Now 5, and PR #2651 will make this six. edit now merged into stable at 7fd7d29. Thus now code-blocks will be allowed at maximal depth from document class+list packages. But this does not lift the "4" max levels of either enumerated or labeled lists. |
Fix #777 (part Ia): Latex output "too deeply nested"
I am reopening for the same reason. 4a0b283 only fixes to the extent that code-blocks are now allowed at deepest level, but nothing is changed to LaTeX defaults regarding max nesting of lists and quotes. |
got hit by this issue while building sqlalchemy PDF doc. The following worked for me: \usepackage{enumitem}
\setlistdepth{20}
\renewlist{itemize}{itemize}{20}
% initially, use dots for all levels
\setlist[itemize]{label=$\cdot$}
\setlist[itemize]{labelsep=.5em}
% customize the first 3 levels
\setlist[itemize,1]{label=\textbullet}
\setlist[itemize,2]{label=--}
\setlist[itemize,3]{label=*} |
Patch use of quote environment by LaTeX writer to prevent increase of ``\@listdepth``. This is experimental and probably not good (Jun 5, 2016). Rebased on master at 0ad5420 (Oct 25, 2016).
Thanks for the tip. Loading I wanted to test this and I have an issue, I can't get it to work: \documentclass{article}
\usepackage{enumitem}
\setlistdepth{10}
\renewlist{itemize}{itemize}{10}
\setlist[itemize]{label=$\cdot$}
\setlist[itemize]{labelsep=.5em}
\setlist[itemize,1]{label=\textbullet}
\setlist[itemize,2]{label=--}
\setlist[itemize,3]{label=*}
\setlist[itemize,4]{label=*}
\begin{document}
%does NOT work! Package enumitem Error: Undefined label. (at level of \item e)
\begin{itemize}
\item a
\begin{itemize}
\item b
\begin{itemize}
\item c
\begin{itemize}
\item d
\begin{itemize}
\item e
\begin{itemize}
\item f
\end{itemize}
\end{itemize}
\end{itemize}
\end{itemize}
\end{itemize}
\end{itemize}
\end{document} Does your document really have 5 or more nested This is with |
I see your code snippet also here. However notice that the accepted answer explicitely sets the label at each level (in the case of enumerate). I checked the enumitem manual and the fact that my code snippet is not working does seem to contradict the manual. This is possibly a bug in package Memo: |
I got it just before posting a bug report to enumitem's author ! Your code should be with
and not with
It appears that the second use 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'``. _Only_ if it is set, sphinx.sty will do some hack to remove the LaTeX limitations.
PR #3096 addresses this without resorting to package |
Fix #777: (part II) LaTeX output "too deeply nested"
If Sphinx's LaTeX output gets too deeply-nested, I get the following error:
I've found an item on the Docutils to-do list:
http://docutils.sourceforge.net/docs/dev/todo.html
indicating that this is something they're aware of, but have not yet fixed, but I'm wondering if this is something Sphinx can work around in the mean time.
In particular, the LaTeX "enumitem" package:
http://www.tex.ac.uk/CTAN/macros/latex/contrib/enumitem/
has recently added support for list environments of any depth. I was wondering if Sphinx could make use of this package to allow nesting of chapters and code blocks to a higher number of levels, because when you start using code blocks with several levels of indentation, the nesting gets deep quickly, and standard LaTeX maxes out somewhere around 5-6 levels.
Could something like this work?
The text was updated successfully, but these errors were encountered: