Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Colored Output

  • To: mathgroup at
  • Subject: [mg87235] Re: Colored Output
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at>
  • Date: Sat, 5 Apr 2008 04:21:43 -0500 (EST)
  • Organization: The Open University, Milton Keynes, UK
  • References: <ft4n1k$3pt$> at wrote:

> I would like to have evaluated expression with some costants painted
> in a particular color, just to make reading easier.
> Say my input is
> D[a*Sin[x]]
> and the output should be
> a*Cos[x]
> with colored "a", say magenta.
> Is this achievable, and how? which kind of attributed of the constant
> a should I set?

Depending on the complexity of your actual expressions, the easiest way 
to color some parts of them might be using replacement rules (and 
possibly some *Cases* statements) to apply the desired *Style* commands 
to the constants. For instance,

     D[a*Sin[x]] /. a -> Style[a, Magenta]

-- Jean-Marc

  • Prev by Date: Re: Colored Output
  • Next by Date: Re: Label vertices in Graph to display with GraphPlot
  • Previous by thread: Re: Colored Output
  • Next by thread: Re: Colored Output