6
$\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$
2
  • $\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, 2016 at 20:17
  • 1
    $\begingroup$ This could probably help : resources.wolframcloud.com/FunctionRepository/resources/… , in particular the "Applications" section. $\endgroup$
    – xpsf
    Feb 13, 2021 at 12:24

1 Answer 1

6
$\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$
4
  • $\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$ Jun 1, 2017 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, 2017 at 7:31
  • $\begingroup$ Thanks, I will try it out on first chance I get. $\endgroup$ Jun 10, 2017 at 13:30
  • $\begingroup$ The repository has since moved to Science Notebooks $\endgroup$
    – Ranza
    Feb 14, 2021 at 15:36

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.