MathGroup Archive 2012

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

Search the Archive

Re: Different Color in ToString

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125623] Re: Different Color in ToString
  • From: Barrie Stokes <Barrie.Stokes at newcastle.edu.au>
  • Date: Thu, 22 Mar 2012 05:51:08 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201203211044.FAA27057@smc.vnet.net>

Hi Scott

n=3;
Text[ StringForm["There are `1` numbers here", Style[ n, Red ]] ]

n = 3;
m = 5; 
Text[  StringForm[  "There are `1` numbers here, but threre are `2` numbers there.", Style[ n, Red ], Style[ m, Blue, Bold ]] ]

n = 3;
m = 5;
p = 345678;
Text[ StringForm[
  "There are `1` numbers here, but there are `2` numbers there, and `3` way over there.", Style[ n, Red ], Style[ m, Blue, Bold ], 
  Style[ p, Hue[ 0.8 ], Bold, FontFamily -> "Curlz MT", FontSize -> 20 ]] ]

Barrie

>>> On 21/03/2012 at 9:44 pm, in message <201203211044.FAA27057 at smc.vnet.net>,
Scott Colwell <scolwell at uoguelph.ca> wrote:
> Does anyone know how to change the color of the font in a ToString command. 
> 
> For example, in the following, the text should be blue, but the number 3 
> should be red.
> 
> n = 3;
> Text[Style["There is "<> ToString[Style[n, Red]] <> " numbers here", Blue]]
> 
> Thank you,




  • Prev by Date: Re: Different Color in ToString
  • Next by Date: Re: new functional operator
  • Previous by thread: Re: Different Color in ToString
  • Next by thread: Re: Different Color in ToString