jbezos / enumitem

Customize enumerate, itemize and description
MIT License
48 stars 5 forks source link

Interaction with `\listI` and top-level parameters #50

Closed sim642 closed 3 weeks ago

sim642 commented 2 months ago

I am porting an old document class, which uses low level customization of lists by redefining \@listi, etc, to use enumitem instead. However, I've had hard time getting the output to be identical.

Namely, what I eventually realized is that enumitem doesn't seem to do anything about \@listI, which is called by standard \normalsize. So, unless I keep its old low-level definition, or do the following

\def\@listI{
  \enit@setkeys{list}%
  \enit@setkeys{listi}%
}

Some use of \normalsize is calling the standard definition with standard list parameters, instead of those I've set using \setlist. Also, \setlist[trivlist] doesn't seem to help entirely.

Moreover, some packages like biblatex seem to assume top-level list parameter definitions like \itemsep. Standard classes seem to do that by expanding \@listi immediately after defining it. However, enumitem doesn't seem to have any way to change those? Again, \setlist[trivlist] doesn't seem to be enough for everything to come out identical.

It seems that enumitem only wants to redefine standard list types like itemize but not actually change the standard \@listi, etc. Am I correct that enumitem cannot thus completely replace the low level redefinitions? If so, why is that?

jbezos commented 1 month ago

Please, explain what you want to achieve, with an example.

sim642 commented 1 month ago

I want the enumitem equivalent of this:

\def\@listi{\leftmargin\leftmargini
              \labelwidth\leftmarginii
    \topsep   2\p@   \@plus  0.5\p@ \@minus0.5\p@
    \partopsep0.5\p@   \@plus0.5\p@   \@minus0.5\p@
    \parsep   1\p@   \@plus0.5\p@
    \itemsep  1\p@ \@plus0.5\p@ \@minus0.5\p@}
\let\@listI\@listi
\@listi

I tried this (which requires annoying duplication), but it's not equivalent:

\setlist[1]{
  leftmargin= \leftmargini,
  labelwidth=\leftmarginii,
  topsep=   2\p@   \@plus  0.5\p@ \@minus0.5\p@,
  partopsep= 0.5\p@   \@plus0.5\p@   \@minus0.5\p@,
  parsep=   1\p@   \@plus0.5\p@,
  itemsep=  1\p@ \@plus0.5\p@ \@minus0.5\p@
}
% also override trivlist for flushright, etc
\setlist[trivlist]{
  leftmargin= \leftmargini,
  labelwidth=\leftmarginii,
  topsep=   2\p@   \@plus  0.5\p@ \@minus0.5\p@,
  partopsep= 0.5\p@   \@plus0.5\p@   \@minus0.5\p@,
  parsep=   1\p@   \@plus0.5\p@,
  itemsep=  1\p@ \@plus0.5\p@ \@minus0.5\p@
}
jbezos commented 1 month ago

Thanks, but I’m interested in the ‘what’ (and the ‘why’), not in the ‘how’.

jbezos commented 3 weeks ago

I’m closing this issue because no further clarification was provided.