# Define environment with two parts

I would like to define an environment having two parts, i.e.

 \begin{myenv}
some text
\nextpart{myenv}
some more
\end{myenv}


I think I could do this by exploring the definition of \begin, \end, and \newenvironment, but I wonder if somebody has already done so.

-
 We will need to know a bit more about what you want to achieve: I don't really see what the 'two parts' mean here. – Joseph Wright♦ Feb 27 at 9:03 – texenthusiast Feb 27 at 9:05 Maybe you could define you environment, and inside the definition, add a switch (\nextpart) that will change stuff in your environment (IMO, you do not need to repeat "myenv"). I think that the command \appendix work like that in the environment "document"... – Lionel MANSUY Feb 27 at 9:07 what type of features you would like the "\nextpart{} some more" have.eg bold,italic etc.. What is the differentiating feature between the two parts ? – texenthusiast Feb 27 at 9:13 Thank you all for your comments and suggestions. I was asking the question in general, but it arose when trying to do a "side-to-side text" environment. Concretely, I am typesetting a draft revision of the articles of association of some organisation, and in some parts, I want to present two versions side-to-side (people in the organisation have submitted contradictory amendments and we need to vote on this). So the two parts are the two conflicting versions, and they contain complex things (\par, \label, \ref, etc.) – YS1 Mar 2 at 19:18

I have done something similar; in my experience, it was an environment that has

1. a question
2. a proof / answer

Here's an example:

\documentclass{article}
\usepackage{amsthm}

\newcommand{\nextpart}{\end{quote}\begin{proof}}
\begin{quote}%
}{%
\end{proof}%
}

\begin{document}
Something to be quoted.
\nextpart
Something to be proven.
\end{document}


To my understanding, this is expanded to exactly

\begin{document}
\begin{quote}
Something to be quoted.
\end{quote}\begin{proof}
Something to be proven.
\end{proof}
\end{document}


Note that by using \renewcommand, this can be arbitrarily complex:

\documentclass{article}
\usepackage{amsthm}
\usepackage{amsmath}

\newcommand{\nextpart}{\end{quote}\begin{proof}%
\renewcommand{\nextpart}{\end{proof}\begin{itemize}%
\renewcommand{\nextpart}{\end{itemize}\begin{enumerate}%
\renewcommand{\nextpart}{\end{enumerate}$$% }}}}% As you can see, this can be arbitrarily complex % (just be careful of your braces!) \begin{quote}% }{%$$%
}

\begin{document}
Some normal text.
Something to be quoted.
\nextpart
Something to be proven.
\nextpart
\item one
\item two
\nextpart
\item enum a
\item enum b
\nextpart
\sum_0^\infty a_n := \lim_{n\to\infty}\sum_0^n a_n