The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How Can I Make A String Variable With Styled Text?
Replies: 3   Last Post: Nov 25, 2012 11:38 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
David Reiss

Posts: 603
Registered: 2/24/06
Re: How Can I Make A String Variable With Styled Text?
Posted: Nov 25, 2012 11:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

One should be able to do this with the function Interpretation;
however, Interpretation does not seem to work properly with strings.
I "interpret" that as a bug...

Thus, I believe that one should be able to define

temp = Interpretation[
Row[{Style["This is boldface.", Bold], " The rest is not."}],
"This is boldface. The rest is not."]

and then be able to execute some thing like,


and get the list of characters in the string. This, however, does not


On Nov 24, 2:31 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?
> Gregory

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.