(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 63375, 1667] NotebookOptionsPosition[ 62182, 1623] NotebookOutlinePosition[ 62586, 1641] CellTagsIndexPosition[ 62543, 1638] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Mathematica 6", "Title", CellChangeTimes->{{3.39296042519936*^9, 3.392960428273781*^9}}], Cell[CellGroupData[{ Cell["Introduction", "Section", CellChangeTimes->{{3.3920175605331106`*^9, 3.392017566521722*^9}, { 3.3920204634372816`*^9, 3.392020489454693*^9}, {3.392022690820101*^9, 3.3920227125813923`*^9}, {3.392914582861912*^9, 3.392914585836189*^9}}], Cell["\<\ Mathematica 6.0 is so large and complicated that it will take a long time for \ it to be exploited to the full. The easiest way to exploit the new dynamic \ graphics capabilities is to use Manipulate. For example:\ \>", "Text", CellChangeTimes->{ 3.392017412229861*^9, {3.3920174467995696`*^9, 3.3920175125140624`*^9}, { 3.392017618326213*^9, 3.3920176463364897`*^9}, 3.3929145231260157`*^9}], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"BesselJ", "[", RowBox[{"a", ",", "x"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "20"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"a", ",", RowBox[{"{", RowBox[{ "0", ",", "1", ",", "2", ",", "3", ",", "4", ",", "5", ",", "6"}], "}"}]}], "}"}]}], "]"}]], "Input"], Cell["\<\ In effect Manipulate creates a lower level interface automatically that lets \ you explore the properties of your plot. This lower level is itself \ documented, but is somewhat less easy to exploit successfully. Here are a few \ examples of such constructions.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Creating the Virtual ", StyleBox["Mathematica", FontSlant->"Italic"], " Book" }], "Section", CellChangeTimes->{{3.3920175605331106`*^9, 3.392017566521722*^9}, 3.3929146354575405`*^9, {3.392914693370816*^9, 3.3929147222022734`*^9}, { 3.411906036370694*^9, 3.411906045403683*^9}}], Cell[TextData[{ "The following code was supplied by Thomas Muench, and was first published \ by him in comp.soft-sys.math.mathematica . If you execute the following \ code, using ", StyleBox["Mathematica", FontSlant->"Italic"], " version 6.0, a new notebook will be created, containing a copy of the ", StyleBox["Mathematica", FontSlant->"Italic"], " book for 6.0! When it is finally done, click on the new notebook and save \ it.\n\nClick the link in the top right hand corner to download the notebook \ corresponding to this page to try this code.\n\nIt may seem a little strange \ to run a notebook in order to create another notebook, but this program \ assembles the \"Virtual ", StyleBox["Mathematica", FontSlant->"Italic"], " Book\" using information that is already part of the help system of your \ ", StyleBox["Mathematica", FontSlant->"Italic"], " installation. The resultant notebook should be considered to be copyright \ WRI, and be used on the machine that contains ", StyleBox["Mathematica", FontSlant->"Italic"], ".\n\nThe corresponding physical book for the previous version of ", StyleBox["Mathematica", FontSlant->"Italic"], " \[Dash] version 5.2 \[Dash] was already very thick, so I would you to only \ print the notebook in sections." }], "Text", CellChangeTimes->{{3.4118958562023315`*^9, 3.4118959291171775`*^9}, { 3.4119041368693457`*^9, 3.411904373099027*^9}, {3.4119044289092784`*^9, 3.4119046036906013`*^9}, {3.4119046703764915`*^9, 3.4119046806011934`*^9}, { 3.4119047609967966`*^9, 3.411904761727848*^9}, {3.411906390860426*^9, 3.4119064436863856`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"fn", "=", RowBox[{"FileNames", "[", RowBox[{"\"\<*Overview.nb\>\"", ",", RowBox[{"ToFileName", "[", RowBox[{"{", RowBox[{ "$InstallationDirectory", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}], "]"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{ "Find", " ", "\"\\"", " ", "files", " ", "in", " ", "the", " ", "tutorials"}], "-", "directory"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nameList", "=", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "[", RowBox[{"[", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"-", "12"}]}], "}"}]}], "]"}], ",", RowBox[{"\"\\"", "<>", RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "[", RowBox[{"[", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"-", "4"}]}], "}"}]}], "]"}]}], ",", "#"}], "}"}], "&"}], "/@", "fn"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ "create", " ", "a", " ", "list", " ", "of", " ", "strings", " ", "needed", " ", "for", " ", "future", " ", "code"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{ RowBox[{"nameList", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "=", RowBox[{"\"\\"", "<>", RowBox[{"nameList", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}]}]}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"{", RowBox[{ "3", ",", "6", ",", "7", ",", "8", ",", "18", ",", "28", ",", "29", ",", "40", ",", "41", ",", "46", ",", "48"}], "}"}]}], "}"}]}], "]"}], ";"}], "\n", RowBox[{"(*", RowBox[{ "mark", " ", "the", " ", "chapter", " ", "not", " ", "present", " ", "in", " ", "v5", ".2", " ", "with", " ", "\"\\""}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"orderOfChapters", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "36", ",", "3", ",", "8", ",", "31", ",", "4", ",", "47", ",", "1", ",", "39", ",", "32", ",", "14", ",", "20", ",", "16", ",", "18", ",", "17", ",", "11", ",", "43"}], "}"}], ",", RowBox[{"{", RowBox[{ "10", ",", "13", ",", "35", ",", "48", ",", "22", ",", "45", ",", "9", ",", "27", ",", "38", ",", "42", ",", "44", ",", "23", ",", "12", ",", "26", ",", "15", ",", "40", ",", "41"}], "}"}], ",", RowBox[{"{", RowBox[{ "30", ",", "25", ",", "2", ",", "21", ",", "5", ",", "7", ",", "37", ",", "19", ",", "33", ",", "34", ",", "28", ",", "29", ",", "6", ",", "46", ",", "24"}], "}"}]}], "}"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{"The", " ", "file", " ", "list", " ", "is", " ", "alphabetical"}], "-", RowBox[{ "this", " ", "is", " ", "the", " ", "order", " ", "in", " ", "which", " ", "the", " ", "chapters", " ", "should", " ", "appear"}]}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"structure", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"nameList", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"orderOfChapters", "[", RowBox[{"[", "k", "]"}], "]"}]}], "}"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{ "needed", " ", "for", " ", "the", " ", "code", " ", "further", " ", "down"}], "-", RowBox[{ "represents", " ", "the", " ", "structure", " ", "of", " ", "the", " ", "Mathematica", " ", "book"}]}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"mainChapters", "=", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"The", " ", "three", " ", "main", " ", "headings"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"beautify", "[", "ugly_", "]"}], ":=", RowBox[{"StringReplace", "[", RowBox[{ RowBox[{"StringReplace", "[", RowBox[{"ugly", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"l1_", "?", "LowerCaseQ"}], "~~", RowBox[{"l2_", "?", "UpperCaseQ"}]}], "\[RuleDelayed]", RowBox[{"l1", "<>", "\"\< \>\"", "<>", "l2"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"\"\< And \>\"", "\[Rule]", "\"\< and \>\""}], ",", RowBox[{"\"\< Of \>\"", "\[Rule]", "\"\< of \>\""}], ",", RowBox[{"\"\< In \>\"", "\[Rule]", "\"\< in \>\""}], ",", RowBox[{"\"\< The \>\"", "\[Rule]", "\"\< the \>\""}], ",", RowBox[{"\"\< For \>\"", "\[Rule]", "\"\< for \>\""}]}], "}"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{ "based", " ", "on", " ", "code", " ", "by", " ", "Selwyn", " ", "Hollis"}], "-", RowBox[{"Thanks", "!"}]}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"d", "[", RowBox[{"x_", ",", RowBox[{"style_:", " ", "\"\\""}], ",", RowBox[{"margin_:", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"36", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}]}], "}"}]}]}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"sectitle", "=", RowBox[{"beautify", "[", RowBox[{"x", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"Cell", "[", RowBox[{ RowBox[{"BoxData", "[", RowBox[{"ButtonBox", "[", RowBox[{ RowBox[{"PaneSelectorBox", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"False", "\[Rule]", "sectitle"}], ",", RowBox[{"True", "\[Rule]", RowBox[{"StyleBox", "[", RowBox[{"sectitle", ",", "\"\\""}], "]"}]}]}], "}"}], ",", RowBox[{"Dynamic", "[", RowBox[{"CurrentValue", "[", "\"\\"", "]"}], "]"}]}], "]"}], ",", RowBox[{"BaseStyle", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "style"}], "}"}]}], ",", RowBox[{"ButtonData", "\[Rule]", RowBox[{"x", "[", RowBox[{"[", "2", "]"}], "]"}]}], ",", RowBox[{"ButtonNote", "\[Rule]", RowBox[{"x", "[", RowBox[{"[", "2", "]"}], "]"}]}]}], "]"}], "]"}], ",", "style", ",", RowBox[{"CellDingbat", "\[Rule]", "None"}], ",", RowBox[{"ShowGroupOpener", "\[Rule]", "True"}], ",", RowBox[{"CellMargins", "\[Rule]", "margin"}]}], "]"}]}], "]"}]}], "\n", RowBox[{"(*", RowBox[{ "Cell", " ", "representing", " ", "a", " ", "hyperlink", " ", "to", " ", "a", " ", "file"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nb", "=", RowBox[{"NotebookPut", "[", "]"}]}], ";", RowBox[{"SetOptions", "[", RowBox[{"nb", ",", RowBox[{"StyleDefinitions", "\[Rule]", RowBox[{"ToFileName", "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Open", " ", "new", " ", "Notebook"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"{", RowBox[{ RowBox[{"Cell", "[", RowBox[{ RowBox[{"Row", "[", RowBox[{"{", RowBox[{ RowBox[{"ToBoxes", "[", RowBox[{"Import", "[", RowBox[{ RowBox[{"ToFileName", "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}], ",", "\"\\"", ",", RowBox[{"ImageSize", "\[Rule]", "70"}]}], "]"}], "]"}], ",", RowBox[{"Cell", "[", RowBox[{ "\"\\"", ",", "\"\\"", ",", RowBox[{"TextAlignment", "\[Rule]", "Center"}]}], "]"}]}], "}"}], "]"}], ",", "\"\\"", ",", RowBox[{"TextAlignment", "\[Rule]", "Center"}]}], "]"}], ",", RowBox[{"Cell", "[", RowBox[{ "\"\\"", ",", "\"\\"", ",", RowBox[{"TextAlignment", "\[Rule]", "Center"}]}], "]"}]}], "}"}]}], "]"}], ";"}], "\n", RowBox[{"(*", RowBox[{"Print", " ", "the", " ", "titel"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"Cell", "[", RowBox[{ RowBox[{"StringJoin", "[", RowBox[{"Table", "[", RowBox[{"\"\\"", ",", RowBox[{"{", "k", "}"}]}], "]"}], "]"}], ",", "\"\\""}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"2", "\[LessEqual]", "k", "\[LessEqual]", "4"}], ",", RowBox[{"Do", "[", RowBox[{ RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"d", "[", "i", "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"nb1", "=", RowBox[{"NotebookOpen", "[", RowBox[{ RowBox[{"i", "[", RowBox[{"[", "3", "]"}], "]"}], ",", RowBox[{"Visible", "\[Rule]", "False"}]}], "]"}]}], "}"}], ",", RowBox[{ RowBox[{"SelectionMove", "[", RowBox[{"nb1", ",", "All", ",", "Notebook"}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{ RowBox[{"NotebookRead", "[", "nb1", "]"}], "//.", RowBox[{"{", RowBox[{ RowBox[{"\"\\"", "\[Rule]", RowBox[{"Sequence", "@@", RowBox[{"{", RowBox[{"\"\\"", ",", RowBox[{"CellDingbat", "\[Rule]", "None"}], ",", RowBox[{"ShowGroupOpener", "\[Rule]", "True"}], ",", RowBox[{"CellMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"48", ",", "0"}], "}"}], ",", "Inherited"}], "}"}]}]}], "}"}]}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"Sequence", "@@", RowBox[{"{", RowBox[{"\"\\"", ",", RowBox[{"CellDingbat", "\[Rule]", "None"}], ",", RowBox[{"ShowGroupOpener", "\[Rule]", "True"}], ",", RowBox[{"CellMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"58", ",", "0"}], "}"}], ",", "Inherited"}], "}"}]}]}], "}"}]}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"Sequence", "@@", RowBox[{"{", RowBox[{"\"\\"", ",", RowBox[{"CellDingbat", "\[Rule]", "None"}], ",", RowBox[{"ShowGroupOpener", "\[Rule]", "True"}], ",", RowBox[{"CellMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"68", ",", "0"}], "}"}], ",", "Inherited"}], "}"}]}]}], "}"}]}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"Sequence", "@@", RowBox[{"{", RowBox[{"\"\\"", ",", RowBox[{"CellDingbat", "\[Rule]", "None"}], ",", RowBox[{"ShowGroupOpener", "\[Rule]", "True"}], ",", RowBox[{"CellMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"78", ",", "0"}], "}"}], ",", "Inherited"}], "}"}]}]}], "}"}]}]}], ",", RowBox[{"ShowCellBracket", "\[Rule]", "True"}]}], "}"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"NotebookClose", "[", "nb1", "]"}]}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"structure", "[", RowBox[{"[", RowBox[{"k", "-", "1"}], "]"}], "]"}]}], "}"}]}], "]"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"k", ",", RowBox[{"Length", "[", "mainChapters", "]"}]}], "}"}]}], "]"}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{ "write", " ", "all", " ", "the", " ", "links", " ", "to", " ", "the", " ", "main", " ", "chapters"}], ",", RowBox[{ RowBox[{"as", " ", "well", " ", "as", " ", "to", " ", "sub"}], "-", "chapters"}]}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{ RowBox[{"NotebookFind", "[", RowBox[{"nb", ",", "cellsToDelete", ",", "All", ",", "CellStyle"}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"NotebookDelete", "[", "nb", "]"}]}], ",", RowBox[{"{", RowBox[{"cellsToDelete", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], "}"}]}], "]"}], ";"}], "\n", RowBox[{"(*", RowBox[{ "Delete", " ", "unnecessary", " ", "styling", " ", "cells", " ", "that", " ", "are", " ", "part", " ", "of", " ", "the", " ", "tutorial", " ", "notebooks"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"SetOptions", "[", RowBox[{"nb", ",", RowBox[{"StyleDefinitions", "\[Rule]", RowBox[{"ToFileName", "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}]}]}], "]"}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{ RowBox[{"NotebookFind", "[", RowBox[{"nb", ",", RowBox[{"StringJoin", "[", RowBox[{"Table", "[", RowBox[{"\"\\"", ",", RowBox[{"{", "k", "}"}]}], "]"}], "]"}], ",", "All"}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"SelectionMove", "[", RowBox[{"nb", ",", "All", ",", "Cell"}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"Cell", "[", RowBox[{ RowBox[{"mainChapters", "[", RowBox[{"[", "k", "]"}], "]"}], ",", "\"\\"", ",", RowBox[{"ShowGroupOpener", "\[Rule]", "True"}], ",", RowBox[{"CellMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"10", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "10"}], "}"}]}], "}"}]}], ",", RowBox[{"CellTags", "\[Rule]", RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "k", "]"}]}]}], ",", RowBox[{"CellFrame", "\[Rule]", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "6", ",", "7"}], "}"}], ",", "k"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "2"}], "}"}]}], "}"}], ",", "False"}], "]"}]}]}], "]"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"k", ",", RowBox[{"Length", "[", "mainChapters", "]"}], ",", "1", ",", RowBox[{"-", "1"}]}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Finishing", " ", "touches"}], "*)"}], "\[IndentingNewLine]", "\n", RowBox[{"(*", " ", RowBox[{"-=", RowBox[{"=", RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", "Add"}], " ", "links", " ", "to", " ", "tutorials", " ", "that", " ", "are", " ", "not", " ", "linked", " ", "yet"}], "-="}], "=", "-"}]}]}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"SelectionMove", "[", RowBox[{"nb", ",", "All", ",", "Notebook"}], "]"}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"links", "=", RowBox[{"StringCases", "[", RowBox[{ RowBox[{"ToString", "[", RowBox[{ RowBox[{"NotebookRead", "[", "nb", "]"}], ",", "InputForm"}], "]"}], ",", RowBox[{ RowBox[{"Shortest", "[", RowBox[{"(", RowBox[{ "\"\<\\\"paclet:tutorial/\>\"", "~~", "y__", "~~", "\"\<\\\"\>\""}], ")"}], "]"}], "\[RuleDelayed]", "y"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{ "Extract", " ", "all", " ", "links", " ", "to", " ", "tutorials", " ", "present", " ", "in", " ", "\"\\""}], "..."}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"linkedFiles", "=", RowBox[{"Union", "[", RowBox[{"Flatten", "[", RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"StringFreeQ", "[", RowBox[{"#", ",", RowBox[{"\"\<#\>\"", "~~", RowBox[{"DigitCharacter", "..."}]}]}], "]"}], ",", RowBox[{"#", "<>", "\"\<.nb\>\""}], ",", RowBox[{"StringCases", "[", RowBox[{"#", ",", RowBox[{ RowBox[{"(", RowBox[{"y__", "~~", "\"\<#\>\"", "~~", RowBox[{"DigitCharacter", "..."}]}], ")"}], "\[RuleDelayed]", RowBox[{"y", "<>", "\"\<.nb\>\""}]}]}], "]"}]}], "]"}], "&"}], "/@", "links"}], "]"}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{"...", " ", "and", " ", "their", " ", "filenames"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"allTutorials", "=", RowBox[{"Flatten", "[", RowBox[{ RowBox[{ RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "[", RowBox[{"[", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"-", "1"}]}], "}"}]}], "]"}], "&"}], "/@", RowBox[{"FileNames", "[", RowBox[{"\"\<*.nb\>\"", ",", RowBox[{"ToFileName", "[", RowBox[{"{", RowBox[{ "$InstallationDirectory", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}], "]"}]}], "]"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ "all", " ", "tutorials", " ", "in", " ", "the", " ", "tutorial", " ", "directory"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"notUsed", "=", RowBox[{"Complement", "[", RowBox[{"allTutorials", ",", "linkedFiles"}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ RowBox[{ "all", " ", "tutorials", " ", "not", " ", "linked", " ", "to", " ", "in", " ", "\"\\"", " ", "so", " ", "far", " ", RowBox[{"(", RowBox[{"in", " ", "alphabetical", " ", "order"}], ")"}]}], ";", RowBox[{ "these", " ", "are", " ", "76", " ", "tutorial", " ", "notebooks"}]}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nameList", "=", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "4"}]}], "}"}]}], "]"}], ",", RowBox[{"\"\\"", "<>", RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "4"}]}], "}"}]}], "]"}]}], ",", RowBox[{ RowBox[{"ToFileName", "[", RowBox[{"{", RowBox[{ "$InstallationDirectory", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}], "]"}], "<>", "#"}]}], "}"}], "&"}], "/@", "notUsed"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ "create", " ", "a", " ", "list", " ", "of", " ", "strings", " ", "needed", " ", "for", " ", "future", " ", "code"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"GettingStarted", "=", RowBox[{"{", RowBox[{"21", ",", "18", ",", "75"}], "}"}]}], ";", RowBox[{"GraphPlotting", "=", RowBox[{"{", RowBox[{"27", ",", "28", ",", "36", ",", "71"}], "}"}]}], ";", RowBox[{"MathematicaReferenceGuide", "=", RowBox[{"{", RowBox[{ "7", ",", "31", ",", "64", ",", "19", ",", "57", ",", "20", ",", "37", ",", "33", ",", "30"}], "}"}]}], ";", RowBox[{"MatrixAndVectorOperations", "=", RowBox[{"{", RowBox[{ "10", ",", "26", ",", "6", ",", "3", ",", "73", ",", "16", ",", "42", ",", "45", ",", "62", ",", "52", ",", "65", ",", "69"}], "}"}]}], ";", RowBox[{"Statistics", "=", RowBox[{"{", RowBox[{"11", ",", "15", ",", "13", ",", "58"}], "}"}]}], ";", RowBox[{"DynamicFeatures", "=", RowBox[{"{", RowBox[{"35", ",", "2", ",", "34", ",", "1"}], "}"}]}], ";", RowBox[{"SystemSpecificTopics", "=", RowBox[{"{", RowBox[{ "17", ",", "32", ",", "60", ",", "50", ",", "51", ",", "53", ",", "41", ",", "44", ",", "38", ",", "39", ",", "40"}], "}"}]}], ";", RowBox[{"FurtherNDSolveTutorials", "=", RowBox[{"{", RowBox[{"46", ",", "47", ",", "48", ",", "49"}], "}"}]}], ";", RowBox[{"FrontendAndFormattingTopics", "=", RowBox[{"{", RowBox[{ "5", ",", "22", ",", "24", ",", "25", ",", "29", ",", "67", ",", "70", ",", "74"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"topics", "=", RowBox[{"{", RowBox[{ "GettingStarted", ",", "MathematicaReferenceGuide", ",", "GraphPlotting", ",", "MatrixAndVectorOperations", ",", "Statistics", ",", "DynamicFeatures", ",", "SystemSpecificTopics", ",", "FurtherNDSolveTutorials", ",", "FrontendAndFormattingTopics"}], "}"}]}], ";"}], "\n", RowBox[{ RowBox[{"FurtherTopics", "=", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "notUsed", "]"}], "]"}], ",", RowBox[{"Flatten", "[", "topics", "]"}]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"topics", "=", RowBox[{"Join", "[", RowBox[{"topics", ",", RowBox[{"{", "FurtherTopics", "}"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ "trying", " ", "to", " ", "get", " ", "some", " ", "order", " ", "into", " ", "these", " ", "tutorials"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"topicNames", "=", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]"}], "\n", RowBox[{ RowBox[{"NotebookFind", "[", RowBox[{"nb", ",", "\"\\"", ",", "After", ",", "CellTags"}], "]"}], ";", RowBox[{"SelectionMove", "[", RowBox[{"nb", ",", "After", ",", "Cell"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"d", "[", RowBox[{ RowBox[{"nameList", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "\"\\"", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"48", ",", "0"}], "}"}], ",", "Inherited"}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "GettingStarted"}], "}"}]}], "]"}], ";"}], "\n", RowBox[{"(*", RowBox[{ "Add", " ", "links", " ", "to", " ", "\"\\"", " ", "topics"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NotebookFind", "[", RowBox[{"nb", ",", "\"\\"", ",", "After", ",", "CellTags"}], "]"}], ";", RowBox[{"SelectionMove", "[", RowBox[{"nb", ",", "After", ",", "Cell"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"d", "[", RowBox[{ RowBox[{"nameList", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "\"\\"", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"48", ",", "0"}], "}"}], ",", "Inherited"}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "MathematicaReferenceGuide"}], "}"}]}], "]"}], ";"}], "\n", RowBox[{"(*", RowBox[{ "Add", " ", "links", " ", "to", " ", "\"\\"", " ", "topics"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NotebookFind", "[", RowBox[{"nb", ",", "\"\\"", ",", "After", ",", "CellTags"}], "]"}], ";", RowBox[{"SelectionMove", "[", RowBox[{"nb", ",", "After", ",", "Cell"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"Cell", "[", RowBox[{ RowBox[{"topicNames", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "\"\\"", ",", RowBox[{"CellDingbat", "\[Rule]", "None"}], ",", RowBox[{"ShowGroupOpener", "\[Rule]", "True"}], ",", RowBox[{"CellMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"36", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}]}], "}"}]}]}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"Do", "[", RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"d", "[", RowBox[{ RowBox[{"nameList", "[", RowBox[{"[", "k", "]"}], "]"}], ",", "\"\\"", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"48", ",", "0"}], "}"}], ",", "Inherited"}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", RowBox[{"topics", "[", RowBox[{"[", "i", "]"}], "]"}]}], "}"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "3", ",", RowBox[{"Length", "[", "topics", "]"}]}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Add", " ", "links", " ", "to", " ", "all", " ", "other", " ", "topics"}], "*)"}], "\[IndentingNewLine]", "\n", RowBox[{"(*", " ", RowBox[{"-=", RowBox[{"=", RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", "Add"}], " ", "links", " ", "to", " ", "Packages"}], "-="}], "=", "-"}]}]}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"fnpdir", "=", RowBox[{"FileNames", "[", RowBox[{"\"\<*\>\"", ",", RowBox[{"ToFileName", "[", RowBox[{"{", RowBox[{ "$InstallationDirectory", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}], "]"}]}], "]"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ "Directory", " ", "names", " ", "of", " ", "the", " ", "Packages"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"fnptut", "=", RowBox[{ RowBox[{ RowBox[{"FileNames", "[", RowBox[{"\"\<*.nb\>\"", ",", RowBox[{"ToFileName", "[", RowBox[{"{", RowBox[{ "#", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}], "]"}], ",", "Infinity"}], "]"}], "&"}], "/@", "fnpdir"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ "tutorial", " ", "notebooks", " ", "of", " ", "the", " ", "Packages"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"fnpguid", "=", RowBox[{ RowBox[{ RowBox[{"FileNames", "[", RowBox[{"\"\<*.nb\>\"", ",", RowBox[{"ToFileName", "[", RowBox[{"{", RowBox[{ "#", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}], "]"}], ",", "Infinity"}], "]"}], "&"}], "/@", "fnpdir"}]}], ";"}], "\n", RowBox[{"(*", RowBox[{ "guide", " ", "notebooks", " ", "of", " ", "the", " ", "Packages"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NotebookFind", "[", RowBox[{"nb", ",", "\"\\"", ",", "After", ",", "CellTags"}], "]"}], ";", RowBox[{"SelectionMove", "[", RowBox[{"nb", ",", "After", ",", "Cell"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Do", "[", RowBox[{ RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"packageName", "=", RowBox[{ RowBox[{ RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "[", RowBox[{"[", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"-", "1"}]}], "}"}]}], "]"}], "&"}], "@", RowBox[{"fnpdir", "[", RowBox[{"[", "package", "]"}], "]"}]}]}], "}"}], ",", RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"Cell", "[", RowBox[{ RowBox[{"beautify", "@", "packageName"}], ",", "\"\\"", ",", RowBox[{"CellDingbat", "\[Rule]", "None"}], ",", RowBox[{"ShowGroupOpener", "\[Rule]", "True"}], ",", RowBox[{"CellMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"36", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}]}], "}"}]}]}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Length", "[", RowBox[{"fnptut", "[", RowBox[{"[", "package", "]"}], "]"}], "]"}], ">", "0"}], ",", RowBox[{ RowBox[{"level", "=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringTake", "[", RowBox[{ RowBox[{"fnptut", "[", RowBox[{"[", "package", "]"}], "]"}], ",", RowBox[{ RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "1"}]}], "}"}], "+", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"Take", "[", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", RowBox[{"-", "1"}]}], "}"}]}], "]"}], "&"}], "@", RowBox[{"Transpose", "[", RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "]"}]}], "&"}], "/@", RowBox[{"fnptut", "[", RowBox[{"[", "package", "]"}], "]"}]}], ")"}], "[", RowBox[{"[", "1", "]"}], "]"}]}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}], "\[Equal]", "\"\\""}], ",", "1", ",", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nameList", "=", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"\"\\"", "<>", RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "[", RowBox[{"[", RowBox[{ RowBox[{"-", "level"}], ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"-", "4"}]}], "}"}]}], "]"}]}], ",", RowBox[{ "\"\\"", "<>", "packageName", "<>", "\"\\"", "<>", RowBox[{"StringReplace", "[", RowBox[{ RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "[", RowBox[{"[", RowBox[{ RowBox[{"-", "level"}], ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"-", "4"}]}], "}"}]}], "]"}], ",", RowBox[{"\"\<\\\\\>\"", "\[Rule]", "\"\\""}]}], "]"}]}]}], "}"}], "&"}], "/@", RowBox[{"fnptut", "[", RowBox[{"[", "package", "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Do", "[", RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"d", "[", RowBox[{ RowBox[{"nameList", "[", RowBox[{"[", "k", "]"}], "]"}], ",", "\"\\"", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"48", ",", "0"}], "}"}], ",", "Inherited"}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", RowBox[{"Length", "[", RowBox[{"fnptut", "[", RowBox[{"[", "package", "]"}], "]"}], "]"}]}], "}"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Length", "[", RowBox[{"fnpguid", "[", RowBox[{"[", "package", "]"}], "]"}], "]"}], ">", "0"}], ",", RowBox[{ RowBox[{"level", "=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringTake", "[", RowBox[{ RowBox[{"fnpguid", "[", RowBox[{"[", "package", "]"}], "]"}], ",", RowBox[{ RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "1"}]}], "}"}], "+", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"Take", "[", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", RowBox[{"-", "1"}]}], "}"}]}], "]"}], "&"}], "@", RowBox[{"Transpose", "[", RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "]"}]}], "&"}], "/@", RowBox[{"fnpguid", "[", RowBox[{"[", "package", "]"}], "]"}]}], ")"}], "[", RowBox[{"[", "1", "]"}], "]"}]}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}], "\[Equal]", "\"\\""}], ",", "1", ",", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nameList", "=", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"\"\\"", "<>", RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "[", RowBox[{"[", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"-", "4"}]}], "}"}]}], "]"}]}], ",", RowBox[{ "\"\\"", "<>", "packageName", "<>", "\"\\"", "<>", RowBox[{"StringReplace", "[", RowBox[{ RowBox[{"StringTake", "[", RowBox[{"#", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StringPosition", "[", RowBox[{"#", ",", "$PathnameSeparator"}], "]"}], "[", RowBox[{"[", RowBox[{ RowBox[{"-", "level"}], ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"-", "4"}]}], "}"}]}], "]"}], ",", RowBox[{"\"\<\\\\\>\"", "\[Rule]", "\"\\""}]}], "]"}]}]}], "}"}], "&"}], "/@", RowBox[{"fnpguid", "[", RowBox[{"[", "package", "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Do", "[", RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb", ",", RowBox[{"d", "[", RowBox[{ RowBox[{"nameList", "[", RowBox[{"[", "k", "]"}], "]"}], ",", "\"\\"", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"48", ",", "0"}], "}"}], ",", "Inherited"}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", RowBox[{"Length", "[", RowBox[{"fnpguid", "[", RowBox[{"[", "package", "]"}], "]"}], "]"}]}], "}"}]}], "]"}]}]}], "]"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"package", ",", RowBox[{"Length", "[", "fnpdir", "]"}]}], "}"}]}], "]"}], ";"}], "\n", RowBox[{"(*", RowBox[{ "Add", " ", "links", " ", "to", " ", "package", " ", "tutorials", " ", "and", " ", "guides"}], "*)"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"SelectionMove", "[", RowBox[{"nb", ",", "All", ",", "Notebook"}], "]"}], ";", RowBox[{"FrontEndExecute", "[", RowBox[{"FrontEndToken", "[", "\"\\"", "]"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"FrontEndExecute", "[", RowBox[{"FrontEndToken", "[", "\"\\"", "]"}], "]"}], ";"}], "\n"}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Adding points to a graph with the mouse", "Section", CellChangeTimes->{{3.3920175605331106`*^9, 3.392017566521722*^9}, 3.3929146354575405`*^9, {3.392914693370816*^9, 3.3929147222022734`*^9}}], Cell["\<\ The following code creates a graph that can be populated by clicking where \ you need a point. There is a guide at the bottom of the display to indicate \ exactly where the mouse is positioned, and you can display a small menu by \ performing a Shift-click. This enables you to remove a point.\ \>", "Text"], Cell[BoxData[ RowBox[{" ", RowBox[{ RowBox[{ RowBox[{"dataPoints", "=", RowBox[{"{", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}], "}"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"deletePoint", "[", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "s", "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"s", "=", RowBox[{"Nearest", "[", RowBox[{"dataPoints", ",", "currentPoint"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"s", "=!=", RowBox[{"{", "}"}]}], ",", RowBox[{"dataPoints", "=", RowBox[{"DeleteCases", "[", RowBox[{"dataPoints", ",", RowBox[{"s", "[", RowBox[{"[", "1", "]"}], "]"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"extras", "=", RowBox[{"{", "}"}]}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"processClick", "[", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"extras", "=!=", RowBox[{"{", "}"}]}], ",", RowBox[{"Return", "[", "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"currentPoint", "=", RowBox[{"MousePosition", "[", RowBox[{"\"\\"", ",", "Graphics"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"CurrentValue", "[", "\"\\"", "]"}], ",", "\[IndentingNewLine]", RowBox[{"extras", "=", RowBox[{"Inset", "[", RowBox[{ RowBox[{"ActionMenu", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{ RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"deletePoint", "[", "]"}]}], ",", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"(", RowBox[{"extras", "=", RowBox[{"{", "}"}]}], ")"}]}]}], "}"}]}], "]"}], ",", "currentPoint", ",", RowBox[{"{", RowBox[{"Left", ",", "Top"}], "}"}]}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"extras", "=", RowBox[{"{", "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"dataPoints", "=", RowBox[{"Append", "[", RowBox[{"dataPoints", ",", RowBox[{"MousePosition", "[", RowBox[{"\"\\"", ",", "Graphics"}], "]"}]}], "]"}]}]}]}], "\[IndentingNewLine]", "]"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"pt1", "=", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Antialiasing", "\[Rule]", "False"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"10", ",", "10"}], "}"}]}]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"extras", "=", RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Column", "[", RowBox[{"{", RowBox[{ RowBox[{"EventHandler", "[", RowBox[{ RowBox[{"Dynamic", "[", RowBox[{"Deploy", "[", RowBox[{"ListPlot", "[", RowBox[{"dataPoints", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "6"}], "}"}]}], "}"}]}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"800", ",", "600"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"PlotMarkers", "\[Rule]", "pt1"}], ",", RowBox[{"Epilog", "\[Rule]", RowBox[{"Dynamic", "[", "extras", "]"}]}]}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\"\\"", ",", "1"}], "}"}], "\[RuleDelayed]", RowBox[{"processClick", "[", "]"}]}], "}"}], ",", RowBox[{"PassEventsDown", "\[Rule]", "True"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"SequenceForm", "[", RowBox[{ "\"\\"", ",", RowBox[{"Dynamic", "[", RowBox[{"MousePosition", "[", RowBox[{"\"\\"", ",", "Graphics"}], "]"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], "]"}]}]}]], "Input"], Cell["\<\ This code could be elaborated, but as with my SWP examples, I want to show \ something that can help jump - start your own development.I have also not \ wrapped this construction in a DynamicModule \[Dash] again to keep it easy to \ read.\ \>", "Text", CellChangeTimes->{{3.392914855303664*^9, 3.3929148851766195`*^9}}], Cell["\<\ Notice in particular that the variable' extras' starts out as an empty list \ and is displayed dynamically, so that the menu control can be added and \ removed as required.\ \>", "Text", CellChangeTimes->{{3.392914855303664*^9, 3.3929148851766195`*^9}}], Cell["\<\ This example obviously bears a strong resemblance to example 1 for the Super \ Widget Package! In that example, I used right mouse clicks to activate a \ context menu.Although it is possible to trap the right mouse with Mathematica \ 6, I found that trapping Shift - click seemed more reliable.\ \>", "Text", CellChangeTimes->{3.392914855303664*^9}] }, Open ]], Cell[CellGroupData[{ Cell["General purpose graphic zoom palette", "Section", CellChangeTimes->{{3.3920175605331106`*^9, 3.392017566521722*^9}, 3.3929146354575405`*^9, {3.392914693370816*^9, 3.3929147222022734`*^9}, { 3.392915053608813*^9, 3.392915072065352*^9}}], Cell[TextData[{ "This is an example, kindly provided by Daniel Huber of Metohm Ltd. It \ creates a palette which can be used to zoom into any 2D graphics object in a \ notebook. Run the code to create the palette, then select any graphics object \ by clicking on it, and press the zoom button to view an enlarged version in a \ separate (temporary) notebook. This example uses the fact that graphics \ objects in 6.0 have the same structure in the FrontEnd as they do in the \ kernel \[Dash] and can thus be picked out of a notebook and manipulated \ further. For this reason, you cannot expand graphics created with ", StyleBox["Mathematica", FontSlant->"Italic"], " version 5.2 or earlier." }], "Text", CellChangeTimes->{{3.392915094347392*^9, 3.3929153413826113`*^9}, { 3.392915427917042*^9, 3.3929155016430545`*^9}}], Cell["\<\ You will see the graphics displayed twice in the temporary notebook. Use the \ two locators in the top graphic to selected the rectangular zoom region to be \ displayed in the second window. Note that the temporary notebook can be \ stretched or maximised as desired.\ \>", "Text", CellChangeTimes->{{3.392915641233776*^9, 3.3929157648214865`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"Zoom2D", "[", "g0_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"g", ",", "pp1", ",", "pp2"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"!", RowBox[{"MatchQ", "[", RowBox[{ RowBox[{"Head", "[", "g0", "]"}], ",", RowBox[{"Graphics", "|", "GraphicsBox"}]}], "]"}]}], ",", RowBox[{ RowBox[{"CreateDialog", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ "TextCell", "[", "\"\\"", "]"}], ",", "\[IndentingNewLine]", RowBox[{"DefaultButton", "[", "]"}]}], "\[IndentingNewLine]", "}"}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"Return", "[", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"g", "=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Head", "[", "g0", "]"}], "=!=", "Graphics"}], ",", "\[IndentingNewLine]", RowBox[{"Replace", "[", RowBox[{"g0", ",", RowBox[{ RowBox[{"head_", "[", RowBox[{"x1_", ",", "x2___"}], "]"}], "\[RuleDelayed]", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", "x1", "}"}], ",", RowBox[{"{", "x2", "}"}]}], "]"}]}]}], "]"}], ",", "\[IndentingNewLine]", "g0"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"g", "=", RowBox[{"g", "/.", RowBox[{ RowBox[{"NCache", "[", RowBox[{"_", ",", "x_"}], "]"}], "\[RuleDelayed]", "x"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"pp1", ",", "pp2"}], "}"}], "=", RowBox[{ RowBox[{"FullOptions", "[", RowBox[{"g", ",", "PlotRange"}], "]"}], "//", "Transpose"}]}], ";", "\[IndentingNewLine]", RowBox[{"g1", "=", RowBox[{"DynamicModule", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p1", "=", "pp1"}], ",", RowBox[{"p2", "=", "pp2"}], ",", RowBox[{"lp", "=", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}]}], "}"}], ",", RowBox[{"Column", "[", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"LocatorPane", "[", RowBox[{ RowBox[{"Dynamic", "[", RowBox[{"{", RowBox[{"p1", ",", "p2"}], "}"}], "]"}], ",", RowBox[{"Show", "[", RowBox[{ RowBox[{"{", RowBox[{"g", ",", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"Opacity", "[", "0.1", "]"}], ",", RowBox[{"Rectangle", "[", RowBox[{ RowBox[{"Dynamic", "[", "p1", "]"}], ",", RowBox[{"Dynamic", "[", "p2", "]"}]}], "]"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", "Small"}]}], "]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"EventHandler", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{"g", ",", RowBox[{"PlotRange", "\[RuleDelayed]", RowBox[{"Dynamic", "[", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"p1", ",", "p2"}], "}"}], "]"}], "]"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"ImageSize", "\[Rule]", "Full"}]}], "]"}], ",", RowBox[{"{", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"(", RowBox[{"lp", "=", RowBox[{"MousePosition", "[", "\"\\"", "]"}]}], ")"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Dynamic", "[", "lp", "]"}]}], "\[IndentingNewLine]", "}"}], ",", "Center"}], "]"}]}], "\[IndentingNewLine]", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"CreateDocument", "[", RowBox[{"g1", ",", RowBox[{"WindowSize", "\[Rule]", RowBox[{"{", RowBox[{"Small", ",", "All"}], "}"}]}], ",", RowBox[{"WindowTitle", "\[Rule]", "\"\\""}], ",", RowBox[{"WindowElements", "\[Rule]", RowBox[{"{", "}"}]}], ",", RowBox[{"WindowFrame", "\[Rule]", "\"\\""}], ",", RowBox[{"BoxForm`ClosingSaveDialog", "\[Rule]", "False"}]}], "]"}], ";"}]}], "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]"}], "\n", RowBox[{ RowBox[{"CreatePalette", "[", RowBox[{ RowBox[{"Button", "[", RowBox[{"\"\\"", ",", RowBox[{"Zoom2D", "[", RowBox[{"NotebookRead", "[", RowBox[{"SelectedNotebook", "[", "]"}], "]"}], "]"}]}], "]"}], ",", RowBox[{"WindowTitle", "\[Rule]", "\"\<\>\""}]}], "]"}], ";"}], "\n"}], "Input", CellChangeTimes->{{3.3929598274798813`*^9, 3.392959898672251*^9}, 3.3929599295266175`*^9, 3.392959981841843*^9, {3.392960014779205*^9, 3.3929600684463744`*^9}, {3.39296010048244*^9, 3.3929601032163715`*^9}}], Cell[TextData[{ "It is important to realise that the graph is not re-creted each time it is \ zoomed, so for example, you may end up with too few sample points on a graph \ created using Plot. Note that because ", StyleBox["Mathematica", FontSlant->"Italic"], " adds axes to a plot automatically, the axes on the zoomed plot ", StyleBox["do", FontVariations->{"Underline"->True}], " reflect the zoomed ranges." }], "Text", CellChangeTimes->{{3.3929157729531794`*^9, 3.392915802485645*^9}, { 3.392915836424446*^9, 3.3929158876280737`*^9}, {3.3929602900650463`*^9, 3.392960351703678*^9}}] }, Open ]] }, Open ]] }, WindowSize->{1037, 750}, WindowMargins->{{Automatic, 29}, {-67, Automatic}}, ShowSelection->True, ShowCellLabel->False, Magnification->1, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (June 19, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 95, 1, 83, "Title"], Cell[CellGroupData[{ Cell[710, 28, 247, 3, 71, "Section"], Cell[960, 33, 408, 7, 47, "Text"], Cell[1371, 42, 437, 14, 31, "Input"], Cell[1811, 58, 284, 5, 47, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[2132, 68, 308, 8, 71, "Section"], Cell[2443, 78, 1620, 34, 173, "Text"], Cell[4066, 114, 43163, 1133, 3312, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[47266, 1252, 202, 2, 71, "Section"], Cell[47471, 1256, 317, 5, 47, "Text"], Cell[47791, 1263, 5537, 147, 472, "Input"], Cell[53331, 1412, 330, 6, 47, "Text"], Cell[53664, 1420, 264, 5, 29, "Text"], Cell[53931, 1427, 360, 6, 47, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[54328, 1438, 249, 3, 71, "Section"], Cell[54580, 1443, 828, 14, 83, "Text"], Cell[55411, 1459, 359, 6, 47, "Text"], Cell[55773, 1467, 5777, 137, 572, "Input"], Cell[61553, 1606, 601, 13, 47, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)