I have defined the following environment to insert a solution in my text:
\newif\ifsolution
\def\solution#1{\ifsolution {\color{blue}\textbf{Oplossing:} #1} \else \relax\fi}
If I add \solutiontrue
to the file, it adds the solutions in blue, but if I put \solutionfalse
, it omits them altogether. So far, so good.
The problem I have though is that in the solution itself, I can't seem to be able to insert blank lines, which I really need. For instance, if I put
\solution{This is the first line of the solution.
This is the second line. QED}
I receive an error. I understand that instead I have to write
\solution{This is the first line of the solution.
This is the second line. QED}
Now given that the blank lines are unmissable, is there a way to avoid the errors?
\long\def
instead of\def
.