fix test of current listdepth which was too permissive by one unit

This commit is contained in:
jfbu 2016-10-26 19:07:44 +02:00
parent 4470e7d565
commit 787fffd25f

View File

@ -1011,11 +1011,11 @@
\providecommand*{\sphinxtheindex}{\theindex} \providecommand*{\sphinxtheindex}{\theindex}
% remove LaTeX's cap on nesting depth. This is a hack, intrinsically % remove LaTeX's cap on nesting depth. This is a hack, intrinsically
% fragile, but it works with the standard classes. It is executed only % fragile, which works with the standard classes: it assumes \@toodeep
% if 'maxlistdepth' key from latex_elements is used. % is always used in "true" branches: "\if ... \@toodeep .. \else .. \fi."
% It is executed only if 'maxlistdepth' key from latex_elements is used.
% this hack assumes \@toodeep always immediately followed by \else % The effect of this is to force use the "false" branch (if there is one)
% its effect is to force use the \else branch
\def\spx@toodeep@hack{\fi\iffalse} \def\spx@toodeep@hack{\fi\iffalse}
% default is to change nothing % default is to change nothing
@ -1023,10 +1023,10 @@
\AtBeginDocument{% \AtBeginDocument{%
\let\spx@toodeepORI\@toodeep \let\spx@toodeepORI\@toodeep
\def\@toodeep{% \def\@toodeep{%
\ifnum\@listdepth>\spx@opt@maxlistdepth\relax \ifnum\@listdepth<\spx@opt@maxlistdepth\relax
\expandafter\spx@toodeepORI
\else
\expandafter\spx@toodeep@hack \expandafter\spx@toodeep@hack
\else
\expandafter\spx@toodeepORI
\fi}% \fi}%
% define all missing \@list... macros % define all missing \@list... macros
\count@\@ne \count@\@ne