While Mathematica doesn't support tabbed notebook windows directly, it is possible to reproduce something of the effect using DockedCells
. The Virtual Book/Function Navigator interface (from the help menu) does this...it's essentially a slide show with two slides, one holding the VB and the other containing the FN, with a DockedCells
navigation interface driven by NotebookFind
that looks a bit like tabs.
Here's the gist of how you might go about making such a notebook on your own. Sorry, there are some kind of advanced concepts here...if there's any parts of this solution which you want to learn more about, maybe you can spin off more questions.
(* make a single page of the notebook *)
page[tag_String] :=
Cell@CellGroupData[{Cell["", "SlideShowNavigationBar",
CellTags -> {tag}], Cell[tag, "Title"]}];
(* make a single tab-like button which selects the page *)
button[tag_String] :=
Button[Dynamic[
Setter[Dynamic[
CurrentValue[EvaluationNotebook[], {TaggingRules, "page"},
tag]], tag]],
CurrentValue[EvaluationNotebook[], {TaggingRules, "page"}] = tag;
NotebookLocate[tag],
Appearance -> None];
(* make a notebook based upon a list of strings which are names of tabs *)
makeTabbedNotebook[nameList_List] :=
NotebookPut@Notebook[page /@ nameList,
DockedCells ->
ToBoxes[ExpressionCell[Row[button /@ nameList],
"DockedCell"]][[1]],
ScreenStyleEnvironment -> "SlideShow"];
makeTabbedNotebook[{"First", "Second", "Third"}]
Edit: changed NotebookFind[ButtonNotebook[],tag,All,CellTags]
, which appears to not always scroll the slideshow correctly, to NotebookLocate[tag]
. See discussion in comments. The two bits of code should, in theory, be equivalent, but a bug in Mathematica 8 appears to make them behave differently sometimes.
Palettes
menu and selectSlide Show
). – DeforcePaletteNotebook@ DynamicModule[{nb}, Dynamic[nb = SelectedNotebook[]; SetterBar[Dynamic[nb, (SetSelectedNotebook[#]) &], SortBy[Thread[ Notebooks[] -> NotebookTools`NotebookName /@ Notebooks[]], Last]]]]
– AmphigoryNotebookTools
context? – Cowpoke?*`Notebook*
or something like that. Much of it is identical to the (documented)AuthorTools
package, see https://mcmap.net/q/661266/-steps-to-compare-notebooks-in-workbench/695132 – Amphigory?NotebookTools'*
and thought some of the functions looked familiar. I used to useAuthorTools
a lot many years ago. – Cowpoke?*`Notebook*
and found your gold mine -- but I'm having trouble actually getting to the namespaces:NotebookTools`
shows up in the result of?*`Notebook*
, butNeeds["NotebookTools`"]
producesNeeds::nocont: Context NotebookTools
\ was not created when Needs was evaluated.` so it's hiding somewhere. DittoGet...
Clues? – ExecutrixNotebookTools`NotebookName[]
and notNotebookName[]
. You can read about contexts here. Of course you can addNotebookTools`
to$ContextPath
if you really wish. But please keep in mind that all this in undocumented functionality so there's no telling what going to happen to it in the next version, or even if it works without messing anything up in the current version (I burnt myself with other functions before ...) – Amphigory