# Ignore some self-defined command during compilation?

In a .tex file, there is some self defined command

\newcommand{\mycomment}[1]{\textcolor{red}{#1}}
...
\mycomment{blah blah}
...

I hope to be able to skip the command during compilation in my final version, but still compile it in versions before my final version. Are there any ways to do that?

-
do you just mean change to \newcommand{\mycomment}[1]{} for the final version? Or something else? –  David Carlisle Apr 14 '13 at 23:16
@David: In the final version, \mycomment{blah blah} will be ignored during compilation. –  Tim Apr 14 '13 at 23:22
The definition I suggested in the first comment does that, it defines the command to take the argument and do nothing with it –  David Carlisle Apr 14 '13 at 23:25
Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. –  Papiro Apr 14 '13 at 23:46

Another fairly intuitive method, particularly if you have several large blocks of code which you want to include in some compilations but not others is the comment package (also saves a lot of time if you are writing a very large manuscript, but only working on a small bit at a time). However its great for small toggles too.

\usepackage{comment}
%switches
\excludecomment{versiona}
\excludecomment{versionb}
\includecomment{versionx}

..

\begin{versiona}
\newcommand{\mycomment}[1]{\textcolor{red}{#1}
etc
\end{versiona}

\begin{versionb}
\newcommand{\mycomment}[1]{\textcolor{red}{#1}
etc
\end{versionb}
-