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?

  • 1
    see https://www.ctan.org/tex-archive/macros/latex/contrib/answers or https://www.ctan.org/tex-archive/macros/latex/contrib/exam – touhami Sep 09 '15 at 11:25
  • Have a look at the packages exsheets, answers, probsoln, exam... – cgnieder Sep 09 '15 at 11:31
  • related: http://tex.stackexchange.com/q/22269/ (sadly this question and its answers don't cover exsheets, but…) – cgnieder Sep 09 '15 at 11:55
  • @clemens: Shamelessly promoting your own package :-P –  Sep 09 '15 at 12:49
  • @ChristianHupfer in a way :) Promoting own packages actually is counterprodutive: the more people use it the more people mail you for support. This is the reason why I always mention alternatives – cgnieder Sep 09 '15 at 12:56

2 Answers2

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 09 '15 at 01: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 09 '15 at 06: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.