0

First an MWE and its output are as follows:

\documentclass{article}
\setlength{\parskip}{0.3\baselineskip}
\usepackage{lipsum}

\usepackage{amsthm}
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par%
    \normalfont
    \list{}{%
        \setlength{\partopsep}{\parskip}
        \setlength{\topsep}{0pt}
        \setlength{\leftmargin}{3\parindent}
        \setlength{\labelwidth}{\leftmargin}
    }
    \item[\hskip\labelsep\itshape #1\@addpunct{.}\hfill]\ignorespaces
}
{%
    \endlist\@endpefalse
}
\makeatother

\usepackage{enumitem}
\newlist{newenumerate}{enumerate}{1}
\setlist[newenumerate]{itemsep=\parskip,partopsep=\parskip,parsep=0pt,topsep=0pt,
    align=left,
    label={},labelwidth={0pt},labelsep={0pt},labelindent={0pt},
    itemindent=-1\parindent,leftmargin=1\parindent}

\begin{document}

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


\begin{proof}
\lipsum*[1][1-5]
\begin{newenumerate}
\item \lipsum*[2][1-5]
\item \lipsum*[3][1-5]
\end{newenumerate}
\end{proof}

\vspace*{2\baselineskip}
\begin{newenumerate}
\item \lipsum*[2][1-5]
\item \lipsum*[3][1-5]
\end{newenumerate}

\end{document}

enter image description here

As you see, I define a new proof environment similar to the answer. Also I define a newenumerate environment to get the result similar to that outside the proof. While when I put the newenumerate into the new proof environment, the indentation of the lines without the first one is not the same as the result outside the proof. The picture as follows further shows what I want.

enter image description here

So is there anyway to fix it? Thanks you.

7
  • Why did you change the parameters? I only changed \leftmargin, precisely in order to avoid this problem.
    – egreg
    Commented Sep 14, 2022 at 16:50
  • @egreg \setlength{\partopsep}{\parskip} \setlength{\topsep}{0pt} could help me improve the space before and after the proof.
    – M. Logic
    Commented Sep 14, 2022 at 16:53
  • I don't understand. Sorry. Anyway, if you're using a nonzero \parskip, you're on your own, I'm afraid. And what's the purpose of enumerate without a label?
    – egreg
    Commented Sep 14, 2022 at 16:56
  • The purpose of newenumerate without a label is to get the result outside the proof. Especially, the lines after the first one should indent one more \parindent than the first one.
    – M. Logic
    Commented Sep 14, 2022 at 17:07
  • What I want is the newenumerate acts the same as outside the proof when I put the newenumerate into the proof.
    – M. Logic
    Commented Sep 14, 2022 at 17:16

1 Answer 1

0

I solve the problem by defining a new length which has the same value as \parindent when defing newenumerate. While I don't know exactly why this works. (It may be related to the definition of \newenvironment or \renewenvironment?)

\documentclass{article}
\setlength{\parskip}{0.3\baselineskip}
\usepackage{lipsum}

\usepackage{amsthm}
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par%
    \normalfont
    \list{}{%
        \setlength{\partopsep}{\parskip}
        \setlength{\topsep}{0pt}
        \setlength{\leftmargin}{3\parindent}
        \setlength{\labelwidth}{\leftmargin}
    }
    \item[\hskip\labelsep\itshape #1\@addpunct{.}\hfill]\ignorespaces
}
{%
    \endlist\@endpefalse
}
\makeatother

\usepackage{enumitem}
\newlist{newenumerate}{enumerate}{1}
\newlength{\indentpar}
\setlength{\indentpar}{\parindent}
\setlist[newenumerate]{itemsep=\parskip,partopsep=\parskip,parsep=0pt,topsep=0pt,
    align=left,
    label={},labelwidth={0pt},labelsep={0pt},labelindent={0pt},
    itemindent=-\indentpar,leftmargin=\indentpar}

\begin{document}


\begin{proof}
\begin{newenumerate}
\item \lipsum*[2][1-5]
\item \lipsum*[3][1-5]
\end{newenumerate}
\end{proof}

\end{document}

enter image description here

1
  • @egreg I solve the problem accidentally.
    – M. Logic
    Commented Sep 16, 2022 at 14:07

You must log in to answer this question.

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