@@ -338,20 +338,31 @@ def _check_dependencies():
338
338
% One line per author on title page
339
339
\DeclareRobustCommand{\and}%
340
340
{\end{tabular}\kern-\tabcolsep\\\begin{tabular}[t]{c}}%
341
- % In the parameters section, place a newline after the Parameters
342
- % header. (This is stolen directly from Numpy's conf.py, since it
343
- % affects Numpy-style docstrings).
344
341
\usepackage{expdlist}
345
342
\let\latexdescription=\description
346
343
\def\description{\latexdescription{}{} \breaklabel}
347
-
348
- % The enumitem package provides unlimited nesting of lists and
349
- % enums. Sphinx may use this in the future, in which case this can
350
- % be removed. See
351
- % https://bitbucket.org/birkenfeld/sphinx/issue/777/latex-output-too-deeply-nested
352
- \usepackage{enumitem}
353
- \setlistdepth{2048}
344
+ % But expdlist old LaTeX package requires fixes:
345
+ % 1) remove extra space
346
+ \usepackage{etoolbox}
347
+ \makeatletter
348
+ \patchcmd\@item{{\@breaklabel} }{{\@breaklabel}}{}{}
349
+ \makeatother
350
+ % 2) fix bug in expdlist's way of breaking the line after long item label
351
+ \makeatletter
352
+ \def\breaklabel{%
353
+ \def\@breaklabel{%
354
+ \leavevmode\par
355
+ % now a hack because Sphinx inserts \leavevmode after term node
356
+ \def\leavevmode{\def\leavevmode{\unhbox\voidb@x}}%
357
+ }%
358
+ }
359
+ \makeatother
354
360
"""
361
+ # Sphinx 1.5 provides this to avoid "too deeply nested" LaTeX error
362
+ # and usage of "enumitem" LaTeX package is unneeded.
363
+ # Value can be increased but do not set it to something such as 2048
364
+ # which needlessly would trigger creation of thousands of TeX macros
365
+ latex_elements ['maxlistdepth' ]= '10'
355
366
latex_elements ['pointsize' ]= '11pt'
356
367
357
368
# Documents to append as an appendix to all manuals.