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

  • 1
    This was also discussed a few times on mathgroup, e.g., 1 2 – Simon Aug 23 '11 at 9:43

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.

  • 1
    Not any more... – Mark Adler Aug 6 '17 at 23:14

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.

  • +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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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