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


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

  • Redefine your environment as being the same as comment in a copy of your .tex file. You may also see the xcomment package.
    – Bernard
    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:

enter image description here

  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:

enter image description here

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



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

% Option 2:


some text
some text

  • 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.
    – RazorHail
    Nov 3 '20 at 12:07

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.