Is there a way to get table of contents I can click on?
I'm looking for something like Table of Contents module in Jupyter notebooks where I can jump between sections easily, here's what my scratch-space usually looks like
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityIs there a way to get table of contents I can click on?
I'm looking for something like Table of Contents module in Jupyter notebooks where I can jump between sections easily, here's what my scratch-space usually looks like
AFAIK there's nothing built-in.
On the other hand I use this sort-of functionality all the time. Here's a quick way to generate a table of contents palette:
nbTOC[nb_] :=
Button[
Mouseover[#, Style[#, "HyperlinkActive"]] &@First@NotebookRead@#,
SelectionMove[#, All, CellContents],
Appearance -> None,
BaseStyle -> "Hyperlink",
Alignment -> Left,
ImageSize -> 100
] & /@
Cells[CellStyle -> {"Title", "Chapter", "Section", "Subsection",
"Subsubsection"}] // CreatePalette[
Panel[
Column[#,
Dividers -> Center],
ImageSize -> 100
],
FrontEnd`ClosingSaveDialog -> False,
WindowTitle -> "Table of Contents",
Magnification -> 1.5
] &;
nbTOC[Optional[Automatic, Automatic]] :=
nbTOC@EvaluationNotebook[]
It assumes you just want to navigate to the "Title"
, "Chapter"
, "Section"
,etc. cells and that the CellObject
available at the time the palette was generated will still exist.
The other way I've done this is, at click time, searched for a cell with the same contents and style as the original cell in the notebook. That way it'll work even after the notebook has been closed and reopened.
AuthorTools`
package has some stuff that might be able to fit your needs. Both of these would require some work though. $\endgroup$ – ktm Mar 9 '17 at 1:55