I find this behavior annoying:
path = FileNameJoin[{$HomeDirectory, "Desktop", "stylesheet.nb"}];
Export[
path,
Notebook[{
Cell[StyleData[StyleDefinitions -> "Default.nb"]],
Cell[StyleData["Notebook"], Background -> LightBlue]
}]
]
nb = CreateDocument[];
SetOptions[nb, StyleDefinitions -> path];
NotebookOpen@path
So, now we have a notebook and its stylesheet opened and can play with edits. Notice that I haven't invoked the stylesheet via Format/EditStylesheet menu item but manually.
So now close the nb
.
Stylesheet is automatically closed too. How to prevent this? Should this happen?