I'm new to Mathematica and am unfamiliar with the notebook interface. I haven't been able to delete cells with error messages.

For example, when I try to ask Mathematica to compute something, it returns a message like

Solve::nsmet: This system cannot be solved with the methods available to Solve

when it fails. Once I see that, instead of proceeding to the next line, I would like to highlight that error message (along with the erroneous command) and delete it. But Mathematica won't let me do it.

How do I do this the right way?

  • 7
    $\begingroup$ Select the cell you want to delete using the cell selectors, to the right of your window $\endgroup$ Sep 23, 2012 at 0:40
  • 2
    $\begingroup$ You might find this question useful, too. $\endgroup$ Sep 23, 2012 at 1:22
  • $\begingroup$ Thank to the both of you $\endgroup$
    – Lemon
    Sep 23, 2012 at 1:54

2 Answers 2


A notebook consists of a collection of input and output lines.

enter image description here

The output lines are where your results appear, they're not the results themselves. You can edit output lines, but then they become new input lines instead. Mathematica will remember the result from the now disappeared output line, and you can always get it back with the function

a = Out[n]  

So, editing or deleting a result only deletes its representation, not the content. Even when you deleted a result in the notebook you can always recall it.

Further reading
Notebook basics in Documentation Center
Notebooks and documents in Tutorial Collection

  • 1
    $\begingroup$ +1 as an image tells more than a thousand words. $\endgroup$ Sep 26, 2012 at 18:19

The error messages generated in the notebook use the "Message" style from the stylesheet. If you look at the corresponding entry in Core.nb (base definitions), you'll find that cells of this type have Editable -> False and CellAutoOverwrite->True:

What this means is that you cannot select the contents and edit it (or erase it), which is why your attempts failed. In addition, you don't have to delete your incorrect attempt and try again — you can just fix your mistake (typo/syntax error/whatever) and re-evaluate the input and this cell will be automatically overwritten (and will disappear if there are no errors).

Since you're new, you might also find this answer useful in learning some basic shortcuts to navigate around the notebook.


Your Answer

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

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