ch17_04.htm

来自「unix基础教程」· HTM 代码 · 共 321 行 · 第 1/2 页

HTM
321
字号
<tr><td valign="top"><a name="refer">refer</a></td><td><p><tt class="literal">refer</tt> [<em class="replaceable"><tt>options</em>] <em class="replaceable">files</tt></em></p><p><a name="IXT-17-123474" />Process files for bibliographic references.Input is passed through to the output unchanged,except for lines bracketed by <tt class="literal">.[</tt> and <tt class="literal">.]</tt>.Such lines are taken to be references to citations kept in a separatedatabase.Based on the keywords provided between the brackets,<tt class="literal">refer</tt>generates <tt class="literal">troff</tt> <tt class="literal">.ds</tt> commandsthat define strings containing the relevant pieces of information.It then generates calls to macros that can formatthe references appropriately.The <em class="emphasis">ms</em> and <em class="emphasis">me</em> macropackages contain macro definitions for use with <tt class="literal">refer</tt>.The line right before the call to <tt class="literal">.[</tt>will have a suitable string appended to its end to indicate the useof a reference.Using the <tt class="literal">-e</tt> option, references can be gatheredfor placement at the end as a group.</p><h4 class="refsect2">Options</h4><dl><dt><tt class="literal">-a</tt>[<tt><em class="replaceable">n</em></tt>]</dt><dd>Reverse the first <em class="emphasis">n</em></tt> author names(i.e., last name first).With no <em class="emphasis">n</em></tt>, all names are reversed.</p></dd><dt><tt class="literal">-b</tt></dt><dd>Bare mode.Do not add inline references to the text.</p></dd><dt><tt class="literal">-c</tt><tt><em class="replaceable">list</em></tt></dt><dd>Capitalize, with <em class="emphasis">SMALL CAPS</em></tt>,those fields whose letters are given in <em class="emphasis">list</em></tt>.</p></dd><dt><tt class="literal">-e</tt></dt><dd>Collect references for output at the end.References to the same source are only printed once.The references are printed when these lines are encountered:</p><blockquote><pre class="code">.[$LIST$.]</pre></blockquote></dd><dt><tt class="literal">-k</tt><tt><em class="replaceable">c</em></tt></dt><dd>Instead of numbered references, use labeled references,where the data supplied is from field <tt class="literal">%</tt><em class="emphasis">c</em></tt>in the database.The default is <tt class="literal">%L</tt>.</p></dd><dt><tt class="literal">-l</tt>[<tt><em class="replaceable">m</em></tt>[<tt class="literal">,</tt><tt><em class="replaceable">n</em></tt>]]</dt><dd>Instead of numbered references, use labeled references,where the label is generated based on the senior (first) author'slast name, and the year of publication.If supplied, <em class="emphasis">m</em> and <em class="emphasis">n</em> indicatehow many letters from the author's last name and the last <em class="emphasis">n</em>digits of the year.Otherwise, the full name and year are used.</p></dd><dt><tt class="literal">-n</tt></dt><dd>Do not search the default file(found in <tt class="literal">/usr/lib/refer/papers</tt>).</p></dd><dt><tt class="literal">-p</tt> <tt><em class="replaceable">refsfile</em></tt></dt><dd>Use <em class="emphasis">refsfile</em></tt> as a list of references.</p></dd><dt><tt class="literal">-s</tt><tt><em class="replaceable">keylist</em></tt></dt><dd>Sort references based on the fields listed in <em class="emphasis">keylist</em></tt>.This implies <tt class="literal">-e</tt>.Each letter may be followed by a number, indicating how many of thatfield is to be used.A <tt class="literal">+</tt> is equivalent to infinity.The default is <tt class="literal">-sAD</tt>, which sorts on thesenior author and date.</p></dd></dl><h4 class="refsect2">Example</h4><p>Sort on all authors, and then the date;use <tt class="literal">mybib</tt> for references.</p><blockquote><pre class="code"><tt class="userinput"><b>refer -sA+D -p mybib thesis.ms | tbl | eqn | troff -ms - | lp</b></tt></pre></blockquote></td></tr><tr><td valign="top"><a name="roffbib">roffbib</a></td><td><p><tt class="literal">roffbib</tt> [<tt><em class="replaceable"><tt>options</em></tt>] [<tt><em class="replaceable">files</tt></em></tt>]</p><p><a name="IXT-17-123475" />Print a bibliographic database.<tt class="literal">roffbib</tt> is a shell script that processes the named <em class="emphasis">files</em></tt>(or standard input if no <em class="emphasis">files</em></tt>) through <tt class="literal">refer</tt>and prints the results as a bibliography.By default, the bibliography is formatted using <tt class="literal">nroff</tt>,use the <tt class="literal">-Q</tt> option to use <tt class="literal">troff</tt> instead.</p><p><tt class="literal">roffbib</tt> accepts the following<tt class="literal">nroff</tt>/<tt class="literal">troff</tt> options and simplypasses them to the formatter:<tt class="literal">-e</tt>,<tt class="literal">-h</tt>,<tt class="literal">-m</tt>,<tt class="literal">-n</tt>,<tt class="literal">-o</tt>,<tt class="literal">-q</tt>,<tt class="literal">-r</tt>,<tt class="literal">-s</tt>,and<tt class="literal">-T</tt>.See <a href="ch12_01.htm">Chapter 12</a>, for more details.</p><h4 class="refsect2">Options</h4><dl><dt><tt class="literal">-H</tt> <tt><em class="replaceable">header</em></tt></dt><dd>Set the &#8220;header&#8221; (title) to <em class="emphasis">header</em></tt>.The default is <tt class="literal">BIBLIOGRAPHY</tt>.(This option is in the script, but is not documented.)</p></dd><dt><tt class="literal">-Q</tt></dt><dd>Use <tt class="literal">troff</tt> instead of <tt class="literal">nroff</tt>.The page offset is set to one inch.</p></dd><dt><tt class="literal">-V</tt></dt><dd>Typeset for Versatec printer/plotter.While documented in the manpage, this option is not in the script.</p></dd><dt><tt class="literal">-x</tt></dt><dd>Format abstracts or comments in the <tt class="literal">%X</tt> field ofa bibliographic reference.Useful for annotated bibliographies.<tt class="literal">refer</tt> does not use the <tt class="literal">%X</tt> field.</p></dd></dl><h4 class="refsect2">Example</h4><p>Sort a database and print it to a PostScript printer:</p><blockquote><pre class="code"><tt class="userinput"><b>sortbib refs | roffbib -Q -x | /usr/lib/lp/postscript/dpost | lp</b></tt></pre></blockquote></td></tr><tr><td valign="top"><a name="sortbib">sortbib</a></td><td><p><tt class="literal">sortbib</tt> [<tt><em class="replaceable"><tt>option</em></tt>] <tt><em class="replaceable">files</tt></em></tt></p><p><a name="IXT-17-123476" />Sort one or more bibliographic databases.Typically used for printing with <tt class="literal">roffbib</tt>.Up to 16 databases may be sorted.Records may not exceed 4096 bytes in length.</p><h4 class="refsect2">Option</h4><dl><dt><tt class="literal">-s</tt> <tt><em class="replaceable">keys</em></tt></dt><dd>Sort on the given <em class="emphasis">keys</em></tt>.The first four keys influence the sort; the rest are ignored.Letters in <em class="emphasis">keys</em> correspond to the key lettersin bibliography entries.Append a <tt class="literal">+</tt> to a letter to sort completely by that keybefore moving to the next.</p></dd></dl><h4 class="refsect2">Examples</h4><p>Sort by authors first, then by date:</p><blockquote><pre class="code"><tt class="userinput"><b>sortbib -sA+D myrefs |</b></tt> ...</pre></blockquote><p>Sort by author, title, and date:</p><blockquote><pre class="code"><tt class="userinput"><b>sortbib -sATD myrefs |</b></tt> ...</pre></blockquote></td></tr></table><p><a name="IXT-17-123477" /><a name="IXT-17-123478" /><a name="IXT-17-123479" /><a name="IXT-17-123480" /><a name="IXT-17-123481" /><a name="IXT-17-123482" /><a name="IXT-17-123483" /><a name="IXT-17-123484" /><a name="IXT-17-123485" /></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch17_03.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td align="right" valign="top" width="228"><a href="part4.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">17.3. pic</td><td align="center" valign="top" width="228"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td align="right" valign="top" width="228">IV. Software Development</td></tr></table></div><hr width="684" align="left" /><img src="../gifs/navbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links" /><p><p><font size="-1"><a href="copyrght.htm">Copyright &copy; 2003</a> O'Reilly &amp; Associates. All rights reserved.</font></p><map name="library-map"><area shape="rect" coords="1,0,88,96" href="../index.htm"><area shape="rect" coords="90,0,165,96" href="../upt/index.htm"><area shape="rect" coords="168,1,253,107" href="../mac/index.htm"><area shape="rect" coords="255,0,335,97" href="../korn/index.htm"><area shape="rect" coords="337,0,415,109" href="../unixnut/index.htm"><area shape="rect" coords="417,0,512,122" href="../sedawk/index.htm"><area shape="rect" coords="514,0,605,105" href="../lunix/index.htm"><area shape="rect" coords="611,2,694,121" href="../vi/index.htm"></map></body></html>

⌨️ 快捷键说明

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