2

Is there a tidy way to print solutions like there is for proofs? Something like the following but for solutions.

 \begin{proof}
   ...
 \end{proof}
Jack
  • 141
  • 1
  • 4
  • Should the solutions be numbered or unnumbered? Do you use a package such as either amsthm or ntheorem? – Mico Jan 16 '16 at 08:28
  • Not numbered. Just say "solution." Then solution begins and at the end has a white or black square. Preferably white to match \begin{proof}. – Jack Jan 16 '16 at 08:56

2 Answers2

2

(Modified the answer after the OP mentioned that he uses the amsthm package.)

I'm assuming that the solution environment shouldn't be numbered. If that's correct, and in view of the fact you appear to use the amsthm package, you could set up a solution-like environment, named soln, as follows in the preamble, after loading the amsthm package:

\theoremstyle{remark}
\newtheorem*{soln}{Solution}
Mico
  • 506,678
  • I tried your suggestion but it clashes with amsthm. I get the following error: Package ntheorem Error: Theorem style plain already defined. ...rfont ##1\ ##2\ (##3)\theorem@separator]} – Jack Jan 16 '16 at 08:48
  • My homework has both proofs and answers in it so I want to have some say "proof." in which I have been using amsthm, and I want some to say "solution." – Jack Jan 16 '16 at 08:50
2

Just duplicate proof:

\newenvironment{solution}
  {\begin{proof}[Solution]}
  {\end{proof}}

If you plan to have “variable” labels (say “Sketch of solution” in one of the uses), do

\newenvironment{solution}[1][Solution]
  {\begin{proof}[#1]}
  {\end{proof}}
egreg
  • 1,121,712
  • This worked after I used \renewenvironment because it said \solution was already defined. Thank you for your answer! – Jack Jan 16 '16 at 21:57