Category Archives: Mathematica
Mathematica: Create a TOC
TOCForNotebook[] := Module[{nbr, data, cells, nb}, nb = EvaluationNotebook[]; SetOptions[nb, System`CreateCellID -> True]; SelectionMove[nb, All, Notebook, AutoScroll -> False]; NotebookWrite[nb, NotebookRead[nb]]; NotebookFind[nb, "Section", All, CellStyle]; nbr = NotebookRead[nb]; data = nbr /. {Cell[x_, “Section”, ___, z : (CellID -> w_), … Continue reading
Posted in Mathematica
Comments Off