At the top of the Complex Polynomial Systems page in the Wolfram Documentation Center, there is a table of contents with each item linking to the appropriate headers below (Mathematica 9 and above).

enter image description here

How do I create this style of table of contents in Wolfram Workbench for my own tutorials? I am using Workbench 2.0.

A solution that requires Workbench 3.0 is acceptable.

  • 2
    I'd like to see, too, how to do this directly in the Front End of Mathematica. – murray Aug 16 '16 at 19:08
  • What is that fabled Workbench 3.0 you speak about? – Hector Aug 21 '16 at 23:26
  • 2
    I'd love to see a solution without workbench! – M.R. Aug 24 '16 at 1:00
up vote 3 down vote accepted

The table of contents is generated automatically by Workbench 3.0, which you need to request from Wolfram because it hasn't been officially released.

Workbench will generate a link for each "Section" cell that you include in your tutorial.

Edit: If you have Workbench 3 but don't want to use it directly, you can load the DocumentationBuild package that comes with it and run the ConvertNotebook function on an authoring notebook created using the DocumentationTools palette.

  • @M.R. I added a way for you to do this from outside Workbench (but you still need to have the packages that come with Workbench). – David Creech Aug 24 '16 at 20:08

These type of TOC cells as shown in 'tutorial/ComplexPolynomialSystems#934984887', here's an explanation that doesn't use the workbench:

titles = {"Section A", "Section B", "Section C", "Section D"};

Clear[f]; 
f[s_] := TemplateBox[{Cell[
    s], (SetSelectedNotebook[EvaluationNotebook[]]; 
    NotebookLocate[s] &), upChevron, downChevron}, "MyTOCIcon", 
  BaseStyle -> {"MyTOC"}];
