# Omit environment-content from being printed

I've created a very simple environment for myself to make reminders/comments visible inside the document:

\newenvironment{todo}{~\\\color{red}}{~\\}


However, now I want to create a pdf for someone to proof-read and want to omit all those ToDos from the pdf. Is there a way to simply hide all the ToDos from the document by changing the environment-definition? Or maybe replace the content inside the todos with something simple like

<TODO>

• Redefine your environment as being the same as comment in a copy of your .tex file. You may also see the xcomment package. Nov 3 '20 at 11:00

Here are two options:

1. You can use the comment package and do \excludecomment{todo}, but this will insert a line break between the text before and after the environment:

1. You can use xparse and redefine the environment to grab its contents with +b and throw them away, then you have no line break:

Also, adding \ignorespacesafterend will avoid one spurious spaces after the \end{todo}.

\documentclass{article}
\usepackage{color}

\newenvironment{todo}{~\\\color{red}}{~\\\ignorespacesafterend}

% % Option 1:
% \usepackage{comment}
% \excludecomment{todo}

% Option 2:
\usepackage{xparse}
\RenewDocumentEnvironment{todo}{+b}{}{\ignorespacesafterend}

\begin{document}

some text
\begin{todo}
lotsa
\end{todo}
some text

\end{document}

• Thank you. I just added a '//todo' inside the empty curly brackets to just print out that word - to indicate that position in the text. Nov 3 '20 at 12:07