|
|
|
|
|
|
|
\ProvidesPackage{sphinxlatexlists}[2021/12/20 lists] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\newtoks\spx@lineitemlabel |
|
\long\def\sphinx@gobto@sphinxlineitem#1\sphinxlineitem{} |
|
|
|
|
|
|
|
|
|
\newcommand\sphinxlineitem[2]{ |
|
|
|
\sphinx@gobto@sphinxlineitem#2\@gobbletwo\sphinxlineitem\unless |
|
\iftrue |
|
|
|
|
|
\spx@lineitemlabel\expandafter{\the\spx@lineitemlabel\strut#1\\} |
|
\else |
|
|
|
|
|
|
|
\item[\kern\labelwidth\kern-\itemindent\kern-\leftmargin |
|
{\parbox[t]{\dimexpr\linewidth+\leftmargin\relax}{ |
|
\raggedright |
|
\the\spx@lineitemlabel |
|
\strut#1}} |
|
|
|
\kern-\labelsep] |
|
\spx@lineitemlabel{} |
|
|
|
|
|
\leavevmode |
|
\fi #2 |
|
} |
|
|
|
|
|
\newcommand\sphinxsetlistlabels[5] |
|
{ |
|
|
|
|
|
|
|
\@namedef{the#2}{#1{#2}} |
|
\@namedef{label#2}{#4\@nameuse{the#2}#5} |
|
\@namedef{p@#3}{\@nameuse{p@#2}#4\@nameuse{the#2}#5} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\def\spx@toodeep@hack{\fi\iffalse} |
|
|
|
|
|
\ifnum\spx@opt@maxlistdepth=\z@\expandafter\@gobbletwo\fi |
|
\AtBeginDocument{ |
|
\@ifpackageloaded{enumitem}{\remove@to@nnil}{} |
|
\let\spx@toodeepORI\@toodeep |
|
\def\@toodeep{ |
|
\ifnum\@listdepth<\spx@opt@maxlistdepth\relax |
|
\expandafter\spx@toodeep@hack |
|
\else |
|
\expandafter\spx@toodeepORI |
|
\fi} |
|
|
|
\count@\@ne |
|
\loop |
|
\ltx@ifundefined{@list\romannumeral\the\count@} |
|
{\iffalse}{\iftrue\advance\count@\@ne} |
|
\repeat |
|
\loop |
|
\ifnum\count@>\spx@opt@maxlistdepth\relax\else |
|
\expandafter\let |
|
\csname @list\romannumeral\the\count@\expandafter\endcsname |
|
\csname @list\romannumeral\the\numexpr\count@-\@ne\endcsname |
|
|
|
\ltx@ifundefined{leftmargin\romannumeral\the\count@} |
|
{\expandafter\let |
|
\csname leftmargin\romannumeral\the\count@\expandafter\endcsname |
|
\csname leftmargin\romannumeral\the\numexpr\count@-\@ne\endcsname}{} |
|
\advance\count@\@ne |
|
\repeat |
|
|
|
\count@\@ne |
|
\loop |
|
\ltx@ifundefined{c@enum\romannumeral\the\count@} |
|
{\iffalse}{\iftrue\advance\count@\@ne} |
|
\repeat |
|
\loop |
|
\ifnum\count@>\spx@opt@maxlistdepth\relax\else |
|
\newcounter{enum\romannumeral\the\count@} |
|
\expandafter\def |
|
\csname labelenum\romannumeral\the\count@\expandafter\endcsname |
|
\expandafter |
|
{\csname theenum\romannumeral\the\numexpr\count@\endcsname.} |
|
\expandafter\def |
|
\csname p@enum\romannumeral\the\count@\expandafter\endcsname |
|
\expandafter |
|
{\csname p@enum\romannumeral\the\numexpr\count@-\@ne\expandafter |
|
\endcsname\csname theenum\romannumeral\the\numexpr\count@-\@ne\endcsname.} |
|
\advance\count@\@ne |
|
\repeat |
|
|
|
\count@\@ne |
|
\loop |
|
\ltx@ifundefined{labelitem\romannumeral\the\count@} |
|
{\iffalse}{\iftrue\advance\count@\@ne} |
|
\repeat |
|
\loop |
|
\ifnum\count@>\spx@opt@maxlistdepth\relax\else |
|
\expandafter\let |
|
\csname labelitem\romannumeral\the\count@\expandafter\endcsname |
|
\csname labelitem\romannumeral\the\numexpr\count@-\@ne\endcsname |
|
\advance\count@\@ne |
|
\repeat |
|
\PackageInfo{sphinx}{maximal list depth extended to \spx@opt@maxlistdepth} |
|
\@gobble\@nnil |
|
} |
|
|
|
\endinput |
|
|