Here is a simple fragment of code

m = {{a, b}, {c, d}};
mm = Prepend[m, {Q, R}];
Grid[Join[Partition[{"", "1", "2"}, 1], mm, 2]]

It works as it must. But now if I select the output and I change the font, the quotes appears. Is there a way, to change this behavior ?

As a picture is better than an explanation here is the result

enter image description here

Now if I change the font to Times New Roman --- but whichever be the font, the result is the same ---, I obtain :

enter image description here

NB The letters have no particular meanings

  • $\begingroup$ So what are Q and R and "cotes"? And what behavior do you want changed? $\endgroup$ – David G. Stork Dec 21 '16 at 18:31
  • $\begingroup$ How do you change the font? $\endgroup$ – Kuba Dec 21 '16 at 19:30
  • $\begingroup$ By Format > Font $\endgroup$ – cyrille.piatecki Dec 21 '16 at 19:33
  • 1
    $\begingroup$ Probably better off to avoid the front end style menus.. try Style[Grid[Join[Partition[{"", "1", "2"}, 1], mm, 2]], FontFamily -> "Times"] $\endgroup$ – george2079 Dec 21 '16 at 21:06
  • 1
    $\begingroup$ A bit of explanation, when you apply front end styling to a cell it ceases to be an output cell. You can re-apply the cell ouput style (right click the bracket to the right of the cell and achieve the font change you want. It is no longer associated with the code above however, so if you reevaluate you get a new cell. $\endgroup$ – george2079 Dec 21 '16 at 21:21

As george2079 explains above when Cells with style "Output" are edited they are converted to "Input" Cells which by default have the style sheet option ShowStringCharacters -> True which causes the quote marks to appear.

If you Print the output you get a Cell with style "Print" which in the default style sheet has ShowStringCharacters -> False:

Print @ Grid[Join[Partition[{"", "1", "2"}, 1], mm, 2]];

An explicit Style will override style sheet options preventing quote marks:

  Grid[Join[Partition[{"", "1", "2"}, 1], mm, 2]]
  , ShowStringCharacters -> False
  • $\begingroup$ I can't reproduce the problem on Win7 V11. $\endgroup$ – Kuba Dec 22 '16 at 6:45
  • $\begingroup$ @Kuba What has changed? I presume that editing Output still converts it to Input. Does a stylistic change no longer count as an edit? $\endgroup$ – Mr.Wizard Dec 22 '16 at 16:40
  • $\begingroup$ On 10.4 Output is preserved too, after Format / Font action $\endgroup$ – Kuba Dec 22 '16 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.