In the university I'm currently attending a lecture where no lecture notes exist.
I want to tex what the professor has written on the blackboard. I'm gonna include comments (things that my professor said, but didn't write down) that I've written down.
For me it's necessary to distinguish between what the professor wrote down and what I added.

I was thinking about something like this:

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos e

X is important, because of Y. Catchwords: A, B, C

accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eir

The words wrapped inside the mycomment tag should be rendered as normal text, but with a different style, color (grey forinstance) whatever. (I know there are packages for changing the color, like xcolor).

It should be possible to 'toggle' these comments off. I'd like to give the *.tex files to a friend who should decide for himself whether the pdf output should contain my comments or not.
The desired solution would be change a line like




How can I do this in tex?


Use the comment package.



\specialcomment{graycomment} {\begingroup\color{gray}}{\endgroup}
%\excludecomment{graycomment}   %% uncomment to exclude it.

Regular text

A comment.

More text.
  • Seems to work. Is it possible to change it into an "inline" command, meaning I can write a block in a single line? – citronas Apr 11 '12 at 18:56
  • According to the documentation The opening and closing commands should appear on a line of their own. No starting spaces, nothing after it. See the link to the documentation now included in my answer. – André Apr 11 '12 at 19:19

I would look at something like the todonotes package. The package allows you to make notes on a PDF, either inline or in the margins of the PDF. The notes can be disabled through package options and there are a number of color and appearance configurations. I use the package both as a todo list during development of documents and as an annotation device for notes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.