[Tex/LaTex] Problem Solution Template

exercises

I want to create a Latex document like the following one:

1. This is the problem statement in 
multiple line.

Solution:
This is the solution of the problem. When there is only on
solution, there is no need to numbering

2. This is another problem but two solution
multiple line.

Solution 1:
This is the first solution of the problem

Solution 2:
This is the second solution.

What do you suggest?

PS: I'm not very familier with TeX environment.

Best Answer

I produced a format, as given in your question. Obviously, one can gussie-up the definitions to achieve a more aesthetically pleasing format. EDITED to give usage syntax desired by questioner.

\documentclass{article}

\newcounter{problem}
\newcounter{solution}

\newcommand\Problem{%
  \stepcounter{problem}%
  \textbf{\theproblem.}~%
  \setcounter{solution}{0}%
}

\newcommand\TheSolution{%
  \textbf{Solution:}\\%
}

\newcommand\ASolution{%
  \stepcounter{solution}%
  \textbf{Solution \thesolution:}\\%
}
\parindent 0in
\parskip 1em
\begin{document}
\Problem This is the problem statement in multiple line. This is the
problem statement in multiple line. This is the problem statement in
multiple line.

\TheSolution This is the solution of the problem. When there is only on
solution, there is no need to numbering.

\Problem This is another problem but two solution multiple line. This is
another problem but two solution multiple line. This is another problem
but two solution multiple line.

\ASolution This is the first solution of the problem

\ASolution This is the second solution.

\end{document}

enter image description here

Related Question