Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
Select the cell you want to delete using the cell selectors, to the right of your window –  belisarius Sep 23 '12 at 0:40
You might find this question useful, too. –  Oleksandr R. Sep 23 '12 at 1:22
Thank to the both of you –  sidht Sep 23 '12 at 1:54
add comment

2 Answers

up vote 12 down vote accepted

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

share|improve this answer
+1 as an image tells more than a thousand words. –  István Zachar Sep 26 '12 at 18:19
add comment

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.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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