# How do I embed a gather environment within a custom environment?

I've tried defining the following custom environment, but I get errors:

\begin{gather} ended by \end{solution} etc...

Here's a MWE showing my problem:

\documentclass{article}

\usepackage[fleqn]{mathtools}

\newenvironment{solution}{%  <-Solution
\itshape{Solution:}\par\begin{gather}}

\begin{document}
\begin{gather}
testing
\end{gather}

%% This does not work:
\begin{solution}
testing
\end{solution}
\end{document}

-

Use the command-form of the gather environment. That is, \gather...\endgather instead of \begin{gather}...\end{gather}.

\documentclass{article}
\usepackage[fleqn]{mathtools}% http://ctan.org/pkg/mathtools
\newenvironment{solution}{%  <-Solution
\textit{Solution:}\par\gather}

\begin{document}
Some text
\begin{gather}
f(x)=ax^2+bx+c
\end{gather}
Some text
\begin{solution}
f(x)=ax^2+bx+c
\end{solution}
Some text
\end{document}


Ultimately I ended up using gather instead, but it works just the same... using \gather and \endgather. But I also wanted to find a way to get rid of the equation numbers. A bit of searching allowed me to find out that \align* and \endalign* do not work as expected, so instead you have to use \csname align*\endcsname and \csname endalign*\endcsname

-