Re: Remove quotes from Cell Expression
- To: mathgroup at smc.vnet.net
- Subject: [mg99508] Re: Remove quotes from Cell Expression
- From: Albert Retey <awnl at gmx-topmail.de>
- Date: Thu, 7 May 2009 06:32:22 -0400 (EDT)
- References: <gtrl2u$1ol$1@smc.vnet.net>
robert prince-wright wrote: > Can someone show me how to write the list m1 to a notebook without the quotes showing? > > m1 = {{"a",b},{c,d}}; > nb = CreateDocument[]; > NotebookWrite[nb, Cell[ToBoxes@Grid[m1],"Text"]] > > The expression below gives the right result so there is something missing in my limited understanding of Cell expressions. > > Grid@m1 That has nothing to do with the convertion to boxes but is controlled by Cell properties. There are two ways to achieve what you want: 1) use cells of style "Output", which will by default not show the string characters (which is why you don't see them with Grid@m1): NotebookWrite[nb, Cell[BoxData[ToBoxes@Grid[m1]], "Output"]] 2) stay with the "Text" style cells, but change the settings for ShowStringCharacters: NotebookWrite[nb, Cell[BoxData[ToBoxes@Grid[m1]], "Text", ShowStringCharacters -> False]] Note that I have wrapped the box expression with BoxData, which was necessary in my version to avoid an error indication for the created cell... hth, albert