4

While defining an environment <env> also defines the \<env> and \end<env> declarations, what are the circumstances where defining those declarations directly (without defining an environment) is preferable?

I see the following use where \proof and \endproof are defined separately in the informs3 document class file:

%% Use for proper proofs that end with extra space (regardless of the use
%% or non-use of \qed (=the black box)
\def\proof#1{\Trivlist\item[\hspace*{1em}\hskip\labelsep{\it #1\enskip }]\ignorespaces}
\def\endproof{\endTrivlist\addvspace{0pt}}

Is there any reason not to do \newenvironment{proof}[1]{...}{...} instead?

3
  • 2
    I'm always amazed when journal styles reinvent the wheel, making it worse than the available models. – egreg Nov 17 '18 at 16:43
  • @egreg Totally. – Fang Jing Nov 17 '18 at 17:07
  • 1
    There are pieces of code which you can use both in LaTeX as \begin{envname}..\end{envname} and, e.g., in plain-TeX (, where you neither have LaTeX 2e's \newenvironment-command nor have LaTeX 2e's environment-mechanism,) as \envname..\endenvname. – Ulrich Diez Nov 18 '18 at 11:23
5

\newenvironment other than checking that the name is "safe" to define does nothing different to the \def forms that you show (apart from using \long\def unless the * form is used).

Especially in older code you will often see the lower level form, going back to when it could take several minutes to load a style file and not doing the checks in often used but unchanging definitions was a useful saving.

1
  • I realize I can actually do \begin{proof}{Proof.} It's obvious. \end{proof}. – Fang Jing Nov 17 '18 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.