grid = Partition[f /@ titles, UpTo[2]];
CellPrint@Cell[BoxData[GridBox[grid]], "TutorialJumpBox"]
cs = Cell[#, "Section", CellTags -> {#}] & /@ titles;
Scan[CellPrint, cs]

enter image description here

For this to work you need to run these styling commands to define "MyTOC" and "MyTOCIcon" (I added a few others) and the chevron icons:

SetOptions[InputNotebook[], 
  StyleDefinitions -> 
   Notebook[{Cell[
      StyleData[
       StyleDefinitions -> 
        FrontEnd`FileName[{"Wolfram"}, "Reference.nb"]]], 
     Cell[StyleData["Input"], CellContext -> Notebook], 
     Cell[StyleData["Output"], CellContext -> Notebook], 
     Cell[StyleData["TutorialMoreAboutSection"], 
      CellGroupingRules -> {"SectionGrouping", 30}], 
     Cell[StyleData["RelatedTutorialsSection"], 
      CellGroupingRules -> {"SectionGrouping", 30}], 
     Cell[StyleData["TutorialRelatedLinksSection"], 
      CellGroupingRules -> {"SectionGrouping", 30}],
     Cell[StyleData["MyTOC"], Editable -> False, 
      FontFamily -> "Arial", FontSize -> 12, 
      FontColor -> GrayLevel[0.360784]], 
     Cell[StyleData["MyTOCIcon"], 
      TemplateBoxOptions -> {DisplayFunction :> (TagBox[
            DynamicBox[
             If[CurrentValue["MouseOver"], 
              ButtonBox[
               RowBox[{#4, Cell["  "], 
                 StyleBox[#, 
                  FontColor -> 
                   RGBColor[0.854902, 0.396078, 0.145098]]}], 
               ButtonFunction -> #2], 
              ButtonBox[RowBox[{#3, Cell["  "], #}], 
               ButtonFunction -> #2]]], 
            MouseAppearanceTag["LinkHand"]] &)}, 
      ButtonBoxOptions -> {BaseStyle -> {FontColor -> 
           GrayLevel[0.360784], "Link"}}]
     }, Visible -> False, 
    StyleDefinitions -> "Default.nb"]];

upChevron = 
  GraphicsBox[
   TagBox[RasterBox[
     RawArray[
      "UnsignedInteger8", {{{128, 128, 128, 32}, {128, 128, 128, 
         16}, {128, 128, 128, 0}, {128, 128, 128, 0}, {128, 128, 128, 
         0}, {128, 128, 128, 0}, {128, 128, 128, 0}, {128, 128, 128, 
         48}}, {{128, 128, 128, 48}, {128, 128, 128, 239}, {128, 128, 
         128, 112}, {128, 128, 128, 0}, {128, 128, 128, 0}, {128, 128,
          128, 16}, {128, 128, 128, 143}, {128, 128, 128, 
         239}}, {{128, 128, 128, 0}, {128, 128, 128, 64}, {128, 128, 
         128, 223}, {128, 128, 128, 191}, {128, 128, 128, 112}, {128, 
         128, 128, 223}, {128, 128, 128, 191}, {128, 128, 128, 
         32}}, {{128, 128, 128, 32}, {128, 128, 128, 16}, {128, 128, 
         128, 16}, {128, 128, 128, 175}, {128, 128, 128, 255}, {128, 
         128, 128, 127}, {128, 128, 128, 0}, {128, 128, 128, 
         48}}, {{128, 128, 128, 48}, {128, 128, 128, 239}, {128, 128, 
         128, 112}, {128, 128, 128, 0}, {128, 128, 128, 16}, {128, 
         128, 128, 16}, {128, 128, 128, 143}, {128, 128, 128, 
         239}}, {{128, 128, 128, 0}, {128, 128, 128, 64}, {128, 128, 
         128, 223}, {128, 128, 128, 191}, {128, 128, 128, 112}, {128, 
         128, 128, 223}, {128, 128, 128, 191}, {128, 128, 128, 
         32}}, {{128, 128, 128, 0}, {128, 128, 128, 0}, {128, 128, 
         128, 16}, {128, 128, 128, 175}, {128, 128, 128, 255}, {128, 
         128, 128, 127}, {128, 128, 128, 0}, {128, 128, 128, 
         0}}, {{128, 128, 128, 0}, {128, 128, 128, 0}, {128, 128, 128,
          0}, {128, 128, 128, 0}, {128, 128, 128, 16}, {128, 128, 128,
          0}, {128, 128, 128, 0}, {128, 128, 128, 0}}}], {{0, 8}, {8, 
       0}}, {0, 255}, ColorFunction -> RGBColor], 
    BoxForm`ImageTag["Byte", ColorSpace -> "RGB", 
     Interleaving -> True, Magnification -> Automatic], 
    Selectable -> False], DefaultBaseStyle -> "ImageGraphics", 
   ImageSizeRaw -> {8, 8}, PlotRange -> {{0, 8}, {0, 8}}, 
   ImageSize -> {8, 9}];

downChevron = 
  GraphicsBox[
   TagBox[RasterBox[
     RawArray[
      "UnsignedInteger8", {{{229, 95, 28, 32}, {229, 95, 28, 
         16}, {229, 95, 28, 0}, {229, 95, 28, 0}, {229, 95, 28, 
         0}, {229, 95, 28, 0}, {229, 95, 28, 0}, {229, 95, 28, 
         48}}, {{229, 95, 28, 48}, {229, 95, 28, 239}, {229, 95, 28, 
         112}, {229, 95, 28, 0}, {229, 95, 28, 0}, {229, 95, 28, 
         16}, {229, 95, 28, 143}, {229, 95, 28, 239}}, {{229, 95, 28, 
         0}, {229, 95, 28, 64}, {229, 95, 28, 223}, {229, 95, 28, 
         191}, {229, 95, 28, 112}, {229, 95, 28, 223}, {229, 95, 28, 
         191}, {229, 95, 28, 32}}, {{229, 95, 28, 32}, {229, 95, 28, 
         16}, {229, 95, 28, 16}, {229, 95, 28, 175}, {229, 95, 28, 
         255}, {229, 95, 28, 127}, {229, 95, 28, 0}, {229, 95, 28, 
         48}}, {{229, 95, 28, 48}, {229, 95, 28, 239}, {229, 95, 28, 
         112}, {229, 95, 28, 0}, {229, 95, 28, 16}, {229, 95, 28, 
         16}, {229, 95, 28, 143}, {229, 95, 28, 239}}, {{229, 95, 28, 
         0}, {229, 95, 28, 64}, {229, 95, 28, 223}, {229, 95, 28, 
         191}, {229, 95, 28, 112}, {229, 95, 28, 223}, {229, 95, 28, 
         191}, {229, 95, 28, 32}}, {{229, 95, 28, 0}, {229, 95, 28, 
         0}, {229, 95, 28, 16}, {229, 95, 28, 175}, {229, 95, 28, 
         255}, {229, 95, 28, 127}, {229, 95, 28, 0}, {229, 95, 28, 
         0}}, {{229, 95, 28, 0}, {229, 95, 28, 0}, {229, 95, 28, 
         0}, {229, 95, 28, 0}, {229, 95, 28, 16}, {229, 95, 28, 
         0}, {229, 95, 28, 0}, {229, 95, 28, 0}}}], {{0, 8}, {8, 
       0}}, {0, 255}, ColorFunction -> RGBColor], 
    BoxForm`ImageTag["Byte", ColorSpace -> "RGB", 
     Interleaving -> True, Magnification -> Automatic], 
    Selectable -> False], DefaultBaseStyle -> "ImageGraphics", 
   ImageSizeRaw -> {8, 8}, PlotRange -> {{0, 8}, {0, 8}}, 
   ImageSize -> {8, 9}];

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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