⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tbl

📁 unix v7是最后一个广泛发布的研究型UNIX版本
💻
📖 第 1 页 / 共 3 页
字号:
.if \nM=0 .RP.TM 76-1274-5 39199 39199-11.if \n(tm>0 .ND June 11, 1976*.TLTbl \(em A Program to Format Tables.AU "MH 2C-569" 6377M. E. Lesk.AI.MH.if \n(tm>0 .FS.if \n(tm>0 * This printing revised through August 5, 1977.if \n(tm>0 .FE.AB.ITbl.Ris a document formatting preprocessor for.Itroff.Ror.Inroff.Rwhich makesevenfairly complex tables easy to specify and enter.It is available onthe.SMPDP-11 UNIX*.NLsystem.FS* UNIX is a Trademark/Service Mark of the Bell System.FEand on Honeywell 6000.SMGCOS..NLTables are made up of columns which may be independently centered, right-adjusted,left-adjusted, or aligned by decimal points.Headings may be placed over single columns or groups of columns.A table entry may contain equations, or may consist of several rows of text.Horizontal or vertical lines may be drawn as desiredin the table,and any table or element may be enclosed in a box.For example:.in 0.ll.sp .5.TScenter, box;c  s  s  sc  s  s  sc |c |c |cc |c |c |cl |n |n |n.1970 Federal Budget Transfers\s-2(in billions of dollars)\s0=State	Taxes	Money	Net\^	collected	spent	\^_New York	22.91	21.35	\-1.56New Jersey	8.33	6.96	\-1.37Connecticut	4.12	3.10	\-1.02Maine	0.74	0.67	\-0.07California	22.29	22.42	+0.13New Mexico	0.70	1.49	+0.79Georgia	3.30	4.28	+0.98Mississippi	1.15	2.32	+1.17Texas	9.33	11.13	+1.80.TE.AE.OKPhototypesettingDocumentation.CS  16 0 16 0 12 6.tr # .de e1.nr \\$1 \\$2...de e2.if !\\n(\\$1=\\n% .tm Error in example \\$1: referred to page \\n(\\$1, is on page \\n%.rr \\$1...di qq.EQdelim $$.EN.di.rm qq.SHIntroduction..PP.ITbl.Rturns a simple descriptionof a table into a.Itroff.Ror.Inroff.R[1]program (list of commands) that prints the table..ITbl.Rmay be used on the\s-2PDP-\s011 \s-2UNIX\s0.NL[2] system and on the Honeywell 6000.SMGCOS.NLsystem.Itattempts to isolate a portion of a job that it cansuccessfullyhandle and leave the remainder for other programs.Thus.Itbl.Rmay be used with the equation formattingprogram.Ieqn.R[3]or variouslayout macro packages[4,5,6],but does not duplicate their functions..PPThis memorandum is divided into two parts.First we give the rules for preparing.Itbl.Rinput; then some examples are shown.The description of rules is precise but technical, andthe beginning user may prefer to read the examples first,as they show some common table arrangements.A section explaining how to invoke.Itbl.Rprecedes the examples.To avoid repetition, henceforth read.Itroff.Ras.I``troff.Ror.Inroff.''.R.ds . \^\s14.\s0.PPThe input to.Itbl.Ris text for a document, with tables preceded by a ``\*.TS''(table start)command and followed by a ``\*.TE''(table end) command..ITbl.Rprocesses the tables, generating.Itroff.Rformatting commands,and leaves the remainder of the text unchanged.The ``\*.TS'' and ``\*.TE''lines are copied, too, so that.Itroff.Rpage layout macros(such as the memo formatting macros [4]\|) can use these linesto delimit and place tables as they see fit.In particular, any arguments on the ``\*.TS'' or ``\*.TE''linesare copied but otherwise ignored, and may be used by document layoutmacro commands..PPThe format of the input is as follows:.DS\&text\&\*.TS\&\fItable\fR\&\*.TE\&text\&\*.TS\&\fItable\fR\&\*.TE\&text\&\&\*. \*. \*..DEwhere the format of each table is as follows:.DS\&\*.TS\fIoptions \fB;\fR\fIformat \*.data\&\fR\*.TE.DEEach table is independent, and must contain formattinginformationfollowed by the data to be entered in the table.The formatting information, which describes theindividual columns and rows of the table, may be precededby a few options that affect the entire table.A detailed description of tables is given in the next section..sp .5.SHInput commands..PPAs indicated above, a table contains, first, global options,then a format section describing the layout of the tableentries, and then the data to be printed.  The format and dataare always required, but not the options.The various parts of the table are entered as follows:.sp .5v.IP 1)O\s-2PTIONS.\s0There may be a single line of optionsaffecting the whole table.If present, this line must follow the \*.TS line immediatelyand must contain a list of option namesseparated by spaces, tabs, or commas, and must be terminated by a semicolon.The allowable options are:.RS.IP \fB##center\fR 13\(em center the table (default is left-adjust);.IP \fB##expand\fR\(em make the table as wide as the current line length;.IP \fB##box\fR\(em enclose the table in a box;.IP \fB##allbox\fR\(em enclose each item in the table in a box;.IP \fB##doublebox\fR\(em enclose the table in two boxes;.IP \fB##tab#\fR(\fIx\fR\^)\(em use \fIx\fR instead of tab to separate data items..IP \fB##linesize#(\fIn\fR\^)\(em set lines or rules (e.g. from \fBbox\fR\^) in \fIn\fR point type;.IP \fB##delim#(\fIxy\fR\^)\(em recognize \fIx\fR and \fIy\fR as the \fIeqn\fR delimiters..RE.LP.ns.IPThe.Itbl.Rprogramtries to keep boxed tables on one page by issuingappropriate ``need'' (\fI\*.ne\fR\|) commands.These requests are calculated from the number of lines in the tables,and if there are spacing commands embedded in the input, these requests may be inaccurate;use normal.Itroff.Rprocedures, such as keep-release macros, in that case.The user who must have a multi-page boxed tableshould use macros designed for this purpose,as explained below under `Usage.'.sp .5v.IP 2) 5F\s-2ORMAT\s0.The format section of the table specifies the layoutof the columns.Each line in this section corresponds to one lineof the table (except that the last line corresponds to all followinglines up to the next \*.T&, if any \(em see below),and each line contains a key-letter for each columnof the table.It is good practice to separate the key letters for eachcolumn by spaces or tabs.Each key-letter is one of the following:.RS.cs B 25.IP "##\fBL\fR#or#\fBl\fR" 10to indicate a left-adjusted column entry;.IP "##\fBR\fR#or#\fBr\fRto indicate a right-adjusted column entry;.IP "##\fBC\fR#or#\fBc\fRto indicate a centered column entry;.IP "##\fBN\fR#or#\fBn\fRto indicate a numerical column entry, to be aligned with othernumerical entries so that the units digits of numbers line up;.IP "##\fBA\fR#or#\fBa\fRto indicate an alphabetic subcolumn;all corresponding entries are aligned on the left, and positionedso that the widest is centered within the column (seeexample on page 12);.IP "##\fBS\fR#or#\fBs\fRto indicate a spanned heading, i.e. to indicate that theentry from the previous column continues across thiscolumn(not allowed for the first column, obviously); or.IP ##\fB\s+4\v'6p'^\v'-6p'\s0\fRto indicate a vertically spanned heading, i.e. to indicate thatthe entry from the previous row continues down through this row.(Not allowed for the first row of the table, obviously)..cs B.RE.LP.ns.IPWhen numerical alignment is specified, a location for the decimalpoint is sought.  The rightmost dot (\*.)adjacent to a digit is used as a decimal point; if there is nodot adjoining a digit, the rightmost digit is used as a units digit;if no alignment is indicated, the item is centered in the column.However, the special non-printing character string \e& may be usedto override unconditionally dotsand digits, or to align alphabetic data;this string lines up where a dot normally would,and then disappears from the final output.In the example below, the items shown at the left will bealigned (in a numerical column) as shown on the right:.KS.TScenter;l6 n.13	134\*.2	4\&\*.226\*.4\*.12	26\*.4\&\*.12abc	abcabc\e&	abc\&43\e&3\*.22	43\&3\*.22749\*.12	749\&\*.12.TE.KE.IP\fBNote:\fRIf numerical data are used in the same column with wider.B Lor.B rtype table entries, the widest \fInumber\fR is centered relativeto the wider.B Lor.B ritems (\fBL\fR is used instead of \fBl\fR for readability;they have the same meaning as key-letters).Alignment within the numerical items is preserved.This is similar to the behavior of.B atype data, as explained above.However,alphabetic subcolumns (requested by the.Ba.Rkey-letter)are always slightly indented relative to.BL.Ritems;if necessary, the column width is increased to force this.This is not true for \fBn\fR type entries..IP.bd I 3.ft IWarning:.ft 1.bd Ithe \fBn\fR and \fBa\fR items should not be used inthe same column..IPFor readability, the key-letters describing each column shouldbe separated by spaces.The end of the format section is indicated by a period.The layout of the key-letters in the format section resemblesthe layout of the actual data in the table.Thus a simple format might appear as:.br.ne 3.in +2.nfc  s  sl  n  n \*..fi.in -2which specifies a table of three columns. The first lineof the table contains a heading centered across all threecolumns; each remaining line contains a left-adjusted itemin the first column followed by two columns of numericaldata.A sample table in this format might be:.br.ne 6v.br.in +4.TSc s sl n n.Overall titleItem-a	34.22	9.1Item-b	12.65	.02Items: c,d,e	23	5.8Total	69.87	14.92.TE.in -4There are some additional features of the key-letter system:.RS.IP "\fI##Horizontal lines#\fR"\(em A key-letter may be replaced by `\(ul'(underscore) to indicatea horizontal line in place of the corresponding column entry,or by `=' to indicate a double horizontal line.If an adjacent column contains a horizontal line, or ifthere are vertical lines adjoining this column,this horizontal line is extended to meet the nearby lines.If any data entry is provided for this column, it is ignored anda warning message is printed..QQ do the D(x) and M(x) to draw a line of 'x' characters..QQ D will draw divided lines, M merged lines. thus - is simplh M(\(ru).IP "\fI##Vertical lines#\fR"\(em A vertical bar may be placed between column key-letters.  This willcause a vertical line between the corresponding columns of the table.A vertical bar to the left of the first key-letteror to the right of the last one produces a line at theedge of the table.If two vertical bars appear between key-letters, a double verticalline is drawn..IP "\fI##Space between columns#\fR"\(em A number may follow the key-letter.  This indicates the amount of separationbetween this column and the next column.The number normally specifies the separation in.Iens.R(oneen.ne 3is about the width of the letter `n').* .FS* More precisely, an en is a number of points (1 point = 1/72 inch)equal to half the current type size..FEIf the ``expand'' option is used, then these numbers are multipliedby a constant such that the table is as wide as the current line length.The default column separation number is 3.If the separation is changed the worst case (largest space requested) governs..IP "\fI##Vertical spanning#\fR"\(em Normally, vertically spanned items extending over severalrows of the table are centered in their vertical range.If a key-letter is followed by.Bt.Ror.B T ,any corresponding vertically spanned itemwill begin at the top line of its range..IP "\fI##Font changes#\fR"\(em A key-letter may be followed by a string containing a fontname or numberpreceded by the letter.B for.B F .This indicates that the corresponding column should be in a differentfont from the default font (usually Roman).All font names are one or two letters; a one-letter fontname should be separated from whatever follows by a space or tab.The single letters\f3B\f1, \f3b\f1, \f3I\f1,and\f3i\f1are shorter synonyms for.B f\^Band.B f\^I .Font change commands given with the table entriesoverride these specifications..IP "\fI##Point size changes#\fR"\(em A key-letter may be followed by the letter.B por.B Pand a number to indicate the point size of the corresponding table entries.The number may be a signed digit, in which case it is taken asan increment or decrementfrom the current point size.If both a point size and a column separation value are given,one or more blanks must separate them..IP "\fI##Vertical spacing changes#\fR"\(em A key-letter may be followed by the letter.B vor.B Vand a number to indicate the vertical line spacing to be usedwithin a multi-line corresponding table entry.The number may be a signed digit, in which case it is taken as an incrementor decrement from the current vertical spacing.A column separation value must be separated by blanks or some otherspecification from a vertical spacing request.This request has no effect unless the corresponding table entryis a text block (see below)..IP "\fI##Column width indication#\fR"\(em A key-letter may be followed by the letter.B wor.B Wand a width value in parentheses.This width is used as a minimum column width.If the largest element in the column is not as wide as the width valuegiven after the \fBw\fR, the largest element is assumed to be that wide.If the largest element in the column is wider than the specified value,its width is used.The width is also used as a default linelength for included text blocks.Normal.Itroff.Runits can be used to scale the width value; if none are used,the default isens.If the width specification is a unitless integerthe parentheses may be omitted.If the width value is changed in a column, the \fIlast\fR one given controls..IP "\fI##Equal width columns#\fR"\(em A key-letter may be followed by the letter.B eor.B Eto indicate equal width columns.All columns whosekey-letters are followed by \fBe\fR or \fBE\fR are made the same width.This permits the user to get a group of regularly spacedcolumns..IP "##\fBNote:\fR#"The order of the above features is immaterial; they need not be separatedby spaces, except as indicated above to avoid ambiguities involvingpoint size and font changes.  Thusa numerical column entry in italic font and 12 point type with a minimumwidth of 2.5 inches and separated by 6 ens from the next column couldbe specified as.in +5np12w(2\*.5i)f\|I  6.in -5.IP "\fI##Alternative notation#\fR"\(em Instead of listing the format of successive lines of a tableon consecutive lines of the format section,successive line formats may be given on the same line, separatedby commas, so that the format for the exampleabove might have been written:.in +5c s s, l n n \*..in -5.IP "\fI##Default#\fR"\(em Column descriptors missing from the endof a format line are assumed to be \fBL\fR.The longest line in the format section, however,defines the number of columnsin the table;extra columns in the data are ignored silently..QQ put in the diagnostics..RE.sp .5v.IP 3)D\s-2ATA\s0.The data for the table are typed after the format.Normally, each table line is typed as one line of data.Very long input lines can be broken: any line whose last character is\e is combined with the following line (and the \e vanishes).The data for different columns (the table entries) are separated by tabs,or by whatever character has been specified in the option.I tabsoption.There are a few special cases:.RS.IP "\fI##Troff commands within tables\fR#"\(em An input linebeginning with a `\*.' followed by anythingbut a number is assumed to be a command to.Itroff.Rand is passed through unchanged, retaining its position in the table.So, for example, space within a table may be produced by ``\*.sp''commandsin the data..IP "\fI##Full width horizontal lines\fR#"\(em An input.I linecontaining only the character $fat "\(ul" $ (underscore)or \fB=\fR (equal sign) is taken to be a single or doubleline, respectively, extending thefull widthof the.I table..IP "\fI##Single column horizontal lines\fR#"\(em An input table.I entrycontaining only the character $fat "\(ul" $ or \fB=\fRis taken to be a single or double line extendingthe full width of the.I column.Such lines are extended to meet horizontal or verticallines adjoining this column.To obtain these characters explicitly in a column, eitherprecede them by \e& orfollow them by a space before the usual tab or newline..IP "\fI##Short horizontal lines\fR#"\(em An input table.I entrycontaining only the string $fat "\e\(ul"$is taken to be a single line as wide as the contents ofthe column.  It is not extended to meetadjoining lines..IP "\fI##Repeated characters\fR#"\(em An input table

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -