(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 33265, 993]*) (*NotebookOutlinePosition[ 36830, 1093]*) (* CellTagsIndexPosition[ 36753, 1087]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Front End Frontiers", "Title"], Cell["Commands and Tokens", "Subtitle"], Cell["by Louis J. D\[CloseCurlyQuote]Andria", "Subsubtitle"], Cell[TextData[{ "The ", StyleBox["Mathematica", FontSlant->"Italic"], " front end is a ", StyleBox["MathLink", FontSlant->"Italic"], " application, inside and out. With every menu selection and keystroke, the \ front end performs some ", StyleBox["MathLink", FontSlant->"Italic"], " operation. This column will explore the various methods of controlling \ the front end by sending it ", StyleBox["MathLink", FontSlant->"Italic"], " commands, such as writing a kernel program to perform a sequence of \ actions that would typically be invoked from the menus or from the keyboard." }], "Text"], Cell[CellGroupData[{ Cell["Commands", "Section"], Cell[TextData[{ "The usual method for scripting some front end actions is to use the \ notebook commands that are built into the kernel. These commands include ", StyleBox["NotebookApply", "Output"], ", ", StyleBox["NotebookOpen", "Output"], ", and ", StyleBox["NotebookPut", "Output"], ", which are documented in the ", StyleBox["Mathematica", FontSlant->"Italic"], " book [Wol] and the help browser. Here is a list of the most often used \ notebook functions" }], "Text"], Cell[BoxData[GridBox[{ {"ButtonNotebook", "NotebookFind", "NotebookSave"}, {"CellPrint", "NotebookGet", "NotebookWrite"}, {"EvaluationNotebook", "NotebookLocate", "Options"}, {"InputNotebook", "NotebookOpen", "SelectedNotebook"}, {"NotebookApply", "NotebookPrint", "SelectionMove"}, {"NotebookClose", "NotebookPut", "SetOptions"}, {"NotebookCreate", "NotebookRead", "SetSelectedNotebook"}, {"NotebookDelete", "Notebooks", "StylePrint"} }]], "Input", FontWeight->"Plain", GridBoxOptions->{ColumnAlignments->{Left}}], Cell[TextData[{ "Given a handful of examples [Wol \[Section]2.10.3], it is not hard to see \ how these functions work. There is typically a target notebook \[LongDash] \ usually one of ", StyleBox["ButtonNotebook", "Output"], ", ", StyleBox["EvaluationNotebook", "Output"], ", ", StyleBox["InputNotebook", "Output"], ", or ", StyleBox["SelectedNotebook", "Output"], " \[LongDash] and the function either performs some action on that notebook \ or reads information from it. Here is a simple script that copies all of the \ input cells from one notebook into a new, untitled notebook." }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"nb", "=", RowBox[{"NotebookOpen", "[", "\"\\"", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NotebookFind", "[", RowBox[{ "nb", ",", " ", "\"\\"", ",", " ", "All", ",", " ", "CellStyle"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"inputCells", "=", RowBox[{"NotebookRead", "[", "nb", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"nb2", "=", RowBox[{"NotebookCreate", "[", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NotebookWrite", "[", RowBox[{"nb2", ",", "inputCells"}], "]"}], ";"}]}], "Input"], Cell[TextData[{ "For many applications, this set of commands is sufficient. Indeed, books \ and articles are starting to appear which exhibit uses of notebook commands \ ([Abb], [GD], [GG], [Mae]). However, notice that this scripting language does \ not draw upon existing knowledge of ", StyleBox["using", FontSlant->"Italic"], " the front end with a keyboard and mouse. In order to do the above task by \ hand, one would simply use copy and paste from the ", StyleBox["Edit", FontFamily->"Helvetica"], " menu, or the keyboard shortcuts for those menu commands." }], "Text"], Cell["\<\ There is another approach to notebook programming that uses \ familiarity of the menus and keyboard in order to make scripting more \ natural: tokens.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Tokens", "Section"], Cell[TextData[{ "A ", StyleBox["token", FontSlant->"Italic"], " is a string which the front end associates with some action. They are \ sometimes referred to as ", StyleBox["command tokens", FontSlant->"Italic"], " to distinguish them from parsing tokens [Wol \[Section]2.8.14]. ", "Most menu commands and keyboard commands have a command token associated \ with them. When a menu item is selected, or a set of keys is depressed, the \ front end initiates the token\[CloseCurlyQuote]s action. A token\ \[CloseCurlyQuote]s action can also be initiated by sending it from the \ kernel with this template," }], "Text"], Cell[BoxData[ RowBox[{"FrontEndTokenExecute", "[", "\"\\"", "]"}]], "Input"], Cell["\<\ or even direct a token\[CloseCurlyQuote]s action to a particular \ notebook with this template.\ \>", "Text"], Cell[BoxData[ RowBox[{"FrontEndTokenExecute", "[", RowBox[{"nbObject", ",", "\"\\""}], "]"}]], "Input"], Cell[TextData[{ "It only remains to determine which tokens correspond to the desired menu \ and keyboard commands. Starting with ", StyleBox["Mathematica", FontSlant->"Italic"], " version 3, there is a resource file \[LongDash] MenuSetup.tr \[LongDash] \ containing the front end menu tree in ", StyleBox["Mathematica", FontSlant->"Italic"], " expression form, which is read every time ", StyleBox["Mathematica", FontSlant->"Italic"], " launches. Embedded in that menu tree are the command tokens associated \ with each menu command, as well as the keyboard equivalents for those \ commands. Here are a few lines from the Windows version of that resource \ file:" }], "Text"], Cell["\<\ Item[\"&New\", \"New\", MenuKey[\"n\", Modifiers->{Control}]] Item[\"&Copy\", \"Copy\", MenuKey[\"c\", Modifiers->{Control}]] Item[\"&Paste\", Paste[After], MenuKey[\"v\", Modifiers->{Control}]]\ \>", \ "Input", FontWeight->"Plain"], Cell[TextData[{ "The relevant aspects of this syntax are: each ", StyleBox["Item", "Output"], " expression contains information for a single menu item, and the second \ argument is the token or other expression that the front end will execute \ when the menu item is selected. (Further examples of the syntax of ", StyleBox["Item", "Output"], " can be found in [Abb].) Thus, the token ", StyleBox["\"New\"", "Output"], " corresponds to the ", StyleBox["File \[RightTriangle] New", FontFamily->"Helvetica"], " menu item, and ", StyleBox["\"Copy\"", "Output"], " corresponds to ", StyleBox["Edit \[RightTriangle] Copy", FontFamily->"Helvetica"], ". To imitate these menu items, call the tokens directly from the kernel \ following the above template." }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"FrontEndTokenExecute", "[", "\"\\"", "]"}], ";"}], "\n", RowBox[{ RowBox[{"FrontEndTokenExecute", "[", "\"\\"", "]"}], ";"}]}], "Input"], Cell[TextData[{ "As for paste, ", StyleBox["Paste[After]", "Output"], " is an example of a ", StyleBox["compound token", FontSlant->"Italic"], ", or a token with a ", StyleBox["parameter", FontSlant->"Italic"], ". To call a compound token from the kernel, specify the target notebook as \ the first argument, and the token and its parameter as second and third \ arguments, to ", StyleBox["FrontEndTokenExecute", "Output"], ":" }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"FrontEndTokenExecute", "[", RowBox[{"nbObject", ",", "\"\\"", ",", " ", "\"\\""}], "]"}], ";"}]], "Input"], Cell[TextData[{ "That's all there is to it. Knowledge of tokens will allow a kernel program \ to imitate selecting over 90% of the menu items in ", StyleBox["Mathematica", FontSlant->"Italic"], "." }], "Text"], Cell["\<\ Not all tokens are listed in MenuSetup.tr. There is another \ resource file \[LongDash] KeyEventTranslations.tr \[LongDash] which defines \ keyboard shortcuts not associated with a menu item, or additional shortcuts \ for a menu item. For reference, lists of tokens extracted from these resource \ files appear at the end of this column. There are other tokens not listed in \ either of these resource files. As of this writing, there is no way to query \ the front end for a complete listing of tokens which it accepts.\ \>", "Text"], Cell[TextData[{ "The kernel command ", StyleBox["FrontEndTokenExecute", "Output"], " is actually a shorthand for the following, more verbose command:" }], "Text"], Cell[BoxData[ RowBox[{"FrontEndExecute", "[", RowBox[{"{", RowBox[{"FrontEnd`FrontEndToken", "[", "args__", "]"}], "}"}], "]"}]], "Input"], Cell[TextData[{ "To call tokens in buttons, use the above form as the button\ \[CloseCurlyQuote]s function. Such buttons do not require the kernel and so \ can have ", StyleBox["ButtonEvaluator\[Rule]None", "Output"], ", as discussed last time. For example, evaluating the following code will \ create a button that, when clicked, causes any initialization cells in its \ notebook to evaluate:" }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"ButtonBox", "[", RowBox[{"\"\\"", ",", "\[IndentingNewLine]", RowBox[{"ButtonFunction", "\[RuleDelayed]", RowBox[{"FrontEndExecute", "[", RowBox[{"{", RowBox[{ "FrontEnd`FrontEndToken", "[", "\"\\"", "]"}], "}"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"ButtonEvaluator", "\[Rule]", "None"}], ",", "\[IndentingNewLine]", RowBox[{"Active", "\[Rule]", "True"}]}], "]"}], "//", "DisplayForm"}]], "Input"], Cell["See [DW] for another example of tokens in buttons.", "Text"], Cell[TextData[{ "When using tokens for automation, it is important to note that several of \ them are unsuitable because they bring up dialog boxes. For example, the ", StyleBox["\"Open\"", "Output"], " token brings up a file open dialog, which requires user interaction. \ There is currently no way to interact with such a dialog using ", StyleBox["Mathematica", FontSlant->"Italic"], " or ", StyleBox["MathLink", FontSlant->"Italic"], " commands, so this is effectively a dead end for automation. It is \ sometimes possible to perform the same action in another way that ", StyleBox["can", FontSlant->"Italic"], " be automated \[LongDash] in the case of opening files, the ", StyleBox["NotebookOpen", "Output"], " command can be used instead of the ", StyleBox["\"Open\"", "Output"], " token." }], "Text"], Cell[TextData[{ "Another common use for tokens is to set cell options and styles. For \ example, when a cell is selected, choosing the menu item ", StyleBox["Format \[RightTriangle] TextAlignment \[RightTriangle] Align \ Center", FontFamily->"Helvetica"], " activates the compound token ", StyleBox["{\"TextAlignment\", \"Center\"},", "Output"], " which is essentially a shorthand for ", StyleBox["SetOptions[NotebookSelection[InputNotebook[]], TextAlignment -> \ Center]", "Output"], ". On the other hand, there is no simple command to replace the compound \ token which changes cell styles, such as ", StyleBox["{\"Style\", \"Title\"}", "Output"], ". " }], "Text"], Cell[TextData[{ "Most menu items are identical on all platforms that ", StyleBox["Mathematica", FontSlant->"Italic"], " supports. Likewise, the tokens which underlie those menu items are \ identical, and can be used in platform independent programs. However, there \ are a small number of tokens which are platform specific, and so should be \ used with caution when developing solutions for multiple platforms. Tokens \ such as ", StyleBox["\"XInfoDialog\"", "Output"], " and ", StyleBox["{\"SelectionConvert\", \"Metafile\"}", "Output"], " rely on functionality built into the OS, which differs from platform to \ platform." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Packets", "Section"], Cell[TextData[{ "For the most part, knowledge of commands and tokens will be enough to use \ the notebook programming capabilities of ", StyleBox["Mathematica", FontSlant->"Italic"], " to the fullest. But this isn\[CloseCurlyQuote]t quite the whole story. \ Underlying both of these concepts is the ", StyleBox["MathLink", FontSlant->"Italic"], " communication that makes it all work." }], "Text"], Cell[TextData[{ "The documentation for most ", StyleBox["MathLink", FontSlant->"Italic"], " programs begins by describing how to open a link between the kernel and \ the program. Other commands are needed which write to and read from the link \ when necessary. The front end is no different. Thankfully, little or no \ configuration is necessary in order to get a front end and kernel \ communicating via ", StyleBox["MathLink", FontSlant->"Italic"], " \[LongDash] provided they both reside on the same machine \[LongDash] and \ one rarely needs to resort to sending data across the link manually." }], "Text"], Cell[TextData[{ "Even so, link commands are at the heart of the definition for the notebook \ commands discussed earlier. Consider the command ", StyleBox["Notebooks[]", "Output"], ". Evaluating this command causes the kernel to send a ", StyleBox["MathLink", FontSlant->"Italic"], " packet to the front end, and then it waits for a response. Looking at ", StyleBox["Trace[Notebooks[]]", "Output"], ", the central idea is obfuscated by error checking. Here is the crux:" }], "Text"], Cell[BoxData[ RowBox[{"(", RowBox[{ RowBox[{"LinkWrite", "[", RowBox[{"$ParentLink", ",", RowBox[{"FrontEnd`Notebooks", "[", "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"LinkRead", "[", "$ParentLink", "]"}]}], ")"}]], "Input"], Cell[TextData[{ "The packet in this case is ", StyleBox["FrontEnd`Notebooks", "Output"], ". Notice that it is distinguished from the command ", StyleBox["Notebooks", "Output"], " by residing in a different context. The front end responds to this packet \ by sending information over the link back to the kernel. The kernel reads the \ data from the link, packages it up as appropriate, and then returns it as \ output. All built-in notebook commands are evaluated in approximately the \ same way:" }], "Text"], Cell["\<\ \[Bullet] The user types a notebook command into the front end and \ presses \[ShiftKey]\[KeyBar]\[ReturnKey]; \[Bullet] The front end sends the input to the kernel to be evaluated; \[Bullet] The kernel translates the notebook command into a packet; \[Bullet] The kernel sends the packet back to the front end; \[Bullet] The front end interprets the packet and performs the specified \ action, if any; \[Bullet] The front end sends the packet's return value, if any, back to the \ kernel; \[Bullet] The kernel sends the formatted result of evaluation to the front \ end; \[Bullet] The front end displays the result for the user.\ \>", "Text"], Cell[TextData[{ "This explains why front end commands continue to work even when the kernel \ is on a remote machine. Each command is ultimately ", StyleBox["interpreted", FontSlant->"Italic"], " in the front end. It doesn\[CloseCurlyQuote]t matter where the kernel is \ physically. This also explains the error message that is issued from these \ commands when ", StyleBox["Mathematica", FontSlant->"Italic"], " is not running through the front end." }], "Text"], Cell["\<\ \tMathematica 4.0 Kernel for Power Macintosh \tCopyright 1988-1999 Wolfram Research, Inc. \t -- Terminal graphics initialized -- \t \tIn[1]:= Notebooks[] \t \tFrontEndObject::notavail: \t A front end is not available; certain operations require a front end. \t \tOut[1]= Notebooks[]\ \>", "SmallText"], Cell[TextData[{ "Because all packet names reside in the ", StyleBox["FrontEnd`", "Output"], " context, a list of known packets can be generated with ", StyleBox["Names[\"FrontEnd`*\"]", "Output"], ". For the most part, a command and its corresponding packet have the same \ name, differing only in context." }], "Text"], Cell[TextData[{ "Some packets, such as ", StyleBox["FrontEnd`Notebooks", "Output"], ", will return information over the link to the kernel, and some, such as \ ", StyleBox["FrontEnd`SetOptions", "Output"], ", will not. Reading from a link when there\[CloseCurlyQuote]s nothing \ there, or leaving information on the link instead of reading it immediately, \ will cause the front end and kernel to become out of sync. If this happens, \ start a fresh ", StyleBox["Mathematica", FontSlant->"Italic"], " session." }], "Text"], Cell[TextData[{ "Tokens also are evaluated by way of ", StyleBox["MathLink", FontSlant->"Italic"], " packet traffic. Note that tokens never return information to the link, so \ there's no need to call LinkRead." }], "Text"], Cell[BoxData[ RowBox[{"LinkWrite", "[", RowBox[{"$ParentLink", ",", RowBox[{"FrontEnd`FrontEndExecute", "[", RowBox[{"{", RowBox[{"FrontEnd`FrontEndToken", "[", RowBox[{ "nbObject", ",", "\"\\"", ",", "\"\\""}], "]"}], "}"}], "]"}]}], "]"}]], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Token Listing", "Section"], Cell[TextData[{ "Here is a list of command tokens in ", StyleBox["Mathematica", FontSlant->"Italic"], " version 4.0.2, categorized by the menu in which they appear. It includes \ tokens from the resource files MenuSetup.tr and KeyEventTranslations.tr from \ every supported platform. Compound tokens are listed as ordered pairs of \ strings." }], "Text"], Cell["\<\ Comp: Format the following as you wish to make best use of space \ \[LongDash] multi column, font size, etc.\ \>", "Text", FontWeight->"Bold", FontColor->RGBColor[1, 0, 0], Background->RGBColor[1, 1, 0]], Cell["File Menu Tokens", "Text", FontWeight->"Bold"], Cell["\<\ \"New\" \"Open\" \"Close\" \"Save\" \"SaveRename\" {\"SaveRenameSpecial\",\"V20Notebook\"} {\"SaveRenameSpecial\",\"Text\"} {\"SaveRenameSpecial\",\"CellExpression\"} {\"SaveRenameSpecial\",\"NotebookExpression\"} {\"SaveRenameSpecial\",\"Package\"} \"OpenSpecial\" \"Import\" \"NotebookMail\" \"NotebookMailSelection\" \"ModifyNotebooksMenu\" \"GeneratePalette\" \"GenerateNotebook\" \"SystemPrintOptionsDialog\" \"PrintOptionsDialog\" \"HeadersFootersDialog\" \"PrintDialog\" \"PrintSelectionDialog\" \"FrontEndQuit\"\ \>", "Input", FontWeight->"Plain", CellTags->"tokengrids"], Cell["Edit Menu Tokens", "Text", FontWeight->"Bold"], Cell[TextData[{ "\"Undo\"\n\"Cut\"\n\"Copy\"\n{\"Paste\",\"After\"}\n\"Clear\"\n\ {\"CopySpecial\",\"PlainText\"}\n{\"CopySpecial\",\"FormattedText\"}\n\ {\"CopySpecial\",\"InputText\"}\n{\"CopySpecial\",\"CellExpression\"}\n\ {\"CopySpecial\",\"NotebookExpression\"}\n{\"CopySpecial\",\"CompleteNotebook\ \"}\n{\"CopySpecial\",\"PICT\"}\n{\"CopySpecial\",\"PICTBitmap\"}\n\ {\"CopySpecial\",\"PICTEmbeddedPS\"}\n{\"CopySpecial\",\"QuickTime\"}\n\ {\"CopySpecial\",\"EMF\"}\n{\"CopySpecial\",\"EPS\"}\n\ {\"CopySpecial\",\"MGF\"}\n{\"CopySpecial\",\"RTF\"}\n{\"CopySpecial\",\"Text\ \"}\n{\"CopySpecial\",\"WAV\"}\n{\"PasteSpecial\",\"PlainText\"}\n\ {\"PasteSpecial\",\"FormattedText\"}\n{\"PasteSpecial\",\"InputText\"}\n\ {\"PasteSpecial\",\"InlineCell\"}\n{\"PasteApply\",\"After\"}\n\ {\"PasteDiscard\",\"After\"}\n{\"SelectionSaveSpecial\",\"Text\"}\n\ {\"SelectionSaveSpecial\",\"InputText\"}\n\ {\"SelectionSaveSpecial\",\"CellExpression\"}\n\ {\"SelectionSaveSpecial\",\"NotebookExpression\"}\n{\"SelectionSaveSpecial\",\ \"CompleteNotebook\"}\n{\"SelectionSaveSpecial\",\"Package\"}\n\ {\"SelectionSaveSpecial\",\"EPS\"}\n{\"SelectionSaveSpecial\",\"MGF\"}\n\ {\"SelectionSaveSpecial\",\"PICT\"}\n\ {\"SelectionSaveSpecial\",\"PICTBitmap\"}\n\ {\"SelectionSaveSpecial\",\"PICTEmbeddedPS\"}\n\ {\"SelectionSaveSpecial\",\"PICS\"}\n{\"SelectionSaveSpecial\",\"QuickTime\"}\ \n{\"SelectionSaveSpecial\",\"EMF\"}\n{\"SelectionSaveSpecial\",\"Illustrator\ \"}\n{\"SelectionSaveSpecial\",\"RTF\"}\n{\"SelectionSaveSpecial\",\"WAV\"}\n\ {\"SelectionSaveSpecial\",\"WMF\"}\n\"SelectAll\"\n\"InsertObject\"\n\ \"MoveNext\"\n\"MovePrevious\"\n\"DeleteNext\"\n\"DeletePrevious\"\n\ \"MoveNextWord\"\n\"MovePreviousWord\"\n\"DeleteNextWord\"\n\ \"DeletePreviousWord\"\n\"MoveLineEnd\"\n\"MoveLineBeginning\"\n\ \"MoveNextLine\"\n\"MovePreviousLine\"\n\"Superscript\"\n\"Subscript\"\n\ \"Above\"\n\"Below\"\n\"Otherscript\"\n\"Fraction\"\n\"Radical\"\n\"NewRow\"\n\ \"NewColumn\"\n\"MoveExpressionEnd\"\n\"ExpandSelection\"\n\"CreateInlineCell\ \"\n\"MoveNextCell\"\n\"InsertRawExpression\"\n\"AddInterpretation\"\n\ {\"SpanMaxSize\",\"Infinity\"}\n{\"SpanMaxSize\",\"1\"}\n{\"SpanMaxSize\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n{\"SpanMaxSize\",\"Automatic\"}\n\"NudgeLeft\"\n\"NudgeRight\"\n\ \"NudgeDown\"\n\"NudgeUp\"\n\"RemoveAdjustments\"\n\"Make2D\"\n\"Balance\"\n\ \"FindNextMisspelling\"\n\"OptionsDialog\"" }], "Input", FontWeight->"Plain", CellTags->"tokengrids"], Cell["Cell Menu Tokens", "Text", FontWeight->"Bold"], Cell["\<\ {\"SelectionConvert\",\"InputForm\"} {\"SelectionConvert\",\"OutputForm\"} {\"SelectionConvert\",\"PostScript\"} {\"SelectionConvert\",\"Bitmap\"} {\"SelectionConvert\",\"PICT\"} {\"SelectionConvert\",\"PICTBitmap\"} {\"SelectionConvert\",\"PICTEmbeddedPS\"} {\"SelectionConvert\",\"QuickTime\"} {\"SelectionConvert\",\"Metafile\"} {\"SelectionDisplayAs\",\"TextForm\"} {\"SelectionDisplayAs\",\"InputForm\"} {\"CommonDefaultFormatTypesInput\",\"InputForm\"} {\"CommonDefaultFormatTypesOutput\",\"OutputForm\"} {\"CommonDefaultFormatTypesOutput\",\"InputForm\"} {\"CellOpen\",\"Toggle\"} {\"CellOpen\",\"True\"} {\"CellOpen\",\"False\"} {\"Editable\",\"Toggle\"} {\"Editable\",\"True\"} {\"Editable\",\"False\"} {\"CellEditDuplicate\",\"Toggle\"} {\"CellEditDuplicate\",\"True\"} {\"CellEditDuplicate\",\"False\"} {\"Evaluatable\",\"Toggle\"} {\"Evaluatable\",\"True\"} {\"Evaluatable\",\"False\"} {\"Active\",\"Toggle\"} {\"Active\",\"True\"} {\"Active\",\"False\"} {\"InitializationCell\",\"Toggle\"} {\"InitializationCell\",\"True\"} {\"InitializationCell\",\"False\"} \"CellGroup\" \"CellUngroup\" {\"CellGrouping\",\"Manual\"} {\"CellGrouping\",\"Automatic\"} \"SelectionOpenAllGroups\" \"SelectionCloseAllGroups\" \"OpenCloseGroup\" \"CellSplit\" \"CellMerge\" \"SelectionAnimate\" \"SoundPlay\" \"GraphicsRender\" \"GenerateImageCaches\" \"GraphicsOriginalSize\" \"GraphicsAlign\" \"NotebookStatisticsDialog\"\ \>", "Input", FontWeight->"Plain", CellTags->"tokengrids"], Cell["Format Menu Tokens", "Text", FontWeight->"Bold"], Cell[TextData[{ "{\"Style\",\"Tile\"}\n{\"Style\",\"Subtitle\"}\n{\"Style\",\"Section\"}\n{\ \"Style\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n\"StyleOther\"\n\"ToggleShowExpression\"\n\"OptionsDialog\"\n\ \"ClearCellOptions\"\n\"StyleDefinitionsOther\"\n\"EditStyleDefinitions\"\n\ \"FontPanel\"\n{\"FontFamily\",\"Courier\"}\n{\"FontFamily\",\"Times\"}\n\ {\"FontFamily\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n\"PlainFont\"\n{\"FontWeight\",\"Toggle\"}\n{\"FontWeight\",\"Plain\"}\n\ {\"FontWeight\",\"Bold\"}\n{\"FontWeight\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n{\"FontSlant\",\"Toggle\"}\n{\"FontSlant\",\"Plain\"}\n\ {\"FontSlant\",\"Italic\"}\n{\"FontSlant\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n{\"FontVariationsUnderline\",\"Toggle\"}\n{\"FontVariationsUnderline\",\ \"True\"}\n{\"FontVariationsUnderline\",\"False\"}\n\ {\"FontVariationsOutline\",\"Toggle\"}\n{\"FontVariationsOutline\",\"True\"}\n\ {\"FontVariationsOutline\",\"False\"}\n{\"FontVariationsShadow\",\"Toggle\"}\n\ {\"FontVariationsShadow\",\"True\"}\n{\"FontVariationsShadow\",\"False\"}\n\ {\"FontTracking\",\"Condensed\"}\n{\"FontTracking\",\"Extended\"}\n\ {\"FontSize\",\"Smaller\"}\n{\"FontSize\",\"Larger\"}\n{\"FontSize\",\"9\"}\n\ {\"FontSize\",\"10\"}\n{\"FontSize\",\"12\"}\n{\"FontSize\",\"14\"}\n\ {\"FontSize\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n\"FontSizeDialog\"\n{\"FontColor\",\"GrayLevel[0]\"}\n\ {\"FontColor\",\"GrayLevel[1]\"}\n{\"FontColor\",\"GrayLevel[0.1]\"}\n\ {\"FontColor\",\"RGBColor[1, 0, 0]\"}\n{\"FontColor\",\"RGBColor[0, 1, 0]\"}\n\ {\"FontColor\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n\"FontColorDialog\"\n\"ToggleGrayBox\"\n{\"Background\",\"None\"}\n\ {\"Background\",\"GrayLevel[0]\"}\n{\"Background\",\"GrayLevel[1]\"}\n\ {\"Background\",\"GrayLevel[0.1]\"}\n{\"Background\",\"RGBColor[1, 0, 0]\"}\n\ {\"Background\",\"RGBColor[0, 1, 0]\"}\n{\"Background\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n\"BackgroundDialog\"\n{\"TextAlignment\",\"Left\"}\n{\"TextAlignment\",\ \"-0.5\"}\n{\"TextAlignment\",\"Center\"}\n{\"TextAlignment\",\"0.5\"}\n\ {\"TextAlignment\",\"Right\"}\n{\"TextAlignment\",\"AlignmentMarker\"}\n\ {\"TextJustification\",\"0.\"}\n{\"TextJustification\",\"0.25\"}\n\ {\"TextJustification\",\"0.5\"}\n{\"TextJustification\",\"0.75\"}\n\ {\"TextJustification\",\"1.\"}\n{\"PageWidth\",\"Infinity\"}\n{\"PageWidth\",\ \"PaperWidth\"}\n{\"PageWidth\",\"WindowWidth\"}\n{\"PageWidth\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n\"FixCellWidth\"\n{\"CellDingbat\",\"None\"}\n{\"CellDingbat\",\"\ \[FilledSquare]\"}\n{\"CellDingbat\"", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}\n{\"CellFrame\",\"Inherited\"}\n{\"CellFrame\",\"{{0, 0}, {0, 0.5}}\"}\n\ {\"CellFrame\",\"{{0, 0}, {0, 2}}\"}\n{\"CellFrame\",\"{{0, 0}, {0, 3}}\"}\n{\ \"CellFrame\",\"{{0, 0}, {0.5, 0}}\"}\n{\"CellFrame\",\"{{0, 0}, {2, 0}}\"}\n\ {\"CellFrame\",\"{{0, 0}, {3, 0}}\"}\n{\"ShowPageBreaks\",\"Toggle\"}\n\ {\"ShowPageBreaks\",\"True\"}\n{\"ShowPageBreaks\",\"False\"}\n\ {\"Magnification\",\"0.75\"}\n{\"Magnification\",\"1.\"}\n{\"Magnification\",\ \"1.25\"}\n{\"Magnification\",", StyleBox["etc\[Ellipsis]", FontSlant->"Italic"], "}" }], "Input", FontWeight->"Plain", CellTags->"tokengrids"], Cell["Input Menu Tokens", "Text", FontWeight->"Bold"], Cell["\<\ \"GraphicsCoordinatesDialog\" \"ViewPointSelectorDialog\" \"ColorSelectorDialog\" \"RecordSoundDialog\" \"FileNameDialog\" \"CreateGridBoxDialog\" \"CreateCustomButtonBox\" \"EditButtonBoxDialog\" \"CreateHyperlinkDialog\" \"CreateCounterBoxDialog\" \"CreateValueBoxDialog\" {\"DuplicatePreviousInput\",\"After\"} {\"DuplicatePreviousOutput\",\"After\"} \"SimilarCellBelow\" {\"CompleteSelection\",\"True\"} \"TemplateSelection\"\ \>", "Input", FontWeight->"Plain", CellTags->"tokengrids"], Cell["Kernel Menu Tokens", "Text", FontWeight->"Bold"], Cell["\<\ \"EvaluateCells\" {\"Evaluate\",\"All\"} \"EvaluateNextCell\" \"SubsessionEvaluateCells\" \"EvaluateNotebook\" \"EvaluateInitialization\" {\"EnterSubsession\",\"Automatic\"} {\"ExitSubsession\",\"Automatic\"} \"RemoveFromEvaluationQueue\" {\"EvaluatorInterrupt\",\"Automatic\"} {\"EvaluatorAbort\",\"Automatic\"} \"ModifyEvaluatorNames\" {\"ShowCellLabel\",\"Toggle\"} {\"ShowCellLabel\",\"True\"} {\"ShowCellLabel\",\"False\"} \"DeleteGeneratedCells\"\ \>", "Input", FontWeight->"Plain", CellTags->"tokengrids"], Cell["Find Menu Tokens", "Text", FontWeight->"Bold"], Cell["\<\ \"FindDialog\" \"SelectionSetFind\" \"Replace\" \"ReplaceFind\" \"ReplaceAll\" \"OpenSelectionParents\" \"SelectionScroll\" \"HyperlinkGoBack\" \"CellTagsEditDialog\" {\"ShowCellTags\",\"Toggle\"} {\"ShowCellTags\",\"True\"} {\"ShowCellTags\",\"False\"} \"CellLabelsToTags\" \"CreateIndexDialog\"\ \>", "Input", FontWeight->"Plain", CellTags->"tokengrids"], Cell["Window Menu Tokens", "Text", FontWeight->"Bold"], Cell["\<\ \"StackWindows\" \"TileWindowsWide\" \"TileWindowsTall\"\ \>", "Input", FontWeight->"Plain", CellTags->"tokengrids"], Cell["Help Menu Tokens", "Text", FontWeight->"Bold"], Cell["\<\ \"AboutBoxDialog\" \"XInfoDialog\" \"HelpDialog\" \"SelectionHelpDialog\" \"ExplainBeepDialog\" \"RebuildHelpIndex\"\ \>", "Input", FontWeight->"Plain", CellTags->"tokengrids"], Cell["Key Event Tokens", "Text", FontWeight->"Bold"], Cell["\<\ \"Above\" \"Below\" \"Copy\" \"CreateInlineCell\" \"Cut\" \"DeleteNext\" \"DeleteNextExpression\" \"DeletePrevious\" \"DeletePreviousExpression\" \"EvaluateCells\" \"EvaluateNextCell\" \"ExpandSelection\" \"Fraction\" \"InsertRawExpression\" \"Linebreak\" \"MoveExpressionEnd\" \"MoveLineBeginning\" \"MoveLineEnd\" \"MoveNext\" \"MoveNextCell\" \"MoveNextExpression\" \"MoveNextLine\" \"MoveNextWord\" \"MovePrevious\" \"MovePreviousExpression\" \"MovePreviousLine\" \"MovePreviousPlaceHolder\" \"MovePreviousWord\" \"NewColumn\" \"NewRow\" \"NudgeDown\" \"NudgeLeft\" \"NudgeRight\" \"NudgeUp\" \"Otherscript\" \"Radical\" \"ScrollNotebookEnd\" \"ScrollNotebookStart\" \"ScrollPageDown\" \"ScrollPageUp\" \"SelectionHelpDialog\" \"SelectionSpeak\" \"SelectionSpeakSummary\" \"SelectLineBeginning\" \"SelectLineEnd\" \"SelectNext\" \"SelectNextLine\" \"SelectNextWord\" \"SelectPrevious\" \"SelectPreviousLine\" \"SelectPreviousWord\" \"ShortNameDelimiter\" \"SimilarCellBelow\" \"Subscript\" \"Superscript\" \"Tab\" \"Undo\" {\"CompleteSelection\",\"False\"} {\"Evaluate\",\"All\"} {\"Paste\",\"After\"}\ \>", "Input", FontWeight->"Plain", CellTags->"tokengrids"] }, Open ]], Cell[CellGroupData[{ Cell["References", "Section"], Cell[TextData[{ "[Abb]\tAbbott, Paul, ed. \[OpenCurlyDoubleQuote]Tricks of the Trade\ \[CloseCurlyDoubleQuote] ", StyleBox["The Mathematica Journal", FontSlant->"Italic"], " . Vol. 7, No. 2, pp 105\[Dash]127. 1998." }], "Text"], Cell[TextData[{ "[DW]\tD\[CloseCurlyQuote]Andria, Louis J. and Stan Wagon. \ \[OpenCurlyDoubleQuote]Front End Grab Bag\[CloseCurlyDoubleQuote], ", StyleBox["Mathematica in Education and Research", FontSlant->"Italic"], ". Vol. 6, No. 2, pp 54\[Dash]57. 1997." }], "Text"], Cell[TextData[{ "[GD]\tGaylord, Richard J. and Louis J. D\[CloseCurlyQuote]Andria. ", StyleBox["Simulating Society: A Mathematica Toolkit for Modeling \ Socioeconomic Behavior", FontSlant->"Italic"], ". TELOS/Springer-Verlag, New York, 1998." }], "Text"], Cell[TextData[{ "[GG]\tGlynn, Jerry and Theodore Gray. ", StyleBox["The Beginner\[CloseCurlyQuote]s Guide to Mathematica Version 4", FontSlant->"Italic"], ". Cambridge University Press, 2000." }], "Text"], Cell[TextData[{ "[Mae]\tMaeder, Roman. ", StyleBox["Programming in Mathematica, Third Edition", FontSlant->"Italic"], ". Addison-Wesley, 1996." }], "Text"], Cell[TextData[{ "[Wol]\tWolfram, Stephen. ", StyleBox["The Mathematica Book, Fourth Edition", FontSlant->"Italic"], ". Wolfram Media, Cambridge University Press, 1999." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["About the Author", "Section"], Cell["\<\ Comp: I assume you still have my \"about the author\" blurb from \ the \"old\" column. I\[CloseCurlyQuote]ll review it at proof time, to make \ sure it\[CloseCurlyQuote]s still valid.\ \>", "Text", FontWeight->"Bold", FontColor->RGBColor[1, 0, 0], Background->RGBColor[1, 1, 0]] }, Open ]] }, Open ]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, ScreenStyleEnvironment->"Working", WindowToolbars->{}, WindowSize->{520, 626}, WindowMargins->{{1, Automatic}, {Automatic, 1}}, Visible->True, PrintingCopies->1, PrintingPageRange->{1, Automatic}, PrivateNotebookOptions->{"ShortBoxForm"->False}, InputAliases->{"notation"->RowBox[ {"Notation", "[", RowBox[ { TagBox[ "\[Placeholder]", NotationBoxTag, TagStyle -> "NotationTemplateStyle"], " ", "\[DoubleLongLeftRightArrow]", " ", TagBox[ "\[Placeholder]", NotationBoxTag, TagStyle -> "NotationTemplateStyle"]}], "]"}], "notation>"->RowBox[ {"Notation", "[", RowBox[ { TagBox[ "\[Placeholder]", NotationBoxTag, TagStyle -> "NotationTemplateStyle"], " ", "\[DoubleLongRightArrow]", " ", TagBox[ "\[Placeholder]", NotationBoxTag, TagStyle -> "NotationTemplateStyle"]}], "]"}], "notation<"->RowBox[ {"Notation", "[", RowBox[ { TagBox[ "\[Placeholder]", NotationBoxTag, TagStyle -> "NotationTemplateStyle"], " ", "\[DoubleLongLeftArrow]", " ", TagBox[ "\[Placeholder]", NotationBoxTag, TagStyle -> "NotationTemplateStyle"]}], "]"}], "symb"->RowBox[ {"Symbolize", "[", TagBox[ "\[Placeholder]", NotationBoxTag, TagStyle -> "NotationTemplateStyle"], "]"}], "infixnotation"->RowBox[ {"InfixNotation", "[", RowBox[ { TagBox[ "\[Placeholder]", NotationBoxTag, TagStyle -> "NotationTemplateStyle"], ",", "\[Placeholder]"}], "]"}], "addia"->RowBox[ {"AddInputAlias", "[", RowBox[ { TagBox[ "\[Placeholder]", NotationBoxTag, TagStyle -> "NotationTemplateStyle"], ",", "\[Placeholder]"}], "]"}], "pattwraper"->TagBox[ "\[Placeholder]", NotationPatternTag, TagStyle -> "NotationPatternWrapperStyle"], "madeboxeswraper"->TagBox[ "\[Placeholder]", NotationMadeBoxesTag, TagStyle -> "NotationMadeBoxesWrapperStyle"]}, Magnification->1, StyleDefinitions -> "Default.nb" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{ "tokengrids"->{ Cell[19969, 563, 593, 26, 334, "Input", CellTags->"tokengrids"], Cell[20622, 594, 2503, 40, 1231, "Input", CellTags->"tokengrids"], Cell[23185, 639, 1490, 51, 684, "Input", CellTags->"tokengrids"], Cell[24737, 695, 3433, 67, 1296, "Input", CellTags->"tokengrids"], Cell[28231, 767, 503, 19, 236, "Input", CellTags->"tokengrids"], Cell[28796, 791, 526, 19, 236, "Input", CellTags->"tokengrids"], Cell[29382, 815, 370, 17, 208, "Input", CellTags->"tokengrids"], Cell[29814, 837, 130, 6, 54, "Input", CellTags->"tokengrids"], Cell[30004, 848, 190, 9, 96, "Input", CellTags->"tokengrids"], Cell[30254, 862, 1179, 63, 852, "Input", CellTags->"tokengrids"]} } *) (*CellTagsIndex CellTagsIndex->{ {"tokengrids", 35975, 1062} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1739, 51, 36, 0, 105, "Title"], Cell[1778, 53, 39, 0, 64, "Subtitle"], Cell[1820, 55, 60, 0, 53, "Subsubtitle"], Cell[1883, 57, 625, 17, 109, "Text"], Cell[CellGroupData[{ Cell[2533, 78, 27, 0, 53, "Section"], Cell[2563, 80, 495, 13, 90, "Text"], Cell[3061, 95, 590, 11, 137, "Input"], Cell[3654, 108, 614, 14, 96, "Text"], Cell[4271, 124, 738, 20, 91, "Input"], Cell[5012, 146, 593, 12, 97, "Text"], Cell[5608, 160, 174, 4, 46, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[5819, 169, 25, 0, 50, "Section"], Cell[5847, 171, 635, 14, 98, "Text"], Cell[6485, 187, 92, 1, 27, "Input"], Cell[6580, 190, 119, 3, 30, "Text"], Cell[6702, 195, 126, 2, 27, "Input"], Cell[6831, 199, 701, 16, 116, "Text"], Cell[7535, 217, 244, 6, 68, "Input"], Cell[7782, 225, 795, 19, 114, "Text"], Cell[8580, 246, 213, 6, 43, "Input"], Cell[8796, 254, 465, 14, 67, "Text"], Cell[9264, 270, 182, 4, 27, "Input"], Cell[9449, 276, 219, 6, 48, "Text"], Cell[9671, 284, 544, 8, 110, "Text"], Cell[10218, 294, 168, 4, 47, "Text"], Cell[10389, 300, 165, 4, 27, "Input"], Cell[10557, 306, 412, 8, 79, "Text"], Cell[10972, 316, 647, 14, 123, "Input"], Cell[11622, 332, 66, 0, 30, "Text"], Cell[11691, 334, 845, 20, 116, "Text"], Cell[12539, 356, 688, 15, 114, "Text"], Cell[13230, 373, 656, 14, 114, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[13923, 392, 26, 0, 50, "Section"], Cell[13952, 394, 415, 10, 66, "Text"], Cell[14370, 406, 628, 13, 114, "Text"], Cell[15001, 421, 500, 10, 82, "Text"], Cell[15504, 433, 295, 7, 43, "Input"], Cell[15802, 442, 519, 10, 96, "Text"], Cell[16324, 454, 652, 13, 142, "Text"], Cell[16979, 469, 481, 11, 82, "Text"], Cell[17463, 482, 315, 11, 152, "SmallText"], Cell[17781, 495, 329, 7, 64, "Text"], Cell[18113, 504, 540, 13, 98, "Text"], Cell[18656, 519, 233, 6, 48, "Text"], Cell[18892, 527, 359, 8, 75, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[19288, 540, 32, 0, 50, "Section"], Cell[19323, 542, 364, 8, 80, "Text"], Cell[19690, 552, 219, 6, 66, "Text"], Cell[19912, 560, 54, 1, 32, "Text"], Cell[19969, 563, 593, 26, 334, "Input", CellTags->"tokengrids"], Cell[20565, 591, 54, 1, 32, "Text"], Cell[20622, 594, 2503, 40, 1231, "Input", CellTags->"tokengrids"], Cell[23128, 636, 54, 1, 32, "Text"], Cell[23185, 639, 1490, 51, 684, "Input", CellTags->"tokengrids"], Cell[24678, 692, 56, 1, 32, "Text"], Cell[24737, 695, 3433, 67, 1296, "Input", CellTags->"tokengrids"], Cell[28173, 764, 55, 1, 32, "Text"], Cell[28231, 767, 503, 19, 236, "Input", CellTags->"tokengrids"], Cell[28737, 788, 56, 1, 32, "Text"], Cell[28796, 791, 526, 19, 236, "Input", CellTags->"tokengrids"], Cell[29325, 812, 54, 1, 32, "Text"], Cell[29382, 815, 370, 17, 208, "Input", CellTags->"tokengrids"], Cell[29755, 834, 56, 1, 32, "Text"], Cell[29814, 837, 130, 6, 54, "Input", CellTags->"tokengrids"], Cell[29947, 845, 54, 1, 32, "Text"], Cell[30004, 848, 190, 9, 96, "Input", CellTags->"tokengrids"], Cell[30197, 859, 54, 1, 32, "Text"], Cell[30254, 862, 1179, 63, 852, "Input", CellTags->"tokengrids"] }, Open ]], Cell[CellGroupData[{ Cell[31470, 930, 29, 0, 50, "Section"], Cell[31502, 932, 237, 6, 48, "Text"], Cell[31742, 940, 281, 6, 50, "Text"], Cell[32026, 948, 264, 6, 50, "Text"], Cell[32293, 956, 214, 5, 48, "Text"], Cell[32510, 963, 165, 5, 32, "Text"], Cell[32678, 970, 190, 5, 48, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[32905, 980, 35, 0, 50, "Section"], Cell[32943, 982, 294, 7, 66, "Text"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)