Letting solutions use up worksheet workspace

22 views
Skip to first unread message

Oscar Levin

unread,
May 12, 2026, 7:37:34 PMMay 12
to PreTeXt development
I'm working on some improvements to worksheets and handouts (btw, now's a good time to send requests if you have them).  One oft-requested feature is to let solutions replace the workspace that was present when the solutions are toggled off.  

In the current web version of this, that already happens.  Sort of.  Here is the current state of things:
  1. If you use authored pages, then toggling any of the solution-like elements will reflow each page, distributing any remaining workspace as equitably as possible.  So if  exercise 1 had 4 inches of workspace and a exercise 2 had 1 inch of workspace, and both had a solution that took up 2 inches, there would still be 4 times as much space after the solution to exercise 1 as there is after the solution to exercise 2.
  2. If you don't use authored pages, then:
    1. The first thing the javascript does when you click the print preview is attempt to create pages that distribute extra workspace equitably.  
    2. This is done using the actual heights of elements shown on the page: if "hide solutions" is unchecked, then the solutions are treated like text and the page-breaking algorithm tries to add the requested amount of workspace after them.
    3. Once pages are established, toggling the "hide solutions" will keep those pages as is, but increase/decrease vertical white space as needed.
So in case 2, if you are someone who wants to solutions to use up the workspace, you need to hide solutions, reload to get your desired page breaks, and then unhide solutions.  If you have authored the worksheet with the intent of always showing solutions, then you probably want to reload the page after you have unhid the solutions.  

The question is whether this is good enough.  We could add a button to "reflow pages" (which really would just reload the page) to help users discover this "feature".  We could also always hide solutions when computing page breaks (in case 2) and then show them again if the "hide solutions" box is unchecked.  That is probably the most sensible option, but it does make it harder for an author to see why their long solutions are running off the end of the page.  In fact, if there is a really long solution, there would be no way to break pages differently so it doesn't get cut off.

What say you all?

David Austin

unread,
May 13, 2026, 7:18:13 AMMay 13
to prete...@googlegroups.com
Thanks for the thought you've put into this, Oscar. 

So in case 2, if you are someone who wants to solutions to use up the workspace, you need to hide solutions, reload to get your desired page breaks, and then unhide solutions.  If you have authored the worksheet with the intent of always showing solutions, then you probably want to reload the page after you have unhid the solutions.  

This workflow (hide-reload-unhide) seems somewhat tedious and unintuitive, and I suspect some authors would not know about it so I agree with your suggestion to add a Reflow pages button to make it clear.  It also makes sense to compute the page breaks with the solutions hidden since that will probably match the version students have seen.  I think I could deal with the issue of solutions running off the page if these things are in place.  So I agree with your proposal!

David

The question is whether this is good enough.  We could add a button to "reflow pages" (which really would just reload the page) to help users discover this "feature".  We could also always hide solutions when computing page breaks (in case 2) and then show them again if the "hide solutions" box is unchecked.  That is probably the most sensible option, but it does make it harder for an author to see why their long solutions are running off the end of the page.  In fact, if there is a really long solution, there would be no way to break pages differently so it doesn't get cut off.

What say you all?

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/223438c4-ae27-4ec5-9714-de6a5ca9d3a3n%40googlegroups.com.

Oscar Levin

unread,
May 13, 2026, 10:23:20 AMMay 13
to PreTeXt development
Thanks for the confirmation.  

Followup question for the group: Is there any reason we should support sensible page breaks in a printout that in which solutions are expected to be printed always?

I am a little concerned about what happens when adding in the solutions results in page overflow.  

But overflowing pages is a problem in general.  What should happen if and author uses #page elements and their content doesn't fit?  Should we still have a pagebreak after the page (but split the content into two pages)?  That is what would happen in a LaTeX authored PDF I suppose.  

For an instructor, is there a reasonable use case for a printout that will *always* include solutions?  Or are solutions always a thing that can be added in place of workspace for a second printing?  If the latter, then it makes sense to keep the starts of pages consistent in both versions, and I know how to do this (I think).  But this does mean that if the version with solutions hidden can fit on a single page, then the version with solutions will spill over and there might be a large empty page after the end of the solution.

David Austin

unread,
May 14, 2026, 6:32:33 AMMay 14
to prete...@googlegroups.com
I'm writing here only as someone who uses #worksheets and has heard from others as they learn to do so.

For an instructor, is there a reasonable use case for a printout that will *always* include solutions?  Or are solutions always a thing that can be added in place of workspace for a second printing? 

I wouldn't want to always include solutions when there is provided workspace (if the solutions are provided, what is the audience supposed to add?).  So I think about this as adding solutions for a second printing.  As an author, if I notice that the solution is overfilling the workspace, that would tell me to increase the workspace since students would presumably need a similar amount of space.  
 
If the latter, then it makes sense to keep the starts of pages consistent in both versions, and I know how to do this (I think).  But this does mean that if the version with solutions hidden can fit on a single page, then the version with solutions will spill over and there might be a large empty page after the end of the solution.

On Wednesday, May 13, 2026 at 5:18:13 AM UTC-6 david.a...@gmail.com wrote:
Thanks for the thought you've put into this, Oscar. 

So in case 2, if you are someone who wants to solutions to use up the workspace, you need to hide solutions, reload to get your desired page breaks, and then unhide solutions.  If you have authored the worksheet with the intent of always showing solutions, then you probably want to reload the page after you have unhid the solutions.  

This workflow (hide-reload-unhide) seems somewhat tedious and unintuitive, and I suspect some authors would not know about it so I agree with your suggestion to add a Reflow pages button to make it clear.  It also makes sense to compute the page breaks with the solutions hidden since that will probably match the version students have seen.  I think I could deal with the issue of solutions running off the page if these things are in place.  So I agree with your proposal!

David

The question is whether this is good enough.  We could add a button to "reflow pages" (which really would just reload the page) to help users discover this "feature".  We could also always hide solutions when computing page breaks (in case 2) and then show them again if the "hide solutions" box is unchecked.  That is probably the most sensible option, but it does make it harder for an author to see why their long solutions are running off the end of the page.  In fact, if there is a really long solution, there would be no way to break pages differently so it doesn't get cut off.

What say you all?

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/223438c4-ae27-4ec5-9714-de6a5ca9d3a3n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages