Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\begin{mycomment}
X is important, because of Y. Catchwords: A, B, C
\end{mycomment}

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

\newcommand{\PrintMyComments}{1}

to

\newcommand{\PrintMyComments}{0}

How can I do this in tex?

share|improve this question
add comment

2 Answers

up vote 9 down vote accepted

Use the comment package.

\documentclass{article}

\usepackage{comment}
\usepackage{xcolor}

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

\begin{document}
Regular text

\begin{graycomment}
A comment.
\end{graycomment}

More text.
\end{document}
share|improve this answer
    
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
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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