When \item is inside a theorem-type environment, but not inside an enumerate or itemize environment, LaTeX does not give an error. Is there a way to make compiling stricter so that one receives an error when this happens?
Here is a minimal working example:
\documentclass{amsart}
\usepackage{enumitem}
\theoremstyle{plain}
\newtheorem{lemma}{Lemma}
\begin{document}
\begin{lemma}
Hello
\item abcd
\item This compiles without error.
\end{lemma}
\end{document}
Here is the version of TeX that I'm using, if it's important:
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex
restricted \write18 enabled.
entering extended mode
Processing: test.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-22>
enumerate,itemize, anddescriptionenvironments -- in terms of the very-low-levellistandtrivlistenvironments. That's why placing an\iteminstruction inside atheoremorlemmaenvironment doesn't cause an error. What you're asking for basically amounts to a major re-write of large parts of the LaTeX kernel. – Mico Mar 18 '23 at 19:18