|
|
Re: How Can I Make A String Variable With Styled Text?
Posted:
Nov 25, 2012 5:08 AM
|
|
On 11/24/2012 1:29 AM, Gregory Lypny wrote: > Hello everyone, > > I have a string variable > > myString = "This is boldface. The rest is not." > > When I execute myString, I want the first sentence to appear in bold type. >Selecting the sentence and formatting it as bold when I create the string does not work. >StringForm will do the trick, as in > > myString = StringForm["`` The rest is not.", Style["This is boldface", Bold]] > > but, of course, the Head of myString will no longer be String. Is there any other way to do this? >
Colors and Bold or not and other attributes are part of the display processes, not the data itself.
Why not simply do:
----------------------------- boldString = "This is boldface."; notBoldString = " The rest is not.";
Row[{Style[boldString, Bold], notBoldString}] -------------------------------
--Nasser
|
|