Super User is a question and answer site for computer enthusiasts and power users. 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

Is it possible to hide the CellLabels In[n]:= and Out[n]= in a Mathematica notebook?
I don't want to hide the input or output, just the text In[n] and Out[n].

share|improve this question
This was also discussed a few times on mathgroup, e.g., 1 2 – Simon Aug 23 '11 at 9:43
up vote 8 down vote accepted

There's an option "Show In/Out Names" in the preferences (Edit menu -> Preferences) under Evaluation.

It takes effect right away in the notebooks I already have open.

share|improve this answer

Method 0

The In and Out parts of the Mathematica notebook are automatically generated CellLabels for evaluated Input and generated Output cells. Since the numbering refers to the current kernel session, the labels are set to delete when you close the notebook (the cell styles have the option CellLabelAutoDelete -> True). So one solution is to close and then reopen the notebook before printing.

All of the following methods turn off all CellLabels, not just the In/Out ones.

Method 1

(As mentioned in rakslice's answer)
Use the "Show In/Out Names" toggle in the preferences dialog. This sets the option ShowCellLabel->False globally, i.e. it turns off all CellLabels for all notebooks.

Method 2

The option can also be set at a notebook, section or cell level (or globally) using the option inspector. For example, in the following screenshot I've turned off the cell labels for "Untitled 1" but left them on for "Untitled 2": screenshot

Method 3

You can also leave the CellLabel In/Out numbering in the notebook but turn it off when you print by changing a setting in the stylesheet.

Go to Format > Edit Stylesheet. You'll get the blank, top-level stylesheet for the notebook you're working on. It inherits its styles from the "default.nb" stylesheet. Click on that link and copy the Style Environment Names section to the stylesheet of the notebook. Select the cell bracket for the "Printout" environment cell and using the option inspector (Ctrl-Shift-O) (or by modifying the cell expression Ctrl-Shift-E) set the option ShowCellLabel->False.

all steps in one image

You could also create your own stylesheet to use in other notebooks or even change the default stylesheet to reflect your preferences.

share|improve this answer
+1 for a fine answer, informative and easy to follow. – Mr.Wizard Aug 24 '11 at 11:06
@Mr.Wizard: Thanks! Shame about my mousewriting skills. – Simon Aug 24 '11 at 11:17
It's okay, I cannot afford a Wacom either. ;-) – Mr.Wizard Aug 24 '11 at 11:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .