Change auto numbering for part/task

<part> and <task>(and other sectional components like <problem>, <section>) auto-numbers using the sectional counter, which is always digits (1, 2, 3, …). There’s no attribute to switch this to letters (a, b, c, …), which is a very common convention for labeling sub-parts of a problem/exercise.

Currently, one can accomplish this with an <ol>and the marker attribute but it’d be nice to have a more semantically appropriate way to do this directly with <part> or <task>. Would others find this useful?

2 Likes

We really do need this! What do we want the attribute to be called?

For an ordered list, its “level”, but that doesn’t work for parts and tasks…

100% this would be useful!

Much like with selectPrimeNumbers where from and to were adopted in favor of the semantically more appropriate minValue and maxValue I would argue it should be the same attribute to avoid confusion. I think that the compromise is worth it.

I agree with this. The slight wrinkle is that these components already have a level attribute. This is supposed to override the default “header” levels. However, it looks like they don’t actually do anything…
So maybe we can use the same attribute but just redefine it’s function in this context?

We talked about this in the community discussion meeting today with me, @Duane_Nykamp , and @Charles_Nykamp, and here are the notes:

  • Part of the issue is that this doesn’t necessarily make sense as an attribute for a single <part> or <task> etc., since it really should be applying to a group of tasks or parts (as with <ol> and <li>, where this is controlled with an attribute of <ol>)
  • To address this, there could be a <parts> tag added as a wrapper around multiple <part> components, and then the component could have a “marker” attribute that would change the numbering type for its children parts. In this case, what if there’s a <task> inside a <parts>? Or <part> and <task> components intermingled? That could be weird.
  • It would be nice to be consistent with how this is handled in PreTeXt, but it looks like they handle it in the publication file. So, one option would be to have some sort of style definition that could be applied to a component.

Also related to numbering:

  • It would be nice to resume numbering from a previous section. This could be done with an attribute “resumeNumbering” or similar on the first <part> (or other component), or with an attribute for global numbering.

@Anurag_Katyal @Virginia_Mae @Nick_Bennett What are your thoughts?