TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While writing I tend to add a lot of notes using \marginpar. Is there a way to hide them before printing a final version?

share|improve this question
up vote 13 down vote accepted

There a number of methods you can use. One way is to use yet another package such as the todoor you can simply define a command as shown below, which will perhaps also be more semantically correct for notes.


\gdef\note##1{\mbox{}\marginpar[$\leftarrow$ ##1]{%
    \color{blue}$\leftarrow$ ##1}}}

\note{Adams disagrees on this issue.} This is some lipsum text
\note{Check the reference out.} This is some lipsum text

You can switch them on and off using \notesoff or \noteson.

enter image description here

If you want to use the todo package check the post How to add todo notes ?

share|improve this answer
I believe it should be \gdef\notesoff{\gdef\note##1{}} or it wouldn't gobble its argument, shouldn't it? – clemens Mar 20 '12 at 23:40

You could use the comment package (http://www.ctan.org/pkg/comment). A little example (change \includecomment{note} to \excludecomment{note} to hide the margin note):




text text text text
\marginpar{a margin note}
text text text

share|improve this answer

Just redefine the command to do nothing:

share|improve this answer
I wouldn't redefine marginpar this way, as it may break other legitimate marginpars. – Yiannis Lazarides Mar 9 '11 at 22:30

I've been taking two approaches - one being to use the opt package, which ties output to tags that can be toggled:

\newcommand{\marpar}[1]{\opt{note}{\marginpar{\fnsize #1}\index{TODO}}}

Another way to suppress output of those modified marginpars if the opt environment cannot be used would be to hide the \marginpar inside a macro that never gets called.

\newcommand{\marpar}[1] {{\newcommand{\lastunprintedcommand}{\marginpar #1}}}
share|improve this answer

Your Answer


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.