Might I please have some help with writing a loop that repeats a block of text as many times as there is remaining space for it on the page?
I would like to produce an notebook in TeX which is divided into a number of sections. Each section would start with some printed records (taken from an existing database) followed by some space to hand-write in new entries.
The space for handwritten records is generated by something along the following lines:
\noindent Type of Widget: \dotfill \break
Observations: \dotfill \break
\null\dotfill
The problem I have is that of vertical alignment: I want each section to start at the top of a new page, followed by the printed records and then enough blocks for handwritten notes to fill up the remaining vertical space on that page. Something like this:
Section: Special Widgets
Type of Widget: ABC123
Observations: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse id orci nunc, sed sollicitudin lectus.
Type of Widget: CDE123
Observations: Etiam lacus sem, pharetra vel eleifend ac, elementum at leo. Ut pulvinar, lorem sit amet feugiat hendrerit, sapien justo accumsan eros, eleifend consectetur nisl urna at nibh.
Type of Widget: ...........
Observations: ...................................................................................................
............................................................................................................................
Type of Widget: ...........
Observations: ...................................................................................................
............................................................................................................................
Since the length of the records can vary, I therefore need to run a loop which does something like the following (in eplain pseudo code):
\for
\noindent Type of Widget: \dotfill \break
Observations: \dotfill \break
\null\dotfill
\if **test to see if there is enough vspace to repeat block**
\repeat
Could anyone point me in the right direction as to how to write a test for "is there enough space left on the page to print this block of text?". I presume I would start by making a \vbox the size of the block and then see if it will fit onto the current page but I can't work out how to make that work.
I hope this is clear enough. If not, please let me know.
Thanks.
-Jacob