Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every evaluation generates a pair of In[n]/Out[n] signs tagged before actual input and output. Like the following:

enter image description here

If I save the file, close it and re-open it, that In[n]/Out[n] signs will disappear (as expected). Like the following:

enter image description here

However, A code example in documentation file will always have its In[n]/Out[n] signs no matter you have computed that piece of code or not. Like the following:

enter image description here

My question is: How to perserve the In[n]/Out[n] signs generated by computation even if I re-open the same file on a fresh kernel? Like what it looks like for documentation files.

Maybe it is necessary to use DumpSave like stated in this question?

Besides, how to access stylesheet of documentation files? If I can apply that style to my code notes would be great.

share|improve this question
The documentation notebooks have Savable -> False, so you can edit but not save them. So all you need to do is to start with a clean kernel (Quit), evaluate the notebook, save and then set Saveable to False. – R. M. Jul 8 '14 at 5:36
@rm-rf hrmm... answer? – Yves Klett Jul 8 '14 at 7:09
@YvesKlett Can't use mma right now, so no dice. Please feel free to post it as an answer after verifying that it does work... I'm not sure I got the steps in the right order :) – R. M. Jul 8 '14 at 7:13
@rm-rf Thank you for your advice. But I don't think it's a Saveable problem. (Or maybe you can enlighten me more precisely?) I have re-phrased my question. Hope it is clearer now? – Naitree Jul 8 '14 at 7:39
@Naitree I was wrong then :) Mike's answer is the correct one – R. M. Jul 8 '14 at 7:48
up vote 6 down vote accepted

You need to set CellLabelAutoDelete->False

You can do this programmatically:


or set it in your stylesheet.

share|improve this answer
Many thanks. A simple setting saved my day! :) – Naitree Jul 8 '14 at 7:48

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.