Update #2: This behavior has been confirm across platforms and in multiple versions. Therefore:

  1. Is this a bug or a feature?

  2. Can I disable this "feature" so that copying a selection of Cell contents works the same as copying the entire Cell?

Update: As Simon Woods astutely observed this problem only occurs when you select the cell contents rather than the entire cell via the bracket. Those two tested this and reported, please check again selecting only the contents and see if the behavior appears.

In version 10 quote marks (i.e. ShowStringCharacters) appear in output when it is saved as an image using Save Selection As...:

CharacterRange["a", "z"]

Appearance in the Notebook:

{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z}

When saved as a PNG:

enter image description here

These quote marks do not appear in export from version 7, at least as I had it configured.

Why do they appear?

Can I keep them from appearing?

  • $\begingroup$ I do not have MMA 10 installed yet... but I would like to know whether you have tried to Save Selection As... of ToExpression[CharacterRange["a", "z"]] ? $\endgroup$
    – Boson
    Commented Jul 21, 2014 at 8:59
  • $\begingroup$ @Boson I haven't tried that, but that's not really what this question is about. Your code would produce Symbols rather than Strings. $\endgroup$
    – Mr.Wizard
    Commented Jul 21, 2014 at 9:03
  • $\begingroup$ Am not seeing this on OS X $\endgroup$ Commented Jul 21, 2014 at 9:35
  • 2
    $\begingroup$ Strange. I get the quotes if I select the cell contents but not if I select the cell bracket. $\endgroup$ Commented Jul 21, 2014 at 11:00
  • $\begingroup$ I'm on Windows 8.1 and my behavior is exactly as @SimonWoods reports. $\endgroup$
    – RunnyKine
    Commented Jul 21, 2014 at 15:32

4 Answers 4


The quotes appear because the InputForm does not show them, while the OutputForm does.

Programmatically, you can explicitly call OutputForm to avoid this:

Export["quotes.png", OutputForm[CharacterRange["a", "z"]]]

enter image description here

You can also go into Format > Option inspector… and look for ShowStringCharacters and using Save selection as…:

enter image description here

  • $\begingroup$ Carlo, would you please describe exactly what you changed in the Option Inspector? I cannot seem to find the right setting for this. $\endgroup$
    – Mr.Wizard
    Commented Jul 21, 2014 at 9:05
  • $\begingroup$ @Mr.Wizard Funny, I can't reproduce the behavior you described under Linux. I think the option mentioned by Carlo is under FormattingOptions>ExpressionFormatting>DisplayOptions. For me it does not change the behavior of the string export, however. $\endgroup$
    – sebhofer
    Commented Jul 21, 2014 at 9:18
  • $\begingroup$ As a matter of fact I've changed the option back, and I still can't see the quotes, but I'm on MacOs X in this case this might be a bug specific to Linux. $\endgroup$
    – Carlo
    Commented Jul 21, 2014 at 9:46
  • $\begingroup$ @sebhofer I'm on Windows so if this is not happening in either OSX or Linux I think it is a bug. $\endgroup$
    – Mr.Wizard
    Commented Jul 21, 2014 at 9:50

1. Is this a bug or a feature?

My opinion is that it is not a bug. Different selections yield different inputs, so different outputs are at least possible. On the other hand, I'm not sure I would call it a feature. It strikes me that users will wonder why they cannot easily get an image of what they see.

"Save Selection As..." seems to consistently show the results of NotebookRead[]. There are (at least) three forms of output from NotebookRead[], a box expression, a complete Cell or a list of cells, or a String. Each type is packaged into a Notebook that is then exported.

Examples of the three forms are shown below. The first is the selection of the contents of the output cell of CharacterRange["a", "c"]. The second is the selection of the whole output cell. The third is the selection of the number 123 in an input cell.

Note that a box expression is put in a cell with no style. A complete Cell is passed as is. And note that a String, such as 123, is automatically formatted as "Text".

Mathematica graphics

In this regard, @Carlo has it right, that when only the contents are selected, we lose the information that the style is "Output".

It is not clear to me why, assuming it is intentional, saving a selection from the contents of the cell does not automatically inherit the cell style of the enclosing cell in the notebook expression that is exported. There could be issues if the selection was inside a inline cell I suppose. For instance sometimes Mathematca interprets actions, such as when an input or output cell is pasted inside an input cell. The expression is pasted, not the cell, whereas pasting a text cell in an input cell yields an inline cell.

2. Workaround?

I don't have a general solution. One might add something to KeyEventTranslations.tr or to MenuSetup.tr to select the cell. If nb is the notebook with the selection to be saved, the following

SelectionMove[nb, All, Cell];
FrontEndTokenExecute[nb, "SelectionSaveSpecial"]

Other programmatic approaches seem possible, such as styling the selection with the cell's style. I could not discover a way so that the menu command would do this.


With V10 on OS X, I get


Might be a platform issue.


I'm on 10.0 for Mac OS X x86 (64-bit) (June 29, 2014) and and have the following observed:

  • highlighting the Output-Cell and using the Command "Save Selection As" leads to the following result;

enter image description here

enter image description here

  • highlighting the Output and using the Command "Save Selection As" leads to the observed result;

enter image description here

enter image description here


CellPrint[ExpressionCell[CharacterRange["a", "z"], "Output", ShowStringCharacters -> True]]


{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}


CellPrint[ExpressionCell[CharacterRange["a", "z"], "Output", ShowStringCharacters -> False]]

what one shall expect:


at least on the Monitor ... Standing above can be applied accordingly for "Save Selection As"

  • $\begingroup$ This also happens in V9 ...but not in V8. $\endgroup$ Commented Jul 21, 2014 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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