When creating environments based on list I have seen two implementations:
\documentclass{report}
\newenvironment{examplea}{%
\begin{list}{}{% stuff here
}}
{\end{list}}
\newenvironment{exampleb}{%
\list{}{% stuff here
}}
{\endlist}
\begin{document}
\begin{examplea}
\item bla
\end{examplea}
\begin{exampleb}
\item bla
\end{exampleb}
\end{document}
They both seem to be behaving the same way. In comments here it is recommended not to use \list and \endlist in the wild ... but that leaves unanswered the question about their difference.
What is the difference in using \list vs. \begin{list} and \endlist vs. \end{list}?
Are there contexts where I should not use \begin{list} and \end{list}, for instance?
\beginsets\@currenvirand\endchecks it; hence the error message "\begin{list} was ended by \end{document}" (for example). There was a time I worried about nesting environments before I realized that\@currenvirwas being stored locally in nested groups. – John Kormylo Jun 12 '22 at 03:16begin...endformat? – jan Jun 12 '22 at 03:42\beginand\endhave changed in the LaTeX kernel since Martin Scharrer wrote this answer. If you don't call them for the inner environment, its\BeforeBeginEnvironment,\AtBeginEnvironment,\AtEndEnvironmentand\AfterEndEnvironmenthooks won't be run! AFAIK, the hooks were added in 2020; seetexdoc lthooks. – frougon Jun 12 '22 at 08:41