It would like to modify the proof environment of amsart in such a way that if a boolean variable, say solution is set to true in the preamble of the document, then the environment works as usual, but otherwise \begin{proof} content \end{proof} has no effect (i.e. is not printed). Is there a way to do this using etoolbox?

1 Answer 1


Not with etoolbox, but with comment:





  A proof that is typeset

  A proof that is removed

  Another proof that is typeset


enter image description here

  • Many thanks! Also, apologies, I have not made myself clear. The boolean variable is set in the preamble of the document.
    – 220284
    Jul 15, 2021 at 13:01
  • @220284 You're welcome! You can move \proofon and \proofoff to the preamble of the document. I put them in the middle just to show that they work Jul 15, 2021 at 13:02
  • Great, will give it a shot!
    – 220284
    Jul 15, 2021 at 13:03
  • Hm, if I put \proofoff in the preamble it works fine, but if I put \proofon it get the error that the proof environment is undefined.
    – 220284
    Jul 15, 2021 at 13:21
  • @220284 Indeed, \proofon assumed \proofoff was used somewhere. I edited my answer with a more robust version Jul 15, 2021 at 14:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .