# Formula numbering in StyleSheet Book/Monograph

I am writing a text within the document corresponding to the StyleSheet Book/Monograph. I find it strange how the numeration is working in this StyleSheet.

Here you can see the screenshot from a part of the text. One can see that the numeration goes as (0.1), (0.2) and so on, independently of the number of the Section. I did not show this, but it also does not depends on the Chapter, if any.

My question: is it possible to control the numeration. I would find it helpful, if the numeration in Section 1 goes as (1.1), (1.2) and so on, and in the Section 2 - as (2.1), (2.2) etc. I would also be quite satisfied if this is controlled by the Chapter, rather than by the Section.

If all this is impossible, I would agree to a through numeration (1), (2) (3) independent of Sections and Chapters. But I cannot live with what I see.

Any idea of how to control this?

## 1 Answer

The "EquationNumbered" style uses the following CellFrameLabels setting:

CurrentValue[{StyleDefinitions, "EquationNumbered", CellFrameLabels}]


{{None, Cell[ TextData[{"(", CounterBox["BookChapterNumber"], ".", CounterBox["EquationNumbered"], ")"}]]}, {None, None}}

As you can see, the label only depends on the "BookChapterNumber" style, and not the "Section" style. If you want it to use the "Section" number, you need to modify the style sheet accordingly. However, note the CounterAssignments setting of the "Section" style:

CurrentValue[{StyleDefinitions, "Section", CounterAssignments}]


{{"Subsection", 0}, {"Subsubsection", 0}, {"Subsubsubsection", 0}, {"Item1", 0}, {"Item2", 0}, {"Item3", 0}, {"Item1Numbered", 0}, {"Item2Numbered", 0}, {"Item3Numbered", 0}}

In order to have the equation numbers reset to 0 with each section, you need to add "EquationNumbered" here as well. The following stylesheet makes both of these changes:

SetOptions[
EvaluationNotebook[],
StyleDefinitions -> Notebook[
{
Cell @ StyleData[
StyleDefinitions -> FrontEndFileName[
{"Book"},
"Monograph.nb",
CharacterEncoding->"UTF-8"
]
],
Cell[StyleData["Section"],
CounterAssignments->{
{"Subsection",0},
{"Subsubsection",0},
{"Subsubsubsection",0},
{"Item1",0},
{"Item2",0},
{"Item3",0},
{"Item1Numbered",0},
{"Item2Numbered",0},
{"Item3Numbered",0},
{"EquationNumbered",0}
}
],
Cell[StyleData["EquationNumbered"],
CellFrameLabels -> {
{
None,
Cell[TextData[{"(",CounterBox["Section"],".",CounterBox["EquationNumbered"],")"}]]
},
{
None,
None
}
}
]
},
StyleDefinitions->"PrivateStylesheetFormatting.nb"
]
]

• Thank you. I have nothing against numbering according to the chapter number. The problem is that I do not understand what should I do in order to get in the numeration the (chapter number, number of a formulae inside the chapter)`. Whatever I do, I get there 0 at the plave of the chapter number. Could you advice on it? Dec 2 '19 at 12:34
• @AlexeiBoulbitch Replace "Section" with "Chapter" in my code. Dec 2 '19 at 23:30
• Thank you. I implemented it and it works perfectly. Dec 3 '19 at 14:10