📄 cite-mkbib.1
字号:
.de d \" begin display.sp.in +4.nf...de e \" end display.in -4.fi.sp...TH man 1 "20 Mar 2000".SH NAMEcite\-mkbib \- expand references and create bibliography.SH SYNOPSIS.B cite-mkbib.RB "[\| " \-b.IR base " \|]".RB "[\| " \-p.IR pattern " \|]".RB "[\| " \-s.IR separator " \|]".IR bibfile " [\| " file " \|]".SH DESCRIPTION.LPThe.B cite\-mkbibcommands copies.I fileto standard output, looking for strings of the form "[[\fIlabel\fP]]"and for a template for a bibliography. The label may not include whitespace and the double pair of square brackets must enclose the labelwithout any spaces in between. If.B cite\-mkbibfinds the label in the.IR bibfile ","the string is replaced by the.IR pattern "."The pattern can include certain variables. If the label is not foundin.IR bibfile ","it is left unchanged..PPThe default pattern replaces the string with a hyperlink, but if the.B \-poption is used, the replacement can be any pattern. The input doesn'teven have to be HTML..PPThe.I fileconsists 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 once (with bracketed labels("[[\fIlabel\fP]]") expanded). The character.B %is treated specially. To create a single % in the output, there mustbe two in the preamble (%%). All other occurrences of % followed byanother letter are not copied, but are collected into a string calledthe "sort order." and used 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 bracketed labels in .IR file .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 orderof the labels in.IR file ,except that labels that occur more than once are only used once. Ifthe preamble 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 a file that creates a bibliography in HTMLformat:.d<html><title>Bibliography</title> ... text with [[references]] here...<!--%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 \-p " pattern"Specifies the pattern by which the string [[\fIlabel\fP]] is replaced.The pattern may include the variables.B %b(which will be replaced by the value of the.B \-boption) and.B %L(which will be replaced by the.IR label ")."The default pattern is.d<a href="%b#%L" rel="biblioentry">[%L]</a>.e.TP.BI \-b " base"Sets the value for the.B %bvariable in the pattern. Typically this is set to a relative orabsolute URL. By default this value is an empty string..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 compared to the bracketed labels. (Entries withoutsuch a field will be ignored.).TP.I fileThe 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 mkbib (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 & < > on the assumption that thetemplate is HTML/XML. This may not be appropriate for other formats..PP.B cite\-mkbibis a (bash) shell script that calls.BR cite (1)and.BR mkbib (1),and is therefore not portable to all platforms.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -