BibTeX 生成自定义的参考文献

在用 LaTeX 写作的过程中,少不了引用一些参考文献。这就涉及到 bibtex 制作、生成参考文献。参考文献的引用在网上有许多格式,很多是为一些文献管理软件定制好的 metadata,比如 EndNote、RefMan、RefWorks 、Mendeley、NoteExpress 等。而 latex 编译需要的是最原始的 bibtex 引用数据,比如

@article{bibkey, 
    author={A and B}, 
    journal={IEEE Transactions on Image Processing}, 
    title={Title .... }, 
    year={2017}, 
    volume={XXX}, 
    number={xx}, 
    pages={XXX--XXX}, 
    keywords={......}, 
    doi={xx.xxxx/xxxxxxxx}, 
    ISSN={XXXX--XXXX}, 
    month={Feb},
}

每一个数据段表示一个参考文献(期刊论文、会议论文、书籍、专利、学位论文等)。将这些数据段都放入一个扩展为 *.bib 的文件中,和 *.tex 文件放在同一目录下。

在 *.tex 文件中的最后加上如下语句

\balance    % 平衡最后一页的左右栏
\bibliographystyle{
   ieeetr} % 多种格式:plain, alpha, abbrv, acm, siam, apalike, etc.
\bibliography{
   bib文件名(无后缀)}

如果正文中需要引用某一篇参考文献,使用如下语句

\cite{
   bibkey}\citep{
   bibkey}  % 不用格式要求不一致

重点介绍:自定义参考文献生成模板 *.bst

假设你已经安装好了 CTeX 或 MikTeX,在电脑的任意文件夹中,打开命令行 cmd,输入以下语句

$ tex makebst  % makebst.tex 已经安装在系统目录中
This is TeX, Version 3.1415926 (MiKTeX 2.9)
(D:\CTEX\MiKTeX\tex\latex\custom-bib\makebst.tex
***********************************
* 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=yes
In the interactive dialogue that follows,
you will be presented with a series of menus.
In each case, one answer is the default, marked as (*),
and a mere carriage-return is sufficient to select it.
(If there is no * choice, then the default is the last choice.)
For the other choices, a letter is indicated
in brackets for selecting that option. If you select
a letter not in the list, default is taken.

默认的选项用 * 标记,如果没有 * 标记,那么默认选择最后一个选项。另外,选项用字母表示,置于 [ ] 中,如果选择未出现的字母,即认为是默认选项。

The final output is a file containing a batch job
which may be (La)TeXed to produce the desired BibTeX
bibliography style file. The batch job may be edited
to make minor changes, rather than running this program
once again.

Enter the name of the MASTER file (default=merlin.mbs)

\mfile=

直接默认,回车,

Name of the final OUTPUT .bst file? (default extension=bst)

\ofile=myRefStyle

自己取一个最终输出模板的文件名,

Give a comment line to include in the style file.
Something like for which journals it is applicable.

\ans=This is a bst file created by XXX for journal xxx on 10 July, 2017
Do you want verbose comments? (NO)

\yn=

可选输入一段描述,介绍这个模板文件的用途,作者等等信息,
不需要详细的描述,

EXTERNAL FILES:

Name of language definition file (default=merlin.mbs)

\cfile=

Name of language file: \cfile=.

Include file(s) for extra journal names? (NO)

\yn=

No included files.

默认不需要外部文件导入,

INTERNAL LANGUAGE SUPPORT (if no external language file)
(*) English words used explicitly
(b) Babel (words replaced by commands defined in babelbst.tex)
  Select:

\ans=
  You have selected: English

语言默认是英语为主,

STYLE OF CITATIONS:
(*) Numerical as in standard LaTeX  % 数字 [1], [2]
(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:

\ans=a
  You have selected: Author-year

选择正文中出现的引用的格式,选择 (a) 还需要详细设置,

AUTHOR--YEAR SUPPORT SYSTEM (if author-year citations)
(*) Natbib for use with natbib v5.3 or later
(o) Older Natbib without full authors citations
(l) Apalike for use with apalike.sty
(h) Harvard system with harvard.sty
(a) Astronomy system with astron.sty
(c) Chicago system with chicago.sty
(n) Named system with named.sty
(d) Author-date system with authordate1-4.sty
  Select:

\ans=
  You have selected: Natbib

这里使用现有的 natbib 包的格式,也可以选择其他类型,

LANGUAGE FIELD
(*) No language field
(l) Add language field to switch hyphenation patterns temporarily
  Select:

\ans=
  You have selected: No language field

这里默认,没完全明白这里的作用,

ANNOTATIONS:
(*) No annotations will be recognized
(a) Annotations in annote field or in .tex file of citekey name
  Select:

\ans=
  You have selected: No annotations

默认选择不需要注释,

PRESENTATIONS:
(*) Do not add presentation type for conference talks
(p) Add presentation, speaker not highlighted
(b) Presentation, speaker bold face
(i) Presentaion, speaker italic
(c) Presentaion, speaker in small caps
  Select:

\ans=
  You have selected: Do not add presentation type

Presentation 不当作参考文献的一种格式,

ORDERING OF REFERENCES (if author-year citations)
(*) Alphabetical by all authors % 按字母表排序
(l) By label (Jones before Jones and James before Jones et al) % 也按字母表排序,作者少的先排
(m) By label and cite order (like above but all Jones et al ordered as cited)
(k) By label and cite key instead of label and title, as above
(d) Year ordered and then by authors (for publication lists)    % 先按年份,再按作者顺序
(r) Reverse year ordered and then by authors (most recent first)
(c) Citation order (unsorted, only meaningful for numericals) % 按正文引用出现顺序排列
  Select:

\ans=l
  You have selected: By label

参考文献排序有多种格式,<

  • 5
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
LaTeX 中引用参考文献通常使用 BibTeXBibLaTeX 系统。这是一种标准的方法,使得作者能够轻松管理并格式化他们的参考文献列表。以下是基本步骤: 1. **设置参考文献样式**: 首先,你需要选择一个参考文献样式,比如 `plain`, `alpha`, `numeric` 或者自定义样式。这通常通过修改 LaTeX 类文档的 `.cls` 或者 `.bst` 文件完成。 2. **创建.bib文件**: 创建一个名为 `yourreferences.bib`(可以自定义名称)的文本文件,用于存放你的参考文献条目。每个条目都遵循 BibTeX 的特定格式,例如: ```latex @article{key, author = {Author Name}, title = {Article Title}, journal = {Journal Name}, year = {Publication Year}, volume = {Volume Number}, number = {Issue Number}, pages = {Start-End Pages}, doi = {Digital Object Identifier}, } ``` 3. **引用文献**: 在 LaTeX 文档中,用 `\cite{key}` 标注你想引用的文献,这里的 `key` 是你在.bib文件中对应条目的键名。 4. **调用BibTeXBibLaTeX**: 在文档的末尾添加适当的命令来处理参考文献,如果是 BibTeX,使用: ```latex \bibliographystyle{style_name} \bibliography{yourreferences} ``` 如果使用 BibLaTeX,会有所不同,但通常也需要加载 `biblatex` 包,然后用 `\printbibliography` 输出参考文献。 5. **编译**: 先用 LaTeX 编译生成一个 `.aux` 文件,然后运行 BibTeXBibLaTeX 进行参考文献的处理,接着再次运行 LaTeX 使引用变为实际链接,最后可能还需要再运行一次 BibTeXBibLaTeX 以确保链接正确。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值