# Re: Numbered Equations?

*To*: mathgroup@smc.vnet.net*Subject*: [mg11964] Re: Numbered Equations?*From*: "P.J. Hinton" <paulh@wolfram.com>*Date*: Fri, 17 Apr 1998 02:21:14 -0400*Organization*: Wolfram Research, Inc.*References*: <6ghm09$ltj@smc.vnet.net>

On 9 Apr 1998, Tom Jazbutis wrote: > Has anyone had success in getting the numbered equation cell type to > actually be numbered in the notebook? > > I've tried every possible permutation of the options that deal with > automatic numbering increments, displays, etc.... All I've been able > to achieve is a "(/)" appearing where I would expect an equation number > to appear if I change an empty cell to a number equation and then paste > my equation into the empty cell. There is no documentation in the > system for any of these various options. > > Wolfram: If you're going to make it damn near impossible to cut and > paste into text processing documents, please give Mathematica > documented text processing features. Your text processing is almost as > bad as you mathematical processing is good. There are several style sheets that support a "NumberedEquation" cell style. ArticleClassic ArticleModern.nb Classic.nb Classroom.nb HelpBrowser.nb Report.nb Wherein the cell displays a counter value that is determined automatically. If you paste these cells into a notebook which is set to one of the six style sheets above, you should see that the first and second cells are labeled with (1) and (2) respectively. Cell[BoxData[ FormBox[ RowBox[{"\[Integral]", RowBox[{ RowBox[{"f", "(", "x", ")"}], " ", RowBox[{"\[DifferentialD]", "x"}]}]}], TraditionalForm]], "NumberedEquation"] Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["c", RowBox[{"2", " "}]], "=", " ", RowBox[{ SuperscriptBox["a", RowBox[{"2", " "}]], "+", " ", SuperscriptBox["b", "2"]}]}], TraditionalForm]], "NumberedEquation"] The reason that a number automagically appears in these cells is because the protoype for "NumberedEquation" has a CellFrameLabel option that places a Cell with a CounterBox in the right hand side. Here is an example of a cell with modified frame labels. Paste it in a notebook to see the effect of this option. Cell["Here is a cell", "Text", CellFrameLabels->{{"Left", "Right"}, {"Bottom", "Top"}}] Let's modify this example to create a Cell with a counter in the right hand side, as is done in the style sheet. We'll set all the strings except for the "Right" one to read None. In place of the "Right" string, we could actually just drop in a "(1)" or whatever equation number you prefer, but then you'd have to adjust these values every time you moved things around. This is why there are CounterBox objects. CounterBoxes take a string argument, which is the style that is to be used in determining the value. CounterBoxes have to appear within TextData expressions, and a TextData has to appear within a Cell wrapper. This example Cell[TextData[{"(", CounterBox["NumberedEquation"],")"}] shows how you could create a label that computes the current numbering value for the "NumberedEquation" style and then insert it between to parentheses. If entering this in by hand seems unappealing, there is a way to get around this. 1) Create a "Text" style cell (Format -> Style -> Text). 2) Enter an opening parenthesis. 3) Click on the menu sequence Input -> Create Automatic Numbering Object... 4) On the dialog box, select the style of counter that will be used. The expandable scroll menu will give you a list of all counters available from the style sheet. Here, we choose "NumberedEquation". Click OK. 5) Enter a closing parenthesis. 6) Unformat the cell (Format -> Cell) 7) Delete the last argument to the Cell, which should be , "Text" 8) You can now copy and paste the unformatted cell expression into our working cell expression. If put all of this together, we can make a cell style with our own custom counter and add it to our style sheet. Cell[StyleData["MyCounter"], NotebookDefault, CellFrameLabels->{{None, Cell[TextData[{"(", CounterBox["MyCounter"],")"}]]}, {None, None}}, CounterIncrements->"MyCounter"] This will make the "MyCounter" value available on the Create Automatic Numbering Object dialog box. One other thing you may need to do is to hack the counter value. That is, you may need to reset it back to a different number for the purposes of different sections or chapters. In that case, you can use the CounterAssignments option to set the value. For example, let's say you wanted to have our counter above reset back to zero every time we started a new section, then we could edit the style sheet prototype for the Section style to set "MyCounter" back to zero. CounterAssignments->{{"Subsection", 0}, {"Subsubsection", 0}, {"MyCounter", 0}} I hope that this brief exposition gives you some clues as to how the numbering system operates. If I have somehow misunderstood your question, please let me know. -- P.J. Hinton Mathematica Programming Group paulh@wolfram.com Wolfram Research, Inc. http://www.wolfram.com/~paulh/ Disclaimer: Opinions expressed herein are those of the author alone.

**Re: Re: Inserted Objects wont Print!!**

**Mathematica 3.0 FrontEnd**

**Numbered Equations?**

**Re: Numbered Equations?**