I want to put the \begin{sol} and \end{sol} from the answers package in a macro like
\newcommand{\assignment}[2]
{
\item #1
\begin{sol} #2 \end{sol}
}
###
\assignment{question}{answer}
It's just that answers use a verbatim environment that makes it miss the \end{sol} if it isn't written in the 'main' function.
Is there any way to use the \expandafter,\csname or such commands to let it just print the \begin{sol} #2 \end{sol} and then expand it after it has been printed in the main document?
`to mark your inline code as I did in my edit. – egreg Jul 29 '11 at 9:10