Advanced tables and statistics > Laser printed tables with PostScript > Column headings
 
Column headings
Quick reference
To determine the justification of column headings above columns, use the characters:
Character
Description
^
Center the following text.
~
End of text block.
}
Right-justify the following text.
{
Left-justify the following text.
!
Optional break point in text (replace with space).
|
Optional break point in text (replace with nothing).
More information
Column headings that are generated automatically without the use of g and p statements are laid out so that the table extends across the full width of the page. Long texts are folded as necessary to create multi-line headings right-justified above the numbers in each column. You can use the ! and | characters to force breakpoints in element texts used for column headings. However, the ! and | characters only cause a breakpoint in PostScript output when the element text is too wide for the column, whereas they always cause a breakpoint in the standard output.
Column texts defined on g statements may be left-justified, right-justified or centered within a column. The position of a text in a column is determined by the use of the characters { }, ^ and ~ in the text where you would normally have a | or a blank space between columns:
Symbol
Description
}
Start right-justified column text.
{
Start left-justified text.
^
Start centered text.
~
End of text block, for example, a column heading. If this is omitted, the column is assumed to end at the next { } or ^ character, whichever is the sooner. These special characters are the defaults. You can define your own characters to be used in place of any or all of the defaults.
The characters { } and ^ mark the start of a column, and ~ marks the end. Any text between these characters is justified according to the character which precedes them.
For example:
l color
col 32;Base;Red;Green;Yellow
g} Base~ } Red~ } Green~ } Yellow~
p x x x x
requests that the column headings should be right-justified in the space between the } and ~ characters: that is, the right-most character of the column heading should be printed immediately above the right-most digit in that column, as specified by the p statement. Without the ~, the text would be right-justified between the } signs before and after the column text.
Similarly,
l color
col 32;Base;Red;Green;Yellow
g{ Base{ Red{ Green{ Yellow~
p x x x x
causes column headings to be left-justified above each column of numbers, whereas:
l color
col 32;Base;Red;Green;Yellow
g^ Color Preferred ~
g} Base^ Red^ Green^ Yellow~
p x x x x
indicates that the Base text should be right-justified while the remaining column texts should be printed centrally above each column. The overall axis heading is centered above the column headings. Right-justified text above columns generally looks best, particularly for the lowest level of headings (the colors in the examples), so you will probably use the } character in most of your headings.
In these examples, the column heading is set out as it has always been; the difference is the presence of the } and ~ characters at the start of each column where you would normally have typed a space. The position of the special characters is important since they determine the space in which the column headings is justified. The examples show the special characters immediately to the left of the cell marker on the p statement so that the text is justified between the end of the previous column and the end of the current column. If you put the special characters in other positions, the text is still justified between those characters even if this means that it no longer lines up with the columns themselves.
If you type text on g statements but omit the layout control characters, the tables contain blank lines instead of column headings. Control characters do not affect your tables when they are formatted for printing on a non-Postscript printer; that is when you run Quantum but not pstab. The column headings retain their correct layout with the special characters being replaced by spaces.
In tables with a large number of column headings, there might not be enough room on the page to fit the individual column texts in the space allocated to each column. For example, where you ask for a long word to be centered across a column, the column may not be wide enough to print the text in the font you are using. If this happens, Quantum squashes the characters until the text fits in the space available.
See
User-definable PostScript characters
See also
Laser printed tables with PostScript