rhl18.htm
来自「linux的初学电子书」· HTM 代码 · 共 1,395 行 · 第 1/3 页
HTM
1,395 行
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
delim (mn)
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Uses m and n as equation delimiters.</FONT>
</TABLE><P>When gtbl tries to lay out a table, it tries to keep the entire table on one page if possible, even if it has to eject the previous page only partially completed. This can sometimes cause problems because gtbl can make mistakes estimating the
size of the table prior to generating it, especially if there are embedded line commands that affect spacing or point size. To avoid this problem, some users surround the entire table with the display macros .DS (display start) and .DE (display end). You
can ignore this for most tables, unless you start embedding commands within the data.
<BR>
<BR>
<A NAME="E69E255"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Format</B></FONT></CENTER></H4>
<BR>
<P>The format section of the table structure indicates how the columns are to be laid out. Each line in the format section corresponds to one line of data in the finished table. If not enough format lines are specified to match all the lines of data, the
last format line specified is used for the remainder of the table. This lets you use a specific format for headers and a single format line for the rest of the table. The format section ends with a period.
<BR>
<P>Each line in the format section contains a keyletter for each column in the table. Keyletters should be separated by spaces or tabs for each column to enhance readability. Keyletters are case-independent (so you can use upper- or lowercase for the
keyletters, or a mixture of the two, without affecting the layout). Supported gtbl keyletters are as follows:
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
l
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Left-justified entry</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
r
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Right-justified entry</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
c
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Centered entry</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
[lb]
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Numeric entries lined up by units</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
a
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Aligned on left so that widest entry is centered</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
s
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Previous column format applies across rest of column</FONT>
</TABLE><P>A sample format section consists of a letter for each column, unless the entry is repeated across the page. A sample format section looks like this:
<BR>
<PRE>
<FONT COLOR="#000080">c s s
l n n .</FONT></PRE>
<P>In this sample, the first line of the table is formatted with the first, second, and third columns centered (the s repeats the previous entry). The second and subsequent lines have the first entry left-justified, and the next two lined up as numbers.
The period ends the format section. If you like, you can put all these format keyletters on a single line, using a comma to separate the lines:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">c s s, l n n .</FONT></PRE>
<P>A table formatted by this set of commands looks like this (with random numbers inserted to show the lineup):
<BR>
<PRE>
<FONT COLOR="#000080">Centered_Title
Entry1 12.23 231.23
Entry2 3.23 45.2
Entry3 45 123.2344
Entry4 3.2 2.3</FONT></PRE>
<P>Numeric data is usually aligned so that the decimal places are in a vertical column. However, sometimes you want to override this format by forcing a movement. The special character \& is used to move the decimal point. The special characters
disappear when the table is printed. To show the effect of this special character, the following sample shows normal formatting and entries with the special character embedded (the first column is the source input, and the second is the generated output):
<BR>
<PRE>
<FONT COLOR="#000080">14.5 14.5
13 13
1.253 1.253
3\&1.21 31.21
53.2 53.2
6\&2.23 62.23</FONT></PRE>
<P>You can see that the numbers usually line up with the decimal point in a vertical row, except where moved over by the \& characters. Even if a number has no decimal point specified (as in the second line of the example), it is lined up as though one
were present after the last digit.
<BR>
<P>The following are a few additional keyletters that can be used to create special formats and make the tables more attractive:
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
_
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Horizontal line in place of column entry.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
=
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Double horizontal line in place of column entry.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
|
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Between column entries, draws a vertical line between columns. Before the first keyletters, draws a line to the left of the table. After the last keyletters, draws a line to the right of the table.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
||
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Between column entries, draws a double vertical line.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
e/E
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Sets equal width columns. All columns that have a keyletter followed by e or E are set to the same width.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
f/F
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Followed by a font name or number, changes the entry to the font specified.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
N
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Any number following a keyletter. Indicates the amount of separation between columns.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
p/P
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Followed by a number, changes the point size of the entry to the specified number. Increments acceptable.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
t/T
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Vertically spanned items begin at the top line. Normally, vertically spanning items (more than one line in the table) are centered in the vertical range.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
v/V
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Followed by a number, gives vertical line spacing.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
w/W
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Followed by a number, sets the width.</FONT>
</TABLE><P>The order of these characters on the format line is not important, although the spacing between each format identifier must still be respected. Multiple letters can be used. The entry
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">np14w(2.5i)fi</FONT></PRE>
<P>sets the numeric entry (n) in italic (fi), with a point size of 14 (p14) and a minimum column width of 2.5 inches (w(2.5i)).
<BR>
<P>You may need to change the format of a table midway through—for example, to present summaries. If you must change the format, use the .T& (table continue) command.
<BR>
<BR>
<A NAME="E69E256"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Data</B></FONT></CENTER></H4>
<BR>
<P>Data for the table is entered after all the format specifications have been completed. Data for columns is separated by tabs or any other character indicated in the tabs option. Each line of data is one line of the table. Long lines of data can be
broken over several lines of source by using the backslash character as the last character in a line.
<BR>
<P>Any line starting with a period and followed by anything other than a number is assumed to be a groff command and is ignored by the preprocessor. If a single line of the data consists of only underscore or equal sign characters (single and double
lines), it is treated as extending the entire width of the table.
<BR>
<P>You can embed a block of text within a table by using the text commands of T{ (start of text) and }T (end of text). This lets you enter something that can't be easily entered as a string separated by tabs.
<BR>
<BR>
<A NAME="E69E257"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Examples</B></FONT></CENTER></H4>
<BR>
<P>The best way to understand how to use gtbl is to look at some simple examples. Here's a basic table command:
<BR>
<PRE>
<FONT COLOR="#000080">.TS
doublebox;
c c c, l l n.
Name Dept Phone
Joe 8A 7263
Mike 9F 2635
Peter 2R 2152
Yvonne 2B 2524
.TE</FONT></PRE>
<P>All of the entries in the data section are separated by tabs. This produces a table with three columns, the first line of which is centered text. The rest of the table has the first and second column left-justified, and the last column aligned by
decimal point (there are none in this case). The entire table is surrounded by two boxes.
<BR>
<P>A slightly more complex example uses a table title, followed by a row of column headings, and then the data. Separate each element in the table by a box in this case:
<BR>
<PRE>
<FONT COLOR="#000080">.TS
allbox;
c s s
c c c
n n n .
Division Results
East West North
15 12 14
12 12 18
36 15 24
.TE</FONT></PRE>
<P>Try typing in these examples, or create your own, to see what effect the different commands have. When you've started using gtbl, it isn't that difficult.
<BR>
<BR>
<A NAME="E68E126"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Summary</B></FONT></CENTER></H3>
<BR>
<P>Although word processors have made utilities such as geqn and gtbl less popular than they used to be, some diehard UNIX people still like to use them. There are times when you might not be able to produce an equation the way you want with your favorite
word processor, so you might have to return to the basics. Also, because word processors<A NAME="I2"></A> capable of fancy formulas tend to be expensive, utilities such as geqn and gtbl are ideal for the occasional user who doesn't want to spend a lot of
money on a seldom-used tool.
<P ALIGN=LEFT>
<A HREF="rhl17.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl17.htm" TARGET="_self"><IMG SRC="purprev.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>
<A HREF="#I0" TARGET="_self"><IMG SRC="purtop.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purtop.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Page Top"></A>
<A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm" TARGET="_self"><IMG SRC="purtoc.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>
<A HREF="rhl19.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl19.htm" TARGET="_self"><IMG SRC="purnext.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>
</BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?