1. I’ve grown quite fond of the comment environment, as it allows you to turn on and turn off the commented text. In particular, I now use it for assignments to generate the version with and without solution sets. I put the answers in section blocks like this


    and for the version without the solutions, I just include the line


    To be fancier, and show the answers set off in shaded boxes, I also use the color and framed packages:


    as comment allows you to, when showing the commented block, set it in any environment:


  2. Kristian Sørensen

    Yeah, it definately rocks. I use

    Section that isn't quite done

    A lot, commenting the \begin{comment} and \end{comment} out (by adding % before them) to disable them. Easily switch on/off bits of text that way.

    • Christian Bach

      you can also use

      %comment out either the first or second line
      \includecomment{comment} %show comments
      %\excludecomment{comment}  %do not show comments
      Section that isn't quite done

      to globally show or hide comments.

      • Hi Christian,

        Thanks for your comment with the example. That’s a nice way to include/exclude the comments.

        Best, Tom.

  3. I tried to compile the following code and it does not seem to run. I used exactly the same code as yours.

        Something will go wrong!

    Be cautious. This bug caught me 20 minutes. I have no idea what lead to this.

    All the best,

    - Linfeng

    • tom

      Thanks for your comment. The problem is with the whitespace/tab character in front of the opening and closing statement of your comment environment. I updated the post to make this clearer.

      Thanks, Tom.

Leave a Reply