I use amsthm to define a "Solution" environment. I want to be able to hide it. Following this comment I tried using the comment package:
\documentclass{article}
\usepackage{amsthm}
\newtheorem*{solution*}{Solution}
\usepackage{comment}
\excludecomment{solution*}
\begin{document}
Foo
\begin{solution*}
Bar
\end{solution*}
Baz
\end{document}
However this doesn't work because my solution environment is indented and the comment package requires
The opening and closing commands should appear on a line of their own. No starting spaces, nothing after it.
So my question is: how can I hide an indented solution environment defined with amsthm?