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

In the following document, the subsection title gets colored red. Why does this happen?

  \paragraph{This should not be red!}
  \comment{Only this!}

How can I fix it? If I replace {\color{red}#1} with \textcolor{red}{#1} I get a "runaway argument" error.

share|improve this question
Odd behaviour, good question. FWIW, when I write \newcommand{\comment}[1]{\textcolor{red}{#1}} I don't get an error and the colouring is correct. – Will Robertson Sep 26 '10 at 19:45
up vote 4 down vote accepted

The reason this happens is because the color changing command does not cause TeX to enter horizontal mode. Thus, the color changes to red, then when the first character of the argument to \comment is processed, TeX switches from vertical mode to horizontal mode to start a new paragraph. \everypar inserts the \paragraph title which, as Philipp notes, is missing \normalcolor so it is typeset in the color you chose.

To remedy this, you need to get TeX to start a new paragraph before you change color.


That said, as Will notes,


works too.

share|improve this answer

This is a bug in the standard classes: the style argument of \@startsection must include \normalcolor. Fix for the moment:

                                {3.25ex \@plus1ex \@minus.2ex}%

Other classes such as KOMA-Script include the required \normalcolor. Should probably be reported at http://www.latex-project.org/bugs-upload.html.

share|improve this answer
The standard classes will not be modified and all requests to modify them are apparently ignored. At least, according to clsguide. – TH. Sep 26 '10 at 23:06
The paragraph that you refer to refers to design decisions, not necessarily to bugs. It's up to the LaTeX team to decide whether this behavior is a bug or a design decision… – Philipp Sep 27 '10 at 8:35
It's a design decision, see latex-project.org/cgi-bin/ltxbugs2html?pr=latex/4128 – Philipp Oct 3 '10 at 18:38

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.