Hide In[n] and Out[n] in Mathematica

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].


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.


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 http://fhc.quickmediasolutions.com/image/-167608879.png

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 http://fhc.quickmediasolutions.com/image/-164716658.png

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


Programmatically (IMO the fastest way to do it), use

SetOptions[$FrontEnd, ShowCellLabel -> False]

Doing it like this (or via the Option Inspector) is necessary starting in version 11.1.1, since the Evaluation preferences tab is gone.

You can also change it for just $FrontEndSession or EvaluationNotebook[].