I recently found the wonderful "StyleDefinitions"
return value from NotebookInformation
which I've been using to edit style definitions within a notebook itself.
Generally I use this like:
First["StyleDefinitions" /. NotebookInformation[EvaluationNotebook[]]]
NotebookObject[$FrontEnd, 84]
which returns the stylesheet that I edit programmatically to change my InputNotebook[]
.
This sometimes has a second return value, though:
Last["StyleDefinitions" /. NotebookInformation[EvaluationNotebook[]]]
{NotebookObject[$FrontEnd, 4]}
which I don't fully understand.
What does it do?
Possible explanation
I tend to see this two result form only for stylesheet notebooks:
(*Plain nbs*)
nbsdefs =
ReplaceAll["StyleDefinitions", NotebookInformation /@ Notebooks[]];
Length /@ nbsdefs
{1, 1, 1, 1, 1, 0}
(*Stylesheet nbs*)
Length /@
ReplaceAll["StyleDefinitions",
NotebookInformation /@
DeleteDuplicates[Cases[Flatten@nbsdefs, _NotebookObject]]
]
{2, 2, 2, 2}
Where the second argument seems to be the stylesheet notebook it inherits from.
But I'm not certain of this interpretation.