wolfram mathematica - How to delete unnecessary options from Notebook[]? -
by default notebook[]
has small set of options
:
in[4]:= options[evaluationnotebook[]] out[4]= {frontendversion -> "7.0 microsoft windows (32-bit) (february 18, 2009)", styledefinitions -> "default.nb", windowmargins -> {{0, automatic}, {automatic, 0}}, windowsize -> {616, 537}}
sometimes wish modify notebook
appearance , set additional options
. example have comments plain
rather bold
:
setoptions[evaluationnotebook[], autostyleoptions -> {"commentstyle" -> {fontweight -> plain, fontcolor -> graylevel[0.6`], showautostyles -> false, showsyntaxstyles -> false, autonumberformatting -> false}}]
now options[evaluationnotebook[]]
return new option have set.
but wish restore default behavior , delete additional options
. how can that?
igor's answer right. remove options set by
setoptions[evaluationnotebook[], autostyleoptions -> {"commentstyle" -> {fontweight -> plain, fontcolor -> graylevel[0.6`], showautostyles -> false, showsyntaxstyles -> false, autonumberformatting -> false}}]
you need run
setoptions[evaluationnotebook[], autostyleoptions -> {"commentstyle" -> inherited}]
but works options standard , have default inherit (if it's cell enclosing section or notebook, if it's notebook stylesheet). if make own option, e.g.
protect[hiddendata]; setoptions[evaluationnotebook[], hiddendata -> {"here's string"}]
i don't know how programmatically remove option.
edit:
actually, remove hiddendata option created above, can use like
notebookput[deletecases[notebookget[evaluationnotebook[]], $cellcontext`hiddendata -> _], evaluationnotebook[]]
edit 2:
mr wizard asked how remove user-set notebook options. assuming means options can't inherited, believe following should work:
notebookput[ with[{nb = notebookget[evaluationnotebook[]], opts = options[notebook][[all, 1]]}, prepend[select[rest@nb, memberq[opts, first[#]] &], first@nb]], evaluationnotebook[]]
but maybe there options associated stylesheet i've ignored...
if meant how system's default notebook options - can delete notebook options:
notebookput[notebook[first@notebookget[evaluationnotebook[]]], evaluationnotebook[]]
Comments
Post a Comment