3

If one wants to use the automatic numbering feature of Mathematica, he has to make tags for cells of the type he wants to be referenced to. Then, as soon as he needs to make a reference to the tagged cell, he goes to Menu/Insert/Automatic Numbering. This brings up the dialog "Create Automatic Numbering Object". There one finds three fields: one is entitled "Counter", the two others enable one to select the tag of the cell to be numbered.

In the field "Counter" one finds a number of cell types, and one MUST select the type he needs. In some StyleSheets, such as JournalArticle, the number of cell types is really impressive. In this case the stage of choosing the cell type from the Counter field of the "Create Automatic Numbering Object" dialog considerably brakes the writing process and becomes a head ache.

I heavily use the JournalArticle StyleSheet along with the automatic numeration. However, I only make numeration and refer to two types of Cells: (i) DisplayFormulaNumbered and (ii) Figure.

Here comes my question:

Is it possible to customize the "Create Automatic Numbering Object" dialog such, that only two types of cells: (i) DisplayFormulaNumbered and (ii) Figure would show up there?

(my data PC WindowsXP, Mathematica 9.0.1.0)

Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96

2 Answers2

2

My initial answer was not sufficient. Here are some better input aliases to use:

CurrentValue[EvaluationNotebook[], {InputAliases, "dfn"}] = DynamicBox[
    ToBoxes[
        ActionMenu[
            "tags",
            With[{tags = CurrentValue[Cells[CellStyle->"DisplayFormulaNumbered"], CellTags]},
                #:>NotebookWrite[
                    ParentBox@EvaluationBox[],
                    CounterBox["DisplayFormulaNumbered", #]
                ]& /@ tags
            ]
        ]
    ]
];
CurrentValue[EvaluationNotebook[], {InputAliases, "fig"}] = DynamicBox[
    ToBoxes[
        ActionMenu[
            "tags",
            With[{tags = CurrentValue[Cells[CellStyle->"Figure"], CellTags]},
                #:>NotebookWrite[
                    ParentBox@EvaluationBox[],
                    CounterBox["Figure", #]
                ]& /@ tags
            ]
        ]
    ]
];
Carl Woll
  • 130,679
  • 6
  • 243
  • 355
1

I think the automaticaNumbering is not perfect, I found a way to use AutomaticaNumbering.

That is :Create Your Own Stylesheet. You can search StyleData in Help,

And the SectionNumbered gives good example when see the CellExpression, and we can modifiy it in our personal-stylesheet.nb

If you want to remove AutomaticaNumbering of some stylesheet, just CtrL+Shift+E and remove the part related.

Shortcut to insert CounterBox

and I saw this which maybe also helpful

The picture show the case: find a buil-in cell-style is really AutomaticaNumbering, but with no CountBox, it's in the parent stylesheet. enter image description here

HyperGroups
  • 8,619
  • 1
  • 26
  • 63
  • It is a very interesting possibility, but could you be a bit more precise. I actually do use a custom StyleSheet and could easily modify it. However, as soon as I open my StyleSheet, mark, say, the cell Section and make Ctrl+Shift+E, I get the following: Cell[StyleData["Section"], FontSize->28, FontWeight->"Bold"]. As you may see it contains no Counter box. – Alexei Boulbitch May 07 '13 at 10:04
  • Another story is with, say, EquationNumbered cell. In this case after I press Ctrl+Shift+E I see the following: Cell[StyleData["EquationNumbered"], CellFrameLabels->{{None, Cell[ TextData[{"(", CounterBox["EquationNumbered"], ")"}]]}, {None, None}}, FontFamily->"Courier New", FontSize->12, FontWeight->"Plain", FontSlant->"Italic", FontVariations->{"StrikeThrough"->False, "Underline"->False}, Magnification->1.5]. Here I see the CounterBox that could be removed. But exactly here I need it. – Alexei Boulbitch May 07 '13 at 10:05
  • So, could you kindly give a precise example of how you remove the built-in counting in a StyleSheet cell like, for example, Section – Alexei Boulbitch May 07 '13 at 10:06
  • in your first comment, a CellStyle with No CounterBox in CellExpression, that it just inherit from a parent stylesheet, if you open the parent stylesheet, Ctrl+F will find the cell with CounterBox, but with some protection so couldn't remove the CounterBox, so Just copy them all to one's personal stylesheet, and remove the CounterBox Part. – HyperGroups May 07 '13 at 10:46
  • And you can also use SetOptions to create your own Stylesheets. – HyperGroups May 07 '13 at 10:47
  • Could you please kindly give an example of such using SetOprions? – Alexei Boulbitch Jun 04 '13 at 12:45
  • @AlexeiBoulbitch Oh, maybe I saw that from some posts in SE, but now I forgot it and cannot find it soonly. If I find it some day, I'll add comment here. Maybe I mis-memorized something also. :( – HyperGroups Jun 06 '13 at 03:00
  • OK, thank you very much. – Alexei Boulbitch Jun 07 '13 at 06:51