MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Remove quotes from Cell Expression

  • To: mathgroup at
  • Subject: [mg99555] Re: Remove quotes from Cell Expression
  • From: David Bailey <dave at>
  • Date: Fri, 8 May 2009 00:12:33 -0400 (EDT)
  • References: <gtrl2u$1ol$>

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
If you unformat the two cells (click in the cell and use the menu item 
Cell>Show Expression), you will see that your first cell is of style 
"Text", while the second is of style "Output" - that is why they look 
different. One way to make a text cell with strings displayed without 
quotes is like this:

m1 = {{"a", b}, {c, d}};
nb = CreateDocument[];
  Cell[ToBoxes@Grid[m1], "Text", ShowStringCharacters -> False]]

Alternatively, you can specify "Output" style rather than "Text" style 
for your cell.

Unformatting existing cells and copy/pasting the expression revealed, is 
a great way to create new cell expressions in your code.

David Bailey

  • Prev by Date: Re: InputField in Dialog or Document Windows
  • Next by Date: Re: Linux Mathematica
  • Previous by thread: Re: Remove quotes from Cell Expression
  • Next by thread: solve an integration equation