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


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

Re: Different Color in ToString

Started byBarrie Stokes <Barrie.Stokes@newcastle.edu.au>
First post2012-03-22 10:53 +0000
Last post2012-03-22 10:53 +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 Barrie Stokes <Barrie.Stokes@newcastle.edu.au> - 2012-03-22 10:53 +0000

#9199 — Re: Different Color in ToString

FromBarrie Stokes <Barrie.Stokes@newcastle.edu.au>
Date2012-03-22 10:53 +0000
SubjectRe: Different Color in ToString
Message-ID<jkf0ba$8l3$1@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@smc.vnet.net>,
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