The worst place to find a leftover % TODO ask Sam about the licence is in the PDF you just uploaded to the submission system.

Comments in a co-authored LaTeX paper need three properties. Each author's notes should be easy to tell apart. All notes should disappear with one change. And a note that is still there on submission day should stop you, not slip through.

This takes about ten lines of LaTeX. I tested every snippet below.

The basic version: one command per author

Put this in a shared macros.tex that every author loads (see why one macros file matters):

% macros.tex \usepackage{xcolor} \newif\ifcomments \commentstrue % use \commentsfalse to hide every note \newcommand{\authnote}[3]{\ifcomments{\color{#2}[#1: #3]}\fi} \newcommand{\ak}[1]{\authnote{AK}{blue}{#1}} \newcommand{\sm}[1]{\authnote{SM}{red!70!black}{#1}} 

In the text:

We evaluate on three benchmarks. \sm{Is the third licence cleared?} 

With \commentstrue, the PDF shows [SM: Is the third licence cleared?] in dark red. With \commentsfalse, the note vanishes and the sentence reads cleanly. Each new author is one more \newcommand line with their initials and a color.

The safer version: fail the build if a note remains

Hiding a note is not the same as resolving it. A hidden note still sits in the source, and the next person to flip the switch brings it back. A strict mode turns any remaining note into a compile error:

\newif\ifcomments \commentstrue \newif\ifstrict \strictfalse % use \stricttrue for the submission build \newcommand{\authnote}[3]{% \ifstrict \PackageError{authnote}{Unresolved note by #1: #3}{Resolve or delete this note before submitting.}% \else \ifcomments{\color{#2}[#1: #3]}\fi \fi} 

With \stricttrue, compiling the same sentence gives:

! Package authnote Error: Unresolved note by SM: Is the third licence cleared?. 

Now the submission checklist has a concrete step: switch to strict, compile, and fix every error until the build is clean. No search needed.

Margin notes with todonotes

If you prefer notes in the margin and a list at the end, the todonotes package does that, and it has a built-in switch:

\usepackage[colorinlistoftodos]{todonotes} % notes on % \usepackage[disable]{todonotes} % notes off We evaluate on three benchmarks.\todo[color=blue!20]{AK: check the third licence} 

Switching to [disable] removes the margin notes from the PDF. The package is a good fit for long drafts, because \listoftodos gives you a single list of everything open. The macros above are lighter and make the strict check easy, so I use them for papers and todonotes for theses.

Three habits that make this work

  • Write the note where the problem is. A note at the end of the paragraph is easier to act on than one in a separate file.
  • Resolve by deleting. When a note is handled, delete it. Do not leave resolved notes in the source "for history"; version history exists for that.
  • Agree the colors up front. Two authors with similar colors defeats the purpose.

If you write together in a live editor

These macros do not depend on any tool, so they work in any setup. If your team edits in the same project at the same time, they also remove the need to reconcile comments after the fact, because each note carries its author's initials. I work on LetX, a collaborative LaTeX editor whose free plan allows unlimited collaborators, so a team of five can use five comment commands in one project. The free plan has other limits, such as 40 compiles a day, so check the pricing page.

Next in this series: Git versus a collaborative editor for papers, and when each one wins. This post is part of the series on collaborative research writing.

What is the most useful comment you have ever left in a co-authored draft? Tell me in the comments.