I want to typeset my problems and solutions in my coursework. How do you do that keeping in mind that I want both the problem and the solution typeset?


  • What should I use/how to separate the problem statement/question and my solution? (important)

  • Does anyone have some really great templates/examples for me?


Whenever I want questions and answers in close proximity of each other I tend to use tcolorbox.


\begin{tcolorbox}[title=Question and Answer]
  This is the question
  This is the answer

With tcolorbox it's easy to control many aspects of the upper and lower parts of the box (colors, borders, separators, sizes etc...) which is something I like a lot. I would suggest a look into the manual as well as the examples document at ctan

  • Can your style add in theorem environment? Oct 9 '15 at 1:34
  • 1
    @minthao_2011 : You may want to read ch 14 of the tcolorbox manual, "Library theorems", but the short answer is yes. The longer and more correct answer would probably be - it depends on how you want to use it. Oct 9 '15 at 6:22

(I wanted to comment this since it's a shameless plug, but I don't have enough reputation to comment yet.)

[Self-promotion warning] I recently wrote a class for doing exactly what you want! You can find it on GitHub here. Documentation and examples are included there as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.