PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
264 stars 206 forks source link

ol inside task inside project produces inconsistent numbering #669

Open mitchkeller opened 7 years ago

mitchkeller commented 7 years ago

If you have project/task/ol, the HTML will number the ol as 1, 2, 3, while LaTeX numbers it as (a), (b), (c). Using label="(i)" gets consistent behavior in a desirable form, but would be nice to see the two output formats agree.

rbeezer commented 7 years ago

Well, this is not a surprise. But not anticipated either.

One solution: ban "ol" from within "task".

"task" was explicitly proposed to be very much like a list. Other than your list items not really being tasks, what is wrong with using subtasks?

You can see that even if we agree on a fixed set of labels (alph, roman, Alph, currently), then whatever behavior LaTeX decides to impose on contained lists, then it will be a real mess to get that numbering duplicated in HTML. Then an author asks for a different set of labels on "task"...

And LaTeX does give up at some depth (4 by default, 6 with enumitem?).

Another approach is to take over the numbering on the LaTeX side and hard-code them (like for "exercise"). We could institute some regular cyclic shuttling of label styles. Then numbering of "task" and "li" could intermingle with maintainable code. Or maybe this would work with setting the just the styles on the tasks on the LaTeX side.....

On 08/10/2017 01:39 PM, Mitchel T. Keller wrote:

If you have project/task/ol, the HTML will number the ol as 1, 2, 3, while LaTeX numbers it as (a), (b), (c). Using label="(i)" gets consistent behavior in a desirable form, but would be nice to see the two output formats agree.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/669, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy2ctBHuZanJcKBwQhQW8qTcqJI7t4dks5sW2pngaJpZM4Oz80Q.

mitchkeller commented 7 years ago

In this case, they really are subtasks, but they happen to be followed by a paragraph that's not a conclusion because it contains a question that has a solution. I think that's shoddy authoring on Bogart's part, and we'll have to decide how faithfully we want to replicate his source.

You asked "Other than your list items not really being tasks, what is wrong with using subtasks?", and the obvious answer is that it's tag abuse. The nesting rabbit hole here could get really deep and unpleasant really fast. It may be safest to ban ol from inside task, or else a reasonable solution would be your idea of hard coding the labels on the LaTeX side as with exercises. Would likely get less grumbling than when someone really had a good use case for an ol inside a task (where subtasks would not be appropriate).

rbeezer commented 7 years ago

I agree.

How critical are the label types on "task"?

I do want to ban "arabic". So we can go Task 4.5.9.d.iii.B rather than putting a different separator between the 9 and the d (no numbers to the right is a bit overkill, but it makes the point).

A task, I've discovered, has three useful "numbers" (not just two):

4.5.9.d.iii.B

d.iii.B

B

mitchkeller commented 7 years ago

Yeah, definitely ban arabic. I'm not sure how critical the types are beyond that. Paging @oscarlevin and @kcrisman who seemed to be the big proponents of subtasks.

And yes, being able to get at task numbering in a finer-grained way would be nice. Right now, I may be missing something, but it seems like if I'm in 4.5.9.c and want to refer to the previous task, I'm stuck with 4.5.9.b, when in reality, I'd like to just say (b).

rbeezer commented 7 years ago

On 08/10/2017 02:32 PM, Mitchel T. Keller wrote:

And yes, being able to get at task numbering in a finer-grained way would be nice. Right now, I may be missing something, but it seems like if I'm in 4.5.9.c and want to refer to the previous task, I'm stuck with 4.5.9.b, when in reality, I'd like to just say (b).

I think that is an easy change on the second pass. But might mean using text="xxxx-local".

davidfarmer commented 7 years ago

Let's not hard code list labels in the LaTeX, since that violates the promise that authors can revert to LaTeX.

Let me also recall the hope that (once PTX is stable enough) then the LaTeX markup should be locally isomorphic to the PTX markup, to the extent possible under the limitations of LaTeX. I realize that sidebyside and nested tasks will be a challenge, but it definitely can be done with enough knowledge of TeX.

oscarlevin commented 7 years ago

Instead of hard coding anything, why not just use nested ordered lists? Both for subtasks and for ordered lists inside tasks. LaTeX doesn't need to know the difference. For tasks, just push the depth of the enumerate 1 more than it's parent (i.e., start at depth 1 instead of 0).