PreTeXtBook / pretext

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

Fillin overhaul #1727

Closed Alex-Jordan closed 1 year ago

Alex-Jordan commented 1 year ago

This removes latex.fillin.style (so there will need to be an -announce message) just for that.

It puts publication/common/fillin/@textstyle and @mathstyle in place in publication files. Each may be underline (default for text), box, or shade (default for math).

With shade becoming default for math (an improvement, I think), that is another reason for an -announce message.

The text fillin can compress in LaTeX up to 20% to help with line fitting. The text fillin in HTML puts classes in place, but a separate CSS PR is needed to actually make things happen there.

The math fillin templates are all in -common. In the end I found a way to make that work either way.

Text fillin uses @characters with default 10. Math fillin can use @characters or like @fill="\frac{x+1}{2}" with default @fill="XXX". fill trumps characters.

This does not improve accessibility for fillins. It's already OK for fillins in text. And things are not good for fillins in math and it stays that way with these commits. But I have a lead on @pkra's aria-label MathJax extension that might work out separately, later. That extension is not playing will with \phantom right now.

Lots of doc cutting and editing for this. I tried to pay lots of attention, but a second set of eyes on that would be good.

Not sure how you want to handle schema here. Now two types of fillin, one in math and one not?

Alex-Jordan commented 1 year ago

This replaces #1710 .

rbeezer commented 1 year ago

A lot of work here! ;-)

Comments based on visual review. Feel free to pile on commits, or force-push, neither is a problem.

Alex-Jordan commented 1 year ago

DOCUMENT-FILTER

Oh! I had that for something that was cut once I found a way to do shade in math that worked for both LaTeX and MathJax. Can cut with the next force push.

The new publisher variables here apply to all output forms. But the old stringparam latex.fillin.style is only for LaTeX. So I don't see a way to make the new publisher variables respect the old stringparam.

The only way I see to continue to respect the old stringparam is to do things with it inside the LaTeX stylesheet. I will do that if you'd like. The change here would affect anyone who uses latex.fillin.style="box". Maybe just my opinion, but moving to the text default of underline and math default of shade feels like improvements in both places. I was thnking it's like an opportunity to really kill an old stringparam without anyone complaining.

In the next force push I will modularize the latex macro definition so that the beamer template just calls it instead of repeating that code.

rbeezer commented 1 year ago

The new publisher variables here apply to all output forms.

OK, I see. Make that distinction clear then for -announce. "LaTeX output will revert to the default value which is 'underline'. An election for "box" needs to use the new publisher variable." Or something along those lines, I'm not checking that what I just said is correct.

And maybe review the deprecation message. We want to reduce panic. ;-)

Alex-Jordan commented 1 year ago

Will the schema be able to say that a fillin inside math can have @characters, or it can have @fill, but it cannot have both?

rbeezer commented 1 year ago

Yes. Easy-peasy. (I think.)

Alex-Jordan commented 1 year ago

OK, Take 2 is ready.

Even if everything here looks good, still need:

Should I try the schema updates or is it trivial for you?

rbeezer commented 1 year ago

@rbeezer can do the schema.

We don't need to wait on CSS, right? That'll end up with @davidfarmer post-facto?

-announce is for @alex-jordan.

On May 30, 2022 5:01:19 PM PDT, Alex Jordan @.***> wrote:

OK, Take 2 is ready.

Even if everything here looks good, still need:

  • schema updates
  • CSS for .fillin.underline, .fillin.box, .fillin.shade
  • message to -announce

Should I try the schema updates or is it trivial for you?

Alex-Jordan commented 1 year ago

Got it.

@davidfarmer At Subsection 4.7: Some Paragraph-Level Markup https://spot.pcc.edu/~ajordan/temp/interesting-corollary.html#subsection-paragraph-markup I repeated a paragraph with fillins three times.

The first paragraph has .fillin.underline. Then .fillin.box. Then .fillin.shade.

We need plain .fillin to continue looking like it looks now. And .fillin.underline should look the same way.

.fillin.box should put a border around the span and give it an appropriate height.

.fillin.shade should give it an appropriate height, but no border. And make the background color be gray. Specifically #e6e6e6.

I would add these except I know CSS is in so much transition right now.

davidfarmer commented 1 year ago

I can do the CSS once an example is posted.

On Mon, 30 May 2022, Rob Beezer wrote:

@rbeezer can do the schema.

We don't need to wait on CSS, right? That'll end up with @davidfarmer post-facto?

-announce is for @alex-jordan.

On May 30, 2022 5:01:19 PM PDT, Alex Jordan @.***> wrote:

OK, Take 2 is ready.

Even if everything here looks good, still need:

  • schema updates
  • CSS for .fillin.underline, .fillin.box, .fillin.shade
  • message to -announce

