I have some physics exercises done and I´d like to make an ebook in CDF with the explanations with simulations as well.

For these I look for some tips, and wolfram videos has a lot of it with Prof Eric Schulz.


The code suggested by professor Schulz is this

CreateLinks[nb_] := Module[{tagList = {}},
  SelectionMove[nb, Before, Notebook];
  SelectionMove[nb, Next, Cell];
   (* Keep moving cell by cell until the end of the notebook *) 
      FrontEnd`NotebookSelection[nb]]] =!= $Failed,
   (* Extract the CellTags and store in tagList *)
   {If[(CellTags /. 
        Options[NotebookSelection[nb], "CellTags"]) =!= {}, 
     tagList = 
      Append[tagList, (CellTags /. 
         Options[NotebookSelection[nb], "CellTags"])]],
    SelectionMove[nb, Next, Cell]}];
  (* Build argument for ActionMenu *)
  MapThread[#1 :> {NotebookLocate[#1], 
         "SelectionOpenAllGroups"]}]} &, {tagList}]]
BuildDockedCell[chapter_, section_] := Module[{nb},
  nb = OpenSection[chapter, section];
  SetOptions[nb,DockedCells -> Cell[BoxData@ToBoxes@Grid[{{
           Row[{"Section ", chapter, ".", section}],
           ImageMargins -> 0, FrameMargins -> 0, 
           BaseStyle -> {"MSG", 12}]}},
        Spacings -> {0.5, 0.5}, Alignment -> {Left, Top}],
     "DockedCell", Background -> GrayLevel[0.95]]]]
DeleteDockedCell[chapter_, section_] :=
 Module[{nb}, nb = OpenSection[chapter, section]; 
  SetOptions[nb, DockedCells -> Inherited]]

But after name the Cell (with tags) I tried these

BuildDockedCell[1, 1]

And Mathematica answear me that

SetOptions::sstm: "Argument OpenSection[1,1] is not a symbol or a stream."

Anyone can help me how to create this menu.

I also put a picture of how Eric Schulz book looks like.

enter image description here

  • $\begingroup$ Do you have function definitions for OpenSection and CreateContentLinks? $\endgroup$ Feb 17, 2016 at 22:13
  • $\begingroup$ No, the code explained is just that $\endgroup$
    – dcvilela
    Feb 17, 2016 at 23:44


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.