Re: Applying StyleForm to String plus Table?
- To: mathgroup at smc.vnet.net
- Subject: [mg51648] Re: [mg51602] Applying StyleForm to String plus Table?
- From: John Fultz <jfultz at wolfram.com>
- Date: Wed, 27 Oct 2004 23:43:12 -0400 (EDT)
- Reply-to: jfultz at wolfram.com
- Sender: owner-wri-mathgroup at wolfram.com
Your first example is the closest to something that will work for you, but instead of using StringJoin (i.e., what <> does), you want to use SequenceForm. So, let's plug in a few values for your dummy values and see some working code. Print[StyleForm[ SequenceForm["Title text\n", TableForm[Table[i j, {i, 5}, {j, 5}]]], FontSlant -> Italic]] Sincerely, John Fultz jfultz at wolfram.com User Interface Group Wolfram Research, Inc. On Wed, 27 Oct 2004 01:54:04 -0400 (EDT), AES/newspost wrote: > I want to Print a title line and below it a Table, both with the same > > text formats (options) applied, in a single output cell. The three > inputs: > > Print[ > StyleForm[ > "Title text\n" <> TableForm[Table[---]], > text_formatting_options ] ] > > Print[ > StyleForm[ > { "Title text\n" , TableForm[Table[---]] }, > text_formatting_options ] ] > > Print[ > StyleForm[ > "Title text\n" TableForm[Table[---]] , > text_formatting_options ] ] > > all "work" in the sense of producing something like what I want, but the > first one gives me a StringJoin error message and prints the <> symbols > before the Table; the second one prints the { } symbols and the comma, > and the third one seems to do what I want. > > I guess the lessons are the StyleForm is not Listable on a List (though > it is, sort of, on a TableFormed Table); and a TableFormed Table can > contain Strings but isn't itself a String. Interesting . . .