[Tex/LaTex] environment – solution environment for exercises (different than proof environment)


I am typing up solutions to a variety of problems in a textbook, and I want to use the proof environment for proofs but a similar environment for solutions. The link here

Duplicating the amsthm proof environment

shows how I can make my own solution environment, but I want the indication for the end of a solution to be slightly different than that of a proof. I'd like solutions to end with the QED as \blackbox whereas I want the proof environment to stay as it is (white box to indicate QED). Is there an easy way to make this happen?

Best Answer

You also can do that very simply with ntheorem. Its advantage is an automatic placement of endmarks even if the environment ends in a display math environment:


\usepackage[thmmarks, amsmath, thref]{ntheorem}

\theoremseparator{. ---}
\newtheorem{varsol}{Solution (variant)}


    \begin{proof}Since something is true, we have
      \[ A = B. \]

    \begin{solution}[of some exercise]
      This is a very intricate solution.
        a & = b \\ c & = d.

      This solution is so very simple that it’s not even worth writing it. Just pure thought:

enter image description here

Related Question