27
$\begingroup$

I know that I can close a notebook and open it again in order to remove the In/Out labels. What I would like to know is if there is another easy way of removing these labels without having to close the notebook. Actually I just want to hide them from my printouts.

It seems to me like it should be a printing option, but I can't find it.

$\endgroup$
1
  • $\begingroup$ Thank you Mike, Heike & Spartacus for your great answers! $\endgroup$ Feb 2, 2012 at 13:33

4 Answers 4

23
$\begingroup$

You can set this in a style sheet so that it is done once and you don't have to do it again:

Cell[StyleData[All, "Printout"], ShowCellLabel -> False]

or can you programmatically add this private style to your notebook:

SetOptions[EvaluationNotebook[], 
 StyleDefinitions -> 
  Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
    Cell[StyleData[All, "Printout"], ShowCellLabel -> False]},
   StyleDefinitions -> "PrivateStylesheetFormatting.nb"]
 ]

If you are unfamiliar with editing style sheets that latter option is probably the best.

$\endgroup$
3
  • $\begingroup$ Looks like you already posted the same solution as me while I was still editing my answer. $\endgroup$
    – Heike
    Feb 1, 2012 at 22:33
  • $\begingroup$ @Heike. yes. the only difference is that I would not make the change for Input>Printout and Output>Printout I would do it for the style environment name Printout so it covers all print cells. $\endgroup$ Feb 1, 2012 at 22:37
  • $\begingroup$ That's probably the easiest solution, provided you haven't used labels on other cells. $\endgroup$
    – Heike
    Feb 1, 2012 at 22:46
21
$\begingroup$

preference window with the requested option highlighted

$\endgroup$
5
  • $\begingroup$ that setting suppresses In/Out in the working environment as well whereas the OP seems to want to remove them just from printouts (I guess he could toggle off when printing ...which is pretty straight forward) $\endgroup$ Feb 1, 2012 at 22:47
  • $\begingroup$ @Mike fair point; I voted for yours. $\endgroup$
    – Mr.Wizard
    Feb 1, 2012 at 22:57
  • $\begingroup$ toggling on/off via the preferences panel is probably easier actually -- much easier than setting styles so I'll vote for your answer. $\endgroup$ Feb 1, 2012 at 23:04
  • 2
    $\begingroup$ As of Version 11.1 this preference dialog seems to have vanished. So it is down to the Option Inspector it seems. $\endgroup$
    – gwr
    Mar 26, 2017 at 21:47
  • $\begingroup$ @gwr That's a little disappointing. I wonder if it was removed by choice, by oversight, or by design. Does the Option Inspector setting still work as intended? $\endgroup$
    – Mr.Wizard
    Mar 26, 2017 at 22:16
15
$\begingroup$

You could uncheck ShowCellLabel under Cell Options > Cell Labels in the Option Inspector.


If you only want to turn off input and output cells in the printing environment, you could edit the style sheet of the document.

  • In order to do that you choose Edit Stylesheet... in the format menu.
  • Click on the link to the base definition of the style sheet and copy and paste the cell 'Local definition for style "Input" in style environment "Printout"' from the base definition to the private style definitions,
  • Select the cell and check Show Expression from the Cell menu and add the option ShowCellLabel->False,
  • Uncheck Show Expression and repeat for the "Output" style in the Printout style environment.
$\endgroup$
2
  • $\begingroup$ Is this settable on a per environment basis, i.e. working vs. printing? $\endgroup$
    – rcollyer
    Feb 1, 2012 at 22:16
  • $\begingroup$ @rcollyer you could edit the style sheet if you only want to turn off labels in the printing environment. $\endgroup$
    – Heike
    Feb 1, 2012 at 22:24
3
$\begingroup$

Mathematica version: 12.2.0.0

Edit>Preferences>"Advanced" tab>"Open Option Inspector"

"Show option value" dropdown = Select if you want the change to effect your entire system or just a specific notebook. (I always select just the notebook I am interested in.)

Enter "ShowCellLabel" into "Lookup:" input box

Change "ShowCellLable" to "False"

Click "Apply"

$\endgroup$

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.