I have a custom style called style1.nb and I want to install it into a notebook Class01.nb so I can send only the notebook file to my students with the style of style1.nb. Is that possible?
Here is the code used by the OP to solve its issue:
nb=NotebookOpen[NotebookDirectory<>"style1.nb"]; tmp=NotebookGet[nb]; estilos=Cases[tmp,Cell[StyleData[x_,y___],z__],∞]; NotebookClose[nb]; SetOptions[EvaluationNotebook, StyleDefinitions -> Notebook[estilos]]
style1.nb is my own style with 1 style cell per type of cell