3

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?

Questions?

  • 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?

2

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

\documentclass{article}
\usepackage{tcolorbox}

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

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? – minthao_2011 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. – Fredrik Johansson Oct 9 '15 at 6:22
1

(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.