Message Boards Message Boards

0
|
1683 Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Reset the ItemNumbered counter within a single notebook

Posted 1 year ago

I would like to reset the ItemNumbered counter within a single notebook. I present 3 problems to students numbered like:
1.
2.
3.
Then, in another topic within the same notebook I want to start the count over:
1.
2.
3.
and so on. How to do this? Thanks.

POSTED BY: Jon Joseph
3 Replies
Posted 1 year ago

Thanks. I'll give both those methods a try.

POSTED BY: Jon Joseph
Posted 1 year ago

Well, first off, the various section cell types will automatically reset the counter for ItemNumbered cell types. So, if you break up your notebook into sections using section headers, you'll get this for free.

But, if you want to dig into this, it turns out that this is handled in the stylesheets. It turns out that the style for ItemNumbered includes as the CellDingbat a CounterBox, CounterBox["ItemNumbered"]. It also includes an option for CounterIncrements->"ItemNumbered". And it has yet another option CounterAssignments->{{"SubitemNumbered", 0}, {"SubsubitemNumbered", 0}}. What I'm inferring from this is that in the front end environment there are some variables with tags (e.g. "ItemNumbered") that get integrated with CounterBox objects.

I tried the following and it worked (there's probably something more elegant by using front end programming techniques).

  • Create a new notebook
  • Add several ItemNumbered cells
  • In the middle of them somewhere, add a new cell (I made it a text cell)
  • Edit this cell to add the CounterAssignments option

You can do this kind of editing of cell expressions using the Show Expression command from the Cell menu. So, toggle it to show the cell expression, and edit that cell expression to look like this:

Cell["", "Text", CounterAssignments->{{"ItemNumbered", 99}}]

The next cell is now numbered as 100.

You could make this slightly less weird-looking if you make this new special cell you add be very small so that it doesn't show up and ruin your spacing or formatting. Or, as I said, there might be a programmatic way to do this, but I don't know how.

POSTED BY: Eric Rimbey
Posted 1 year ago

I'm such a dufus. You don't need an extra cell. Just edit the ItemNumbered cell where you want the numbering to change.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract