Message Boards Message Boards

4 Replies
4 Total Likes
View groups...
Share this post:

How do I get quotes out of this Grid?

Posted 11 years ago
I'm using CreateDocument to create an output document that shows results without showing all the functions used to get those results.
In the source notebook I create some tables using Grid:
table1=Grid[{{"A","B","C"}}, Frame->All]
Then laterI insert that table into the output document:
CreateDocument[ ……, table1, ….]

Note the quotes.
If I remove quotes from the original expression some of the strings are misinterpreted as commands. 
In this trivial example I only showed cells containing literal strings, but in my real table many of the cells are function calls.

How do I get rid of those quotes from the output?

POSTED BY: david.a.wagner
4 Replies
What about this method?
CreateDocument[ExpressionCell[table1, "Output"]]
POSTED BY: Vitaliy Kaurov
Posted 11 years ago
A colleague suggested using OutpufForm:
table1=Grid[{{OutputForm["A"],"B","C"}}, Frame->All]

Strangely, adding it to only ONE of the fields changed ALL of the cells to the correct form in the simple example.
In my actual data the grid has some literal strings as shown and some function results. When I added OutputForm to only the first literal string it changed ALL of the literal strings to what I expected (no quotes in the output), but it also added quotes to all the ones that didn't have them before.
So in the end I had to add OutputForm in several places to get the output I wanted.
David Reiss' suggestion would probably have been simpler.
POSTED BY: david.a.wagner
One way would be to do something along the following lines:
CreateDocument[TextCell[table1, "Text", ShowStringCharacters -> False]]
POSTED BY: David Reiss
I am not sure what you plan to do with table1, but you can always put a HoldForm around things, as in
table1 = HoldForm@Grid[{{A, B, C}}, Frame -> All]
And now A,B,C are not evaluated. But again, this is just a wrapper. You have to remove it at one point.
POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract