I am typesetting a problem-answer style math book. I have not decided on the final "look" (styles with respect to headers, etc.). Right now, one of my main concerns is to be as flexible as possible, so that the final look can be styled just by fiddling with initial settings with respect to whatever. (Rather than going over the whole work and manually changing one by one.)
Mainly I have chapters and in each chapter "Problem #N", followed by "Solution #N". I do not know whether it was the correct decision or not, but initially I decided on:
\newtheoremstyle{problemstyle} % <name>
{12pt} % <space above>
{12pt} % <space below>
{\normalfont} % <body font>
{} % <indent amount}
{\bfseries} % <theorem head font>
{\normalfont\bfseries:} % <punctuation after theorem head>
{.5em} % <space after theorem head>
{} % <theorem head spec>
\theoremstyle{problemstyle}
\newtheorem{problem}{Problem}[chapter] % Comment out [section] to remove section number dependence
\newtheoremstyle{solutionstyle} % <name>
{12pt} % <space above>
{12pt} % <space below>
{\normalfont} % <body font>
{} % <indent amount}
{\bfseries} % <theorem head font>
{\normalfont\bfseries:} % <punctuation after theorem head>
{.5em} % <space after theorem head>
{} % <theorem head spec"normal")>
\theoremstyle{solutionstyle}
\newtheorem{solution}{Solution}[chapter] % Comment out [section] to remove section number dependence
And I typed the each problem within \begin{problem} .. \end{problem}
(Same approach for solutions.)
Question
Putting aside what I already have done, and with respect to being flexible and future-proof with my design-related decisions/mind-changes:
1) Should I enclose the problems (solutions) in some custom environment? (Or should I simply begin a new section for each problem and a new section for each solution. (And, perhaps, do the styling with titlesec
-like package?))
2) If yes, what is a good way to define an environment such that it will automatically insert, say, Problem #N (which, say will be numbered by chapter number followed by problem number within the chapter), where I can style the Problem #N without any limitations? (For example, should the environment automatically start some section (or subsection)?)
theoremstyle
approach is limited with respect to label styling (including line-break after the label).\label
or something like the environment's title? However, if you do not need theorem, you can easily define the environment in another way without changing the rest of the document. That's what I meant with very flexible.