You could do this from the command line. Take @PeterGrill's basic document:
\documentclass{article}
\usepackage{xcolor}
\newcommand{\stefan}[1]{\textcolor{red}{#1}}
\newcommand{\supervisor}[1]{\textcolor{red}{#1}}
\begin{document}
Some text. \supervisor{Correct this!!}
Some text. \stefan{Correct this also!!}
\end{document}
This will give you all the comments. Then create a .sty
file, which could be as simple as:
% disable various comments
\renewcommand{\stefan}[1]{}
Then, when you want to 'hide' various comments, compile from the command line:
pdflatex "\AtBeginDocument{\input{mycomments.sty}}\input{masterfile.tex}"
Or compile normally when you want all comments to appear.
Or, perhaps even more elegantly, you could implement @PeterGrill's suggestion:
Use the following (say) file commentcommands.sty
:
\ifdefined\SupervisorMode
% re-define various commenting commands to do nothing
\renewcommand{\stephan}[1]{}
% ... etc., etc.
\fi
Then load commentcommands.sty
after the original comment commands in the master file:
\usepackage{commentcommands}
Then, when you want to 'disable' the various commands in the document you hand to your supervisor, run the command as:
pdflatex "\def\Supervisormode{}\input{masterfile.tex}"
This does have the advantage of a clearer call to pdflatex
, which you could also put into a makefile if you were so inclined.