[Tex/LaTex] Margins for proof environment

indentationtheorems

The code below is (almost) the proof environment of amsthm:

\newenvironment{proof}[1][\proofname]%
{%
\par\pushQED{\qed}\normalfont\topsep6\p@\@plus6\p@\relax%
\trivlist\item[\hskip\labelsep\bfseries#1\@addpunct{.}]\ignorespaces%
}{%
\popQED\endtrivlist\@endpefalse%
}%

I know how to control the left indentation with a \hangindent but I would like to know how to control the rightmargin in a simple way?

Best Answer

Change

\trivlist\item[\hskip\labelsep\bfseries#1\@addpunct{.}]\ignorespaces

to

\begin{list}{}{\rightmargin=...\leftmargin=...}%
  \item[\hskip\labelsep\bfseries#1\@addpunct{.}]\ignorespaces

and add \end{list} instead of \endtrivlist to the end of your declaration