PageRenderTime 21ms CodeModel.GetById 18ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/share/doc/usd/22.trofftut/tt05

https://bitbucket.org/freebsd/freebsd-head/
#! | 130 lines | 130 code | 0 blank | 0 comment | 0 complexity | 917fff896a2dd740ad14a53ab9439ec6 MD5 | raw file
  1.\" This module is believed to contain source code proprietary to AT&T.
  2.\" Use and redistribution is subject to the Berkeley Software License
  3.\" Agreement and your Software Agreement with AT&T (Western Electric).
  4.\"
  5.\"	@(#)tt05	8.1 (Berkeley) 6/8/93
  6.\" Copyright (C) Caldera International Inc. 2001-2002.  All rights reserved.
  7.\" 
  8.\" Redistribution and use in source and binary forms, with or without
  9.\" modification, are permitted provided that the following conditions are
 10.\" met:
 11.\" 
 12.\" Redistributions of source code and documentation must retain the above
 13.\" copyright notice, this list of conditions and the following
 14.\" disclaimer.
 15.\" 
 16.\" Redistributions in binary form must reproduce the above copyright
 17.\" notice, this list of conditions and the following disclaimer in the
 18.\" documentation and/or other materials provided with the distribution.
 19.\" 
 20.\" All advertising materials mentioning features or use of this software
 21.\" must display the following acknowledgement:
 22.\" 
 23.\" This product includes software developed or owned by Caldera
 24.\" International, Inc.  Neither the name of Caldera International, Inc.
 25.\" nor the names of other contributors may be used to endorse or promote
 26.\" products derived from this software without specific prior written
 27.\" permission.
 28.\" 
 29.\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
 30.\" INTERNATIONAL, INC.  AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
 31.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 32.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 33.\" DISCLAIMED.  IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
 34.\" FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR
 35.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 36.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 37.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 38.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 39.\" OR OTHERWISE) RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 40.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 41.\" 
 42.\" $FreeBSD$
 43.\"
 44.NH
 45Tabs
 46.PP
 47Tabs
 48(the \s8ASCII\s0 `horizontal tab' character)
 49can be used to produce output in columns,
 50or to set the horizontal position of output.
 51Typically
 52tabs are used only in unfilled text.
 53Tab stops are set by default every half inch from the
 54current indent,
 55but
 56can be changed by the
 57.BD .ta
 58command.
 59To set stops every inch, for example,
 60.P1
 61^ta 1i 2i 3i 4i 5i 6i
 62.P2
 63.PP
 64Unfortunately the stops are left-justified only
 65(as on a typewriter),
 66so lining up columns of right-justified numbers can be painful.
 67If you have many numbers,
 68or if you need more complicated table layout,
 69.ul
 70don't
 71use
 72.UL troff 
 73directly;
 74use the
 75.UL tbl
 76program described in [3].
 77.PP
 78For a handful of numeric columns, you can do it this way:
 79Precede every number by enough blanks to make it line up
 80when typed.
 81.P1
 82^nf
 83^ta 1i 2i 3i
 84\0\01\0\fItab\fR\0\0\02\0\fItab\fR\0\0\03
 85\040\0\fItab\fR\0\050\0\fItab\fR\0\060
 86700\0\fItab\fR\0800\0\fItab\fR\0900
 87^fi
 88.P2
 89Then change each leading blank into the string
 90.BD \e0 .
 91This is a character that does not print, but that has
 92the same width as a digit.
 93When printed, this will produce
 94.P1
 95.ta 1i 2i 3i
 96\0\01	\0\02	\0\03
 97\040	\050	\060
 98700	800	900
 99.P2
100.PP
101It is also possible to fill up tabbed-over space with
102some character other than blanks by setting the `tab replacement character'
103with the
104.BD .tc
105command:
106.P1
107^ta 1.5i 2.5i
108^tc \e(ru	(\e(ru is "\(ru")
109Name \fItab\fR Age \fItab\fR 
110.P2
111produces
112.P1 3
113.ta 1.5i 2.5i
114.tc \(ru
115Name	 Age 	
116.tc
117.P2
118To reset the tab replacement character to a blank, use
119.BD .tc
120with no argument.
121(Lines can also be drawn with the
122.BD \el
123command, described in Section 6.)
124.PP
125.UL troff
126also provides a very general mechanism called `fields'
127for setting up complicated columns.
128(This is used by
129.UL tbl ).
130We will not go into it in this paper.