1

I used the comment package to includecomment/excludecomment an answer environment. This way I can print questions, and then later print the questions and answers together.

The problem I'm trying to solve: the answers look the same as the rest of the text. How do I make them italicized/stick a box around them/make them bold? Can I still use the comment package then to include/exclude them? Or is there perhaps a far better tool for this.

2
  • Please give us something to work with. A little example that shows your use-case. It'll help get answers your way far quicker as well... trust me.
    – Werner
    Commented Oct 13, 2014 at 5:06
  • @Werner understood, next time I will definitely do that
    – Henry
    Commented Oct 13, 2014 at 5:10

1 Answer 1

3

On unix(like) systems you can use texdoc comment, for example, to read the package documentation. If you read the documentation for the comment package then on page 2 you will find:

Special comments are defined as

\specialcomment{〈name〉}{〈before commands〉}{〈after commands〉}

where the second and third arguments are executed before and after each comment block. You can use this for global formatting commands. To keep definitions &c local, you can include \begingroup in the ‘〈before commands〉’ and \endgroup in the ‘〈after commands〉’. ex:

\specialcomment{smalltt}{\begingroup\ttfamily\footnotesize}{\endgroup}

Consequently, in order to get your comments in italics you can write:

\documentclass[border=5mm]{standalone}
\usepackage{comment}

\specialcomment{itcomment}{\begingroup\itshape}{\endgroup}

\begin{document}
  \begin{itcomment}
    Here is a comment in italics!
  \end{itcomment}
\end{document}

and this will produce:

enter image description here

5
  • It was unreal how fast and complete that answer was. Also sorry for not looking harder for documentation, and thank you!
    – Henry
    Commented Oct 13, 2014 at 5:10
  • @Henry Glad to be of help. I learnt about the texdoc command on TeX.SX so there's no need to apologise for not knowing about this:)
    – user30471
    Commented Oct 13, 2014 at 5:19
  • Different Henry here. Come on, you could have spent 10 seconds more for that first paragraph. :) It does not relate to the OS. TeX Live on Windows has the file texdoc.exe as well. I do not have MikTeX installed but upon googling, MikTeX has it too.
    – henry
    Commented Oct 13, 2014 at 7:08
  • @henry Unfortunately I am completely ignorant when it comes to windows:)
    – user30471
    Commented Oct 13, 2014 at 11:04
  • Well, ok. :) I meant that currently the wording makes it seem factually wrong. texdoc is not exclusively available on unix-like systems. (although you did not say that verbatim)
    – henry
    Commented Oct 13, 2014 at 14:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .