How to remove unnecessary options from Notebook []?

By default it Notebook[]has a small set Options:

In[4]:= Options[EvaluationNotebook[]]

Out[4]= {FrontEndVersion -> 
  "7.0 for Microsoft Windows (32-bit) (February 18, 2009)", 
 StyleDefinitions -> "Default.nb", 
 WindowMargins -> {{0, Automatic}, {Automatic, 0}}, 
 WindowSize -> {616, 537}}

Sometimes I want to change the look Notebookand install additional ones Options. For example, I like the comments to be Plain, not Bold:

SetOptions[EvaluationNotebook[], 
 AutoStyleOptions -> {"CommentStyle" -> {FontWeight -> Plain, 
     FontColor -> GrayLevel[0.6`], ShowAutoStyles -> False, 
     ShowSyntaxStyles -> False, AutoNumberFormatting -> False}}]

Now it Options[EvaluationNotebook[]]will also return the new setting that I set.

But sometimes I want to restore the default behavior and remove the extra ones Options. How can i do this?

+5
source share
3 answers

Igor’s answer is almost right. To delete the settings set

SetOptions[EvaluationNotebook[], 
 AutoStyleOptions -> {"CommentStyle" -> {FontWeight -> Plain, 
     FontColor -> GrayLevel[0.6`], ShowAutoStyles -> False, 
     ShowSyntaxStyles -> False, AutoNumberFormatting -> False}}]

You need to run

SetOptions[EvaluationNotebook[], 
 AutoStyleOptions -> {"CommentStyle" -> Inherited}]

( , , , ). , , .

Protect[HiddenData];
SetOptions[EvaluationNotebook[], HiddenData -> {"here a string"}]

, .


:

, HiddenData, , -

NotebookPut[DeleteCases[NotebookGet[EvaluationNotebook[]], 
                        $CellContext`HiddenData -> _], 
            EvaluationNotebook[]]

2:

Mr Wizard , . , , , , :

NotebookPut[
 With[{nb = NotebookGet[EvaluationNotebook[]], opts = Options[Notebook][[All, 1]]}, 
  Prepend[Select[Rest@nb, MemberQ[opts, First[#]] &], First@nb]], 
 EvaluationNotebook[]]

, , , StyleSheet, ...

, - :

NotebookPut[Notebook[First@NotebookGet[EvaluationNotebook[]]], 
            EvaluationNotebook[]]
+3

(1) Format -> Options Inspector ( Shift+Ctrl+O Windows)

(2) " " Notebook as text

(3)

(4) Apply

NotebookGet, , reset.

NotebookPut[
 Notebook@First@NotebookGet[EvaluationNotebook[]],
 EvaluationNotebook[]]
+2

:

SetOptions[EvaluationNotebook[], Background -> Inherited]

+1
source

All Articles