Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9188 > unrolled thread

Re: Different Color in ToString

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-03-22 10:47 +0000
Last post2012-03-22 10:47 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Different Color in ToString Bob Hanlon <hanlonr357@gmail.com> - 2012-03-22 10:47 +0000

#9188 — Re: Different Color in ToString

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-03-22 10:47 +0000
SubjectRe: Different Color in ToString
Message-ID<jkf00o$8gi$1@smc.vnet.net>
n = 3;

Row@{Style["There are ", Blue],
  Style[n, Red],
  Style[" numbers here", Blue]}

Row@Thread@Style[
   {"There are ", n, " numbers here"},
   {Blue, Red, Blue}]

Print[Style["There are ", Blue],
 Style[n, Red],
 Style[" numbers here", Blue]]

Print @@ Thread@Style[
   {"There are ", n, " numbers here"},
   {Blue, Red, Blue}]


Bob Hanlon


On Wed, Mar 21, 2012 at 6:44 AM, Scott Colwell <scolwell@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,
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web