mkbib.1

来自「HTML-XML-utils由一套小型C程序(过滤器)组成」· 1 代码 · 共 295 行

1
295
字号
.de d \" begin display.sp.in +4.nf...de e \" end display.in -4.fi.sp...TH man 1 "20 Mar 2000".SH NAMEmkbib \- create bibliography from a template.SH SYNOPSIS.B mkbib.RB "[\| " \-s.IR separator " \|]".RB "[\| " \-a.IR auxfile " \|]".IR bibfile " [\| " templatefile " \|]".SH DESCRIPTION.LPThe.B mkbibcommands reads a list of bibliographic keys (labels) from.IR auxfile ,finds the corresponding entries in.I bibfileand creates a bibliography, using.I templatefileas a model. The.I auxfilemay, e.g., have been created by.BR cite (1).It consists of labels, one per line. The.I bibfileis a.BR refer (1)style database..B mkbiblooks for entries with a.B %Lfield equal to a key in the.IR auxfile ..PPThe.I templatefileconsists of three parts:.TP 10.B preambleThe preamble is the part up to the first occurrence of.BR %{ .The preamble is copied to the output unchanged, except for occurrences of.BR % .To create a single % in the output, there must be two in the preamble(%%). All other occurrences of % followed by another letter are notcopied, but are collected into a string called the "sort order." anduse to sort the entries, as explained below..TP.B templateThe template starts with.B %{L:and ends with a matching.BR %} .The text in between is copied as often as there are bibliographicentries in.I bibfilethat correspond to keys in .IR auxfile .Variables in the template are replaced by the corresponding field inthe bibliographic entry: all occurrences of.BI % xwill be replaced by the field.BI % xof the entry. Parts of the text may be enclosed in.BI %{ x :and.BR %} .This means that the text in between should only be output if thecurrent entry has a field.IR x .Text that is enclosed in.BI %{! x :and.B %}will only be output if the entry does.B nothave a field.IR x .Both kinds of conditional sections may also be nested..TP.B postambleThe text after the.B %}is copied unchanged to the output, after all bibliographic entrieshave been processed..PPBy default bibliographic entries are copied to the output in the order of the keys in.IR auxfile ,except that keys that occur more than once are only used once. If thepreamble contains occurrences of.BI % x(where.I xis neither "%" nor "{") then these together determine the sort order.E.g., if the preamble contains %A%D then the entries will be sortedfirst on field A (author) and then on field D (date)..PPHere is an example of template file that creates a bibliography inHTML format:.d<html><title>Bibliography</title><!--%A%D sorted on author, then date --><dl>%{L:<dt id="%L">%{A:A%}%{!A:%{E:E%}%{!E:%{Q:Q%}%{!Q:-%}%}%}</dt><dd>%{B:"%T"  in: %{E:%E (eds)  %}<cite>%B.</cite>%{V: %V.%}  %}%{J:"%T"  in: %{E:%E (eds)  %}<cite>%J.</cite>%{V: %V.%}%{N: %N.%}%{P: pp. %P.%}  %}%{!B:%{!J:<cite>%T.</cite>  %}%}%{I:%I.  %}%{D:%D.  %}%{C:%C.  %}%{R:%R.  %}%{S:%S.  %}%{O:%O  %}%{U:<a href="%U">%U</a>  %}</dd>%}</dl></html>.eThis template starts with four lines of preample, including the sortstring %A%D on line 3. The sort string itself will not be output, butthe rest of the comment will..PPFrom the line.B %{L:to the line.B %}is the template. E.g., the line thatstarts with .B <dt id=...contains a complex conditional text that prints the authors (%A) ifthere are any, otherwise the editors (%E) if there are any, otherwisethe institution that is the author (%Q), if any, and a dash otherwise.Note how the parts are nested, Most of the text is inside.BR %{!A:...%} ,meaning that that part will only be effective if there is no authorfield (%A)..PPThe final two lines are the postamble and will simply be copiedunchanged..PPA bibliographic entry that looks like this in.IR bibfile :.d%L Java%A Gosling, James%A Joy, Bill%A Steele, Guy%T The Java language specification%D 1998%I Addison-Wesley%U http://java.sun.com/docs/books/jls/index.html.ewill be printed by the template above as:.d<dt id="Java">Gosling, James; Joy, Bill; Steele, Guy</dt><dd><cite>The Java language specification.</cite>  Addison-Wesley.  1998.  <a href="http://java.sun.com/docs/books/jls/index.html">http://java.sun.com/docs/books/jls/index.html</a>  </dd>.e.SH OPTIONSThe following options are supported:.TP 10.BI \-a " auxfile"The file that contains the list of keys (labels) for whichbibliogrphic entries should be printed. If the option is absent, thename of this file is formed from the.I templatefileargument by removing the last extension and adding.BR .aux .If no.I templatefileis given, the default.I auxfileis.BR aux.aux ..TP.BI \-s " separator"If there are multiple authors or editors in an entry, their names willbe listed with a separator in between. By default the separator is ";" (i.e., a semicolon and a space). With this option the separator canbe changed..SH OPERANDSThe following operands are supported:.TP 10.I bibfileThe name of a bibliographic database must be given. It must be a filein.BR refer (1)format and every entry must have at least a.B %Lfield, which is used as key. (Entries without such a field will beignored.).TP.I templatefileThe name of the input file is optional. If absent,.B mkbibwill read the template from stdin..SH "EXIT STATUS"The following exit values are returned:.TP 10.B 0Successful completion..TP.B > 0An error occurred. Usually this is because a file could not be openedor because the %{ and %} pairs are not properly nested.Very rarely it may also be an out of memory error. Some of thepossible error messages:.TP.I missing ':' in pattern.B mkbibfound a %{ but the second or third letter after it was not a colon..TP.I no '%{' in template fileThe template file is unusable, because it contains no template..TP.I unbalanced %{..%} in patternThere are more %{ than %}..SH "SEE ALSO".BR cite (1),.BR xml2asc (1),.BR UTF-8(RFC 2279),.BR normalize (1),.BR num (1),.BR toc (1),.BR htmlprune (1)..BR unent (1).BR asc2xml (1).SH BUGSSorting is primitive: the program doesn't parse dates or names andsimply sorts "Jan 2000" under the letter "J" and "Albert Camus" underthe lettr "A". For the moment the only work-around is to put names inthe.I bibfileas "Camus, Albert"..PPThe program simply lists all authors or editors. There is no way togenerate an "et. al." after the third one. The work-around is to putthe "et. al." in the.IR bibfile .Putting commas between the first authors and the word "and" before thefinal one is also not possible..PPThe program doesn't try to interpret names of authors or editors andthey cannot be reformatted. It is impossible to write a name that isspecified as "Sartre, Jean-Paul" in the.I bibfileas "J. Sartre" or as "Jean-Paul Sartre" in the output..PPThere is no way to suppress a period after a field if the fieldalready ends with a period. E.g., the template "%{A:A.%}" may generate"A. Person Jr.." if the author is "A. Person Jr." The only option isto either not put periods in the.IR bibfileor not put periods in the template..PPEntries in the.I bibfilecan only be used if they have a.B %L(label) field. The program cannot find entries by searching forkeywords, like.BR refer (1)..PP.B mkbibwill replace any ampersands (&) and less-than (<) and greater-than (>)signs that occur in the.I bibfileby their XML entities &amp; &lt; &gt; on the assumption that thetemplate is HTML/XML. This may not be appropriate for other formats.

⌨️ 快捷键说明

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