Use displays to show text-based examples or figures (such as code listings). Displays turn off filling, so lines of code can be displayed as-is without inserting
br requests in between each line. Displays can be
kept on a single page, or allowed to break across pages. The following table shows the display types available.
cb s s s cbt s s cb s cb s ^ s s lfCW s lfCW s l s s. Display macro Type of display With keep No keep _ .DS L .LD Left-justified. .DS I [ indent] .ID T{ Indented (default indent in the DI register). T} .DS B .BD T{ Block-centered (left-justified, longest line centered). T} .DS C .CD Centered. .DS R .RD Right-justified. _
Use the DE macro to end any display type. The macros Ds and De were formerly provided as aliases for DS and DE, respectively, but they have been removed, and should no longer be used. X11 documents which actually use Ds and De always load a specific macro file from the X11 distribution (macros.t) which provides proper definitions for the two macros.
To keep text together on a page, such as a paragraph that refers to a table (or list, or other item) immediately following, use the KS and KE macros. The KS macro begins a block of text to be kept on a single page, and the KE macro ends the block.
You can specify a floating keep using the KF and KE macros. If the keep cannot fit on the current page, groff holds the contents of the keep and allows text following the keep (in the source file) to fill in the remainder of the current page. When the page breaks, whether by an explicit bp request or by reaching the end of the page, groff prints the floating keep at the top of the new page. This is useful for printing large graphics or tables that do not need to appear exactly where specified.
The macros B1 and B2 can be used to enclose a text within a box; .B1 begins the box, and .B2 ends it. Text in the box is automatically placed in a diversion (keep).