[Tex/LaTex] Use of \trivlist and \list in defining environments

latex-base

I did ask a similar question a bit back here but never really had a satisfactory technical answer. Reading through the documentation of xdoc Lars Hellstrom pretty much asked the same question and noted in a footnote (page 47),

Seriously, can someone explain to me why it seems just about every
non-math LaTeX environment that doesn’t start a \list starts a
\trivlist? What good does all these \trivlists do?

Is it (a) that people just like the basic design, (b) that there’s
some deep technical reason, or (c) that people in general doesn’t have
a clue but all other environments do that so it’s best to include it
just in case?

Can someone explain the technical reasons for adopting such a design and the alternatives?

Best Answer

Using \list (or \trivlist) for a display enviornment makes it a lot easier to handle things that are trickier to get right (or at least get like the rest of LaTeX) otherwise.

In particular:

the code to handle how space is combined if one display environment immediately follows another;

the code that detects whether the text following the environment is to be set as a new paragraph or a continuation of the previous one;

The code to adjust the left and right margins in a way that flags to any nested list environments which margins to use.

None of the code for these things is impossibly difficult, but....