Tables and axes > More about axes > Pagination > Repeating elements on continued tables
 
Repeating elements on continued tables
Quick reference
To flag elements for printing at the top of continuation pages in addition to, or instead of, the table base, include the option:
hold=position
on those elements, where position is a number between 1 and 9 indicating the position in which that element is to be printed in relation to other held elements.
More information
When a table is too long to fit onto one page, the base is automatically printed as the first row of all subsequent pages of the table. By flagging elements in the row axis with the option hold=n, you can determine which other elements should be printed in addition to or instead of the base.
This option can appear on any n statement, or an equivalent. The value of n can be between 1 and 9, with elements with lower values being printed before those with higher values. If two or more elements have the same hold value, the most recent one before the page break supersedes any previous elements with that value.
The default for non-base elements is no hold at all; the default for bases is hold=0 which causes them to be printed at the top of the table before any other held items. You can place your own hold value on base elements to override the default.
Example
l likes
n10Base
n01Unweighted base;hold=1
n03Color;hold=2
col 123; Color comments ......
n03Flavor;hold=2
col 126; Flavor comments .....
n03Packaging;hold=2
col 129; Packaging comments ....
n03Other comments;hold=2
col 132; Miscellaneous comments
In a table created with this axis as the row axis, the base and the unweighted base will be printed at the top of every page of the table. Each of the subcategories in the axis has the option hold=2. This means that only the current category heading will be printed at the top of the continuation page. So, if the table breaks in the middle of the flavor category, the Flavor heading will appear underneath the two base elements at the top of the next page. The Color category is finished, so its hold flag has been overridden; the Packaging and Other comments categories have not yet been reached so their flags have not been set.
In a sorted table of nets specified as follows:
l likes;sort
n10Base
net1Color;hold=2
col 123; Color comments ......
n03
net1Flavor;hold=2
col 126; Flavor comments .....
n03
net1Packaging;hold=2
col 129; Packaging comments ....
netend1
n03Other comments;hold=2
col 132; Miscellaneous comments
the n03s before the nets hugs with the nets when the hold flags are assigned. This can cause unwanted blank lines to appear at the top of continued tables. To prevent this, place nosort on the n03s before the nets.
Quantum starts a new page when:
There is no room on the current page for the row about to be printed.
Quantum looks at the hold value on that row, if any, and cancels any previously held rows with that value.
An n09 is encountered, or an n09;hug= with insufficient space on the current page for the hug= to be satisfied.
Quantum looks at the hold value of the row immediately after the n09 and cancels any previously held elements with that value.
An n23 is encountered with insufficient room on the page for the n23, any following text-only rows, and the next row containing figures.
First, Quantum looks at the hold value, if any, on the n23 and cancels the previously held rows at this level. Then it looks at the row containing figures. If this is a base with the default hold=0, it cancels the previous row at that level; if not, it does not cancel any hold= value associated with that row.
In all cases, Quantum then prints the table headings and any held rows, followed by the row about to be printed. Finally, it puts the hold= in force for this row. In the situations described in the second and third bullet points, Quantum does not distinguish between printing and non-printing rows when looking ahead.
Once hold is in force at a given level, the only way to cancel it is to introduce a new hold at that level. To cancel a hold without generating a new printing element, enter a statement of the form:
n03;hold=n;norow
n is the hold level to be canceled.
See also
Pagination