2

First an MWS is as follows:

\documentclass{article}
\usepackage{lipsum}
\usepackage{amsthm}

\begin{document}
\begin{proof}
\lipsum[1]
\end{proof}

\end{document}

What I want is as in the picture:

enter image description here

Then how to define such a new proof environment?

3
  • You could do it with the ntheorem package, which defines a \theoremindent length.
    – Bernard
    Commented Sep 14, 2022 at 13:24
  • @Bernard But I use amsthm to set some other things.
    – M. Logic
    Commented Sep 14, 2022 at 13:25
  • Maybe there's a possibility in thmtools, which cooperates with amsthm as well as ntheorem?
    – Bernard
    Commented Sep 14, 2022 at 13:28

2 Answers 2

2

The standard proof of amsthm uses trivlist. It's not difficult to replace it with list with the appropriate \leftmargin.

\documentclass{article}
\usepackage{amsthm}

\usepackage{lipsum}

\makeatletter
\renewenvironment{proof}[1][\proofname]
 {%
  \par
  \pushQED{\qed}%
  \normalfont \topsep6\p@\@plus6\p@\relax
  \list{}{\leftmargin=3\parindent\labelwidth=\leftmargin}
  \item[\hskip\labelsep\itshape #1\@addpunct{.}\hfill]\ignorespaces
 }
 {%
  \popQED\endlist\@endpefalse
 }
\makeatother

\begin{document}

\noindent\rule{3\parindent}{1pt}% just to show the width of the indentation

\begin{proof}
\lipsum*[1][1-5]
\end{proof}

\begin{proof}
\lipsum*[1][1]
\begin{enumerate}
\item aaa
\item bbb\qedhere
\end{enumerate}
\end{proof}

\end{document}

enter image description here

As you see, the QED marker is in the right place (and you can use \qedhere in cases the automatic placement doesn't work, as usual).

Another advantage is that you can simply remove the code when you realize you're just wasting space.

1
  • In fact, I've tried similar ways to yours, but it brings about another problem. Do you any idea to the problem?
    – M. Logic
    Commented Sep 14, 2022 at 16:46
2

latexdef -p amsthm proof and latexdef -p amsthm endproof show that amsthm defines its proof environment like this:

\proof:
\long macro:[#1]->\par \pushQED {\qed }\normalfont \topsep 6\p@ \@plus 6\p@ \relax \trivlist \item [\hskip \labelsep \itshape #1\@addpunct {.}]\ignorespaces
\endproof:
\long macro:->\popQED \endtrivlist \@endpefalse

We can mimic the "Proof." part with a \makebox, and use a minipage for the proof's contents.

\NewCommandCopy\amsproof\proof
\NewCommandCopy\amsendproof\endproof
\makeatletter
\RenewDocumentEnvironment{proof}{+b}
{%
  \par\noindent\makebox[3\parindent][l]{\itshape\proofname\@addpunct{.}\ignorespaces}\hfill%
  \begin{minipage}[t]{\dimexpr\linewidth - 3\parindent\relax}
    \pushQED{\qed} #1
  \end{minipage}
}
{\popQED\@endpefalse}
\makeatother

enter image description here

Two problems:

  • The proof's contents won't span different pages, because they're all in a minipage.
  • The QED symbol is placed on a different line.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .