According to Leslie Lamport in his 1985 book "LaTeX user's guide and reference manual" the macros \begin... \end form a group whereby code within the group is not visible from outside it. Any code redefinitions are local to the \begin \end grouping. I have found a problem with this.
% epigraphprob.tex SE 558448
\documentclass{report}
\usepackage{epigraph}
\begin{document}
\epigraph{text}{source} % first epigraph
%...
%{
\begin % local redefinitions
\setlength{\epigraphwidth}{0.7\textwidth} % make it wider
% other changes
\epigraph{text2}{source2} % second epigraph
\end % forget local redefinitions
%}
%...
\epigraph{text3}{source3} % third epigraph typeset as per first epigraph
%...
\end{document}
The above MWE fails with the message "! LaTeX Error: Environment u n\relax defined".
If I replace \begin ... \end with { ... } then it works.
Anybody got any idea what causes this mismatch and how to fix it?
The question was not a joke or a troll. On page 27 of his book Lampert says:
The scope of a declaration is ended by an
\endcommand or a right brace. In the input, braces and\beginand\endcommands must come in matched pairs. The scope of a declaration is ended by the first\endor}whose matching\beginor{precedes the declaration.
No mention of the commands taking an argument.
I had vague memories of there being simple commands which enclosed a declaration.
Mico suggested \begingroup with \endgroup or \bgroup with \egroup. Both of these pairings worked with one requiring less typing than the other. There was no mention of these in Lamport.
I'm getting old and forgetfull but I should have read Lamport more carefully and then looked at other documents but even the LaTeX Companion barely mentions them except in regard to problems and error messages. GOM.
\begin{\setlength}matched with\end{\epigraph}so it's not surprising that you get weird low level errors. – David Carlisle Aug 17 '20 at 20:03\begingroupand\endgroup(or maybe\bgroupand\egroup), not blank\beginand\end. – Mico Aug 17 '20 at 20:23