5
$\begingroup$

I've been looking for a simple outliner for Mathematica notebooks and found Yuri E. Kandrashkin Sidebar'TOC, but decided I need something simpler and dynamic.

Has anyone tried making a dynamic outliner before?

$\endgroup$
  • $\begingroup$ Here on SE, only questions are allowed. This isn't really a question, so it doesn't fit. I suggest you re-phrase it as a question, and post your own answer to it. It's a common way to share such ideas here. $\endgroup$ – Szabolcs Nov 30 '16 at 20:17
5
$\begingroup$

This is what I've came up with so far:

Outline[] := 
 CreatePalette[
  Dynamic[Refresh[
    Column@Cases[
      NotebookRead /@ 
       Cells[SelectedNotebook[], 
        CellStyle -> {"Section", "Subsection", "Subsubsection", 
          "Subsubsubsection"}], 
      Cell[name_, 
        style : "Section" | "Subsection" | "Subsubsection" | 
          "Subsubsubsection", ___, CellID -> id_, ___] :> 
       Button[StringRepeat["#", 
          Ceiling[(StringLength[style]/ 3)] - 2] <> " " <> name , (
         NotebookFind[SelectedNotebook[], id, All, CellID];
         SelectionMove[SelectedNotebook[], All, CellGroup];
         FrontEndTokenExecute["OpenCloseGroup"];
         ), Appearance -> "Frameless"]], UpdateInterval -> 1]], 
  WindowSize -> {Fit, 550}, WindowFloating -> True, Saveable -> False,
   WindowTitle -> (WindowTitle /. 
     AbsoluteOptions[SelectedNotebook[]])]

and here is how it looks in action (the section names are clickable): Outline

I invite everyone who sees this as a useful little thing, to play with it/make it prettier/more useful or just accept it as a small community contribution.

$\endgroup$
  • $\begingroup$ I would like to have your stilesheet if possible, or is this one of the default ones (it doesn't seem like it)? $\endgroup$ – Milos Cipovic Jun 1 '17 at 6:15
  • $\begingroup$ Hi! I'm happy to share it with you. Please note that it uses latex fonts, which are also written in the repository in .otf format $\endgroup$ – Ranza Jun 2 '17 at 7:31
  • $\begingroup$ Thanks, I will try it out on first chance I get. $\endgroup$ – Milos Cipovic Jun 10 '17 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.