I'm getting some strange behaviour when using the color package at paragraph and subparagraph level. See the code snippet below:
\usepackage[usenames,dvips]{color}
\section{A}
{\color{Green} \itshape Hello.}
\subsection{B}
{\color{Green} \itshape Hello.}
\subsubsection{C}
{\color{Green} \itshape Hello.}
\paragraph{D}
{\color{Green} \itshape Hello.}
\subparagraph{E}
{\color{Green} \itshape Hello.}
The color switch is inside a group following the heading title, but is being incorrectly used within the header title at paragraph and subparagraph level. That is, D and E are shown in green as well as the 'Hello' text (but A, B and C aren't).
Note that the \itshape
switch does not have the same behaviour, so I suspect this is a bug/feature of the internals of the color package. Can anyone shed any light on this? Am I missing something?
I'm using the TeX Live 2009 version as in the standard Ubuntu 10.04 Lucid package.
EDIT: Just to be clear. I know that, in general, I can get round it using the non-switch equivalent \textcolor (but any alternatives as suggested by David Carlisle are still useful). I'm actually using this within a 'style' \newcommand definition, so I need the switch variant to colour multiple paragraphs. (There are lots of design-level ways I can avoid the problem of course, like not using styles with colour; the question isn't about that!)
I guess I'm primarily interested in whether such types of 'feature' are relatively common, limited to the specifics of using colours, etc. (and the general under-the-covers reasons why), so I can make informed decisions on what LaTeX constructs to use when, and which are likely to cause me more headaches than they're worth.