Should I try the schema updates or is it trivial for you?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you werementioned.[AABTULCWOTFPLYUXWZTJMFLVMWTUVA5CNFSM5XJW6PZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTD N5WW2ZLOORPWSZGOIQGPNJQ.gif] Message ID: @.***>

Alex-Jordan commented 1 year ago

My most recent message here has an example posted. A "real" example will only have one of the fillin classes so I doctored that one to have all three.

rbeezer commented 1 year ago

Very good! That's all a big improvement. I'll rebuild website shortly.

Removed a mention in the sample article of @characters being deprecated. And exploded out into severtal topical commits keeping all references to the work being yours.

rbeezer commented 1 year ago

Closed this too soon. But schema work is now done at: b65452bad36f5942e9d1ffafd857951f81bc0641

I classified a fill-in blank for text as a "generator" rather than a "character". May have lost a few odd-ball uses that didn't really make any sense anyway. And a new pattern for the math context. Tests well against the sample article.

Alex-Jordan commented 1 year ago

Thanks! Is it ready for an announce message? Maybe after @davidfarmer styles the HTML blanks?

rbeezer commented 1 year ago

Knew I was forgetting something. Yes, fire away proudly on -announce. I thought shade looked quite good already in HTML. Your call on CSS timing.

Alex-Jordan commented 1 year ago

Math fillin in HTML is covered. CSS is needed for HTML text fillin. But the default is underline and that is already what you get even without new CSS. So I'll do the -announce now. Now rush on box and shade CSS for text fillin.

Alex-Jordan commented 1 year ago

My most recent message here has an example posted. A "real" example will only have one of the fillin classes so I doctored that one to have all three.

On Tue, May 31, 2022, 4:38 AM David W. Farmer @.***> wrote:

I can do the CSS once an example is posted.

On Mon, 30 May 2022, Rob Beezer wrote:

@rbeezer can do the schema.

We don't need to wait on CSS, right? That'll end up with @davidfarmer post-facto?

-announce is for @alex-jordan.

On May 30, 2022 5:01:19 PM PDT, Alex Jordan @.***> wrote:

OK, Take 2 is ready.

Even if everything here looks good, still need:

  • schema updates
  • CSS for .fillin.underline, .fillin.box, .fillin.shade
  • message to -announce

Should I try the schema updates or is it trivial for you?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you werementioned.[AABTULCWOTFPLYUXWZTJMFLVMWTUVA5CNFSM5XJW6PZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTD N5WW2ZLOORPWSZGOIQGPNJQ.gif] Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/PreTeXtBook/pretext/pull/1727#issuecomment-1142019298, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEDOAD57IAPTMHZE6XN6OLVMX22FANCNFSM5XJW6PZQ . You are receiving this because you were mentioned.Message ID: @.***>

Alex-Jordan commented 1 year ago

I think the CSS changes for this was either never done, or reverted during the overhaul. It has gone unnoticed this long because the default is OK. However, in ORCCA I think I will make text fillins have the shade style, and I noticed it was not working.

If you go here: Paragraph https://pretextbook.org/examples/sample-article/html/interesting-corollary.html#p-238

There is a span.fillin.underline. It looks fine. Use the inspector to change it to span.fillin.box or span.fillin.shade, and nothing changes. I'm comfortable going in to make these CSS additions, but I want to check in with @davidfarmer first.

davidfarmer commented 1 year ago

I added CSS for: span.fillin.underline span.fillin.box span.fillin.shade

Formerly there was only span.fillin , which is the same as what now is span.fillin.underline .

Let me know if something does not look right when those are actually in the sample article.

On Wed, 22 Mar 2023, Alex Jordan wrote:

I think the CSS changes for this was either never done, or reverted during the overhaul. It has gone unnoticed this long because the default is OK. However, in ORCCA I think I will make text fillins have the shade style, and I noticed it was not working.

If you go here: Paragraph https://pretextbook.org/examples/sample-article/html/interesting-corollary.html#p-238

There is a span.fillin.underline. It looks fine. Use the inspector to change it to span.fillin.box or span.fillin.shade, and nothing changes. I'm comfortable going in to make these CSS additions, but I want to check in with @davidfarmer first.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.[AABTULF5ZKQ6D6HG7DXQZNTW5NBYZA5CNFSM5XJW6PZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOLA4EEPI.gif] Message ID: @.***>

Alex-Jordan commented 1 year ago

Let me know if something does not look right when those are actually in the sample article.

It is a publisher switch to use one of the options globally, so it will never be the case that you can see them all on the same page with the untouched sample article. But using the inspector to change a class should be OK to get a glimpse of the other two styles.

@rbeezer had some suggestions at last week's drop-in about where the baseline of these things should be. Rob, if you look here, what would you change? I can't recall the differences (if any) for the baseline between underline, box, and shade.