赞
踩
虽然Latex有很多不同的Bibtex Style,有些情况下仍然需要自己制作满足某种规范的bst文件。而一般生成自己的bst文件有两种方法。一种是修改别人的bst文件,这种方法修改起来方便,容易控制,缺点是对bst文件的底层格式清楚,关于该方法的入门介绍请参看这里。另外一种方法就是通过Latex提供的命令行工具来定制自己的bst文件。本文主要介绍第二种方法。
使用makebst工具生成bst文件
假如使用的是Miktex,则在命令行中输入:
$ latex makebst
如果之前没有使用过makebst工具,则会出现安装包的提示,选择安装,则出现以下的代码提示:
======================================================================
starting package maintenance...
installation directory: "E:\Program Files\MiKTeX 2.9"
package repository: http://ftp.ctex.org/mirrors/CTAN/systems/win32/miktex/tm/pac
kages/
lightweight database digest: 85119b7e66bb98cee919f70ffee43dfd
going to download 806464 bytes
going to install 31 file(s) (1 package(s))
downloading http://ftp.ctex.org/mirrors/CTAN/systems/win32/miktex/tm/packages/cu
stom-bib.tar.lzma...
806464 bytes, 384.36 KB/Sec
extracting files from custom-bib.tar.lzma...
======================================================================
.......
如果出现
***********************************
* This is Make Bibliography Style *
***********************************
It makes up a docstrip batch job to produce
a customized .bst file for running with BibTeX
Do you want a description of the usage? (NO)
\yn=
则表示安装成功。这时进入定制过程:键入“y”会显示帮助;键入“n”或直接回车会直接进入格式指定的过程。在此过程中,程序会提许多问题,包括引文如何编号
STYLE OF CITATIONS:
(*) Numerical as in standard LaTeX
(a) Author-year with some non-standard interface
(b) Alpha style, Jon90 or JWB90 for single or multiple authors
(o) Alpha style, Jon90 even for multiple authors
(f) Alpha style, Jones90 (full name of first author)
(c) Cite key (special for listing contents of bib file)
Select:
如何排序
ORDERING OF REFERENCES (if non-author/year and non-alph)
(*) Alphabetical by all authors
(c) Citation order (unsorted, like unsrt.bst)
(d) Year ordered and then by authors
(r) Reverse year ordered and then by authors
Select:
作者姓名如何显示
AUTHOR NAMES:
(*) Full, surname last (John Frederick Smith)
(f) Full, surname first (Smith, John Frederick)
(i) Initials + surname (J. F. Smith)
(r) Surname + initials (Smith, J. F.)
(s) Surname + dotless initials (Smith J F)
(w) Surname + comma + spaceless initials (Smith, J.F.)
(x) Surname + pure initials (Smith JF)
(y) Surname + comma + pure initials (Smith, JF)
(z) Surname + spaceless initials (Smith J.F.)
(a) Only first name reversed, initials (AGU style: Smith, J. F., H. K. Jones)
(b) First name reversed, with full names (Smith, John Fred, Harry Kab Jones)
Select:
日期格式
DATE FORMAT (if non author-year citations)
(*) Plain month and year without any brackets
(p) Date in parentheses as (May 1993)
(b) Date in brackets as [May 1993]
(c) Date preceded by colon as `: May 1993'
(d) Date preceded by period as `. May 1993'
(m) Date preceded by comma as `, May 1993'
(s) Date preceded by space only, as ` May 1993'
Select:
等等。这些选项,对于一般的自定制要求来说足够了。
在所有问题回答完毕之后,会出现如下提示:
Finished!!
Batch job written to file `tmp.dbj'
Shall I now run this batch job? (NO)
/yn=
这时选“y”程序便会处理方才的选择,生成两个文件,后缀分别是bst和dbj。这个bst文件已经可以使用。
dbj文件中记录了上面所有问题的选择,如果需要进行微小的改动,可以直接在这个文件中找到对应的部分,注释掉不需要的选项,将需要的选项解除注释,然后运行
latex xxx.dbj
便会生成一个新的以该文件底部指定的名称为名的bst文件。
可能希望让BibTex能够找到新的bst文件,这时,需要将其拷贝到MikTex的local目录中,比如(Win7)
c:/Users/(当前用户名)/AppData/Local/MiKTeX/2.9/bibtex/bst/
然后在命令行运行
texhash
即可。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。