Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scaffold section numbering #579

Merged
merged 4 commits into from
Jun 16, 2021

Conversation

Alex-Jordan
Copy link
Contributor

This adds an option for each Scaffold() to have numbering. There is a companion PR for styling at openwebwork/webwork2#1383.

In addition to the numbered => 1 option, I tweaked styling for nested scaffolds. In LaTeX, they now indent 1em for each level of depth. And in HTML, they no longer contract in width from the right, only from the left.

Here is a simple test file demonstrating sections with depth, and the various numbering and title combinations.

DOCUMENT();

loadMacros("PGstandard.pl","scaffold.pl");

Scaffold::Begin(numbered=>1);
  Section::Begin("The outer scaffold is numbered");
    Scaffold::Begin(numbered=>1);
        Section::Begin("The next scaffold is numbered");
        Section::End();
        Section::Begin("Its first and second sections have titles, but not the third");
        Section::End();
        Section::Begin();
            Scaffold::Begin();
                Section::Begin("This is an unnumbered scaffold");
                Section::End();
                Section::Begin("Its first and second sections have titles, but not the third");
                Section::End();
                Section::Begin();
                Section::End();
            Scaffold::End();
        Section::End();
    Scaffold::End();
  Section::End();
  Section::Begin("Here is the last section of the outer scaffold");
  Section::End();
Scaffold::End();

ENDDOCUMENT();

@Alex-Jordan
Copy link
Contributor Author

I'm not sure what I was thinking, but obviously adding to and subtracting from \parindent does not really indent the levels in hardcopy output. I'll think about doing that better.

@dpvc
Copy link
Member

dpvc commented May 29, 2021

adding to and subtracting from \parindent does not really indent the levels in hardcopy output

Do mean to adjust \leftskip instead?

@Alex-Jordan
Copy link
Contributor Author

@dpvc That's where I landed when I went back to look at alternatives last night. I'm still looking at if that could cause unforeseen consequences depending on what is inside each section. Probably not, at least not that I can think of so far. The other thing I was consider is using the changepage package.

@Alex-Jordan
Copy link
Contributor Author

With the 2.16 release candidate announced, is it still OK to direct this PR (and others) to the 2.16 branch? I'm sorry I haven't been able to attend the release team meetings. This coming week is my last week of class for the term, and I'll be up for most meetings after that.

@drgrice1
Copy link
Member

It is still okay to target small changes to the 2.16 branch. Bigger changes will probably be deferred. It doesn't hurt to target the branch though. We can always change it and say it needs to wait.

@Alex-Jordan
Copy link
Contributor Author

I made it add/subtract to/from \leftskip, as @dpvc suggested. I chose 15pt since that is the default \parindent for 10pt documents, and maybe it would be nice for it to indent that way to align with outer paragraphs that have opening indentation.

@Alex-Jordan
Copy link
Contributor Author

I added a commit here that is PreTeXt-specific. We will be retiring the "stage" element in favor of the "task" element for subdividing an exercise, and that might as well happen now on the WeBWorK side.

@Alex-Jordan
Copy link
Contributor Author

This is ready for a review now alongside openwebwork/webwork2#1383.

@Alex-Jordan Alex-Jordan requested a review from drgrice1 June 4, 2021 22:35
Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay. I don't think that nesting accordions is that great of an idea in general. I also am not fond of the numbering system implemented (a.i.A, a.i.B, a.ii.A, etc).

Since the defaults are maintained without the new option, I approve.

@Alex-Jordan
Copy link
Contributor Author

I also am not fond of the numbering system implemented (a.i.A, a.i.B, a.ii.A, etc).

This is the default enumeration scheme with LaTeX. Well, it's really (a), then i., then A. Starting at depth 2 since the problem number itself is depth 1.

@Alex-Jordan
Copy link
Contributor Author

I don't think that nesting accordions is that great of an idea in general.

I agree and I have no plans personally to use this, but I need to make it work in a nested manner with enumeration for PreTeXt's purposes. There, an exercise can have task children, which can nest 3 deep within the exercise. It feels like every time there is something silly and extreme that I leave unimplemented, it's only a matter of time before a PreTeXt user comes asking about it in the forum there.

@drgrice1
Copy link
Member

drgrice1 commented Jun 5, 2021

I see. In the context of a problem I prefer to use upper case alphabetic characters for parts, and never nest past the first level. I try to avoid roman numerals because students can't count past three in that system (if that).

In any case, I think this pull request (and the paired webwork2 PR) is good.

It would be good if someone else took a look though.

@Alex-Jordan
Copy link
Contributor Author

Alex-Jordan commented Jun 9, 2021

I changed this to be less excessive. It now only supports numbers up to 99 at each depth (up to cu, xcix, CU). And unlike before, if you exceed the maximum that it supports, you still get good numbers but they are left as arabic.

@Alex-Jordan Alex-Jordan requested review from dlglin and drdrew42 June 9, 2021 23:49
@Alex-Jordan
Copy link
Contributor Author

This pull request (and the accompanying openwebwork/webwork2#1383) is holding up some PreTeXt development. Assuming @drgrice1 and I approve it, could I ask for one more review to meet our three-approval standard?

Copy link
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@pstaabp pstaabp merged commit 27a6553 into openwebwork:PG-2.16 Jun 16, 2021
drgrice1 pushed a commit that referenced this pull request Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants