Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q24 如何插入参考文献 #31

Open
Lihua1990 opened this issue Jan 3, 2020 · 11 comments
Open

Q24 如何插入参考文献 #31

Lihua1990 opened this issue Jan 3, 2020 · 11 comments

Comments

@Lihua1990
Copy link
Collaborator

No description provided.

@Lihua1990
Copy link
Collaborator Author

@EthanDeng
Copy link
Owner

你给的网址的内容很不错。简要说下 LaTeX 里面的参考文献,大致分为 3 类:

  1. thebibliography 环境
  2. BibTeX 方式
  3. biber 方式

其中 thebibliography 环境由于每次需要手动调整内容,极为不方便,所以不介绍。BibTeX 是目前最流行的文献支持方式,也是我个人用的。biber 后端 + biblatex 宏包是现在越来越时新的方式,可以自行了解,这里核心介绍 BibTeX。

@EthanDeng
Copy link
Owner

EthanDeng commented Jan 6, 2020

BibTeX 的文献分为两部分组成,bib 文件 和 bib 样式,它将内容和格式分开了,其中 bib 文件就是文献本身的内容(多篇文献放于一个 bib 文件中),而 bib style (文献样式)用来设置文献在文档中的显示格式。

不管是 Endnote 或者 Mendeley 或者其他文献管理工具都能方便将文献库导出 bib 文件,bib 文件是文本文件,接近于 json 或者 Python 里面的字典。下面是你提供的网址中的一篇文献。

@article{Weir04,
Author = {Weir, B. S. and Turner, S. J. and Silvester, W. B. and Park, D.-C. and Young, J. M.},
Title = {Unexpectedly diverse \emph{Mesorhizobium} strains and \emph{Rhizobium leguminosarum} nodulate native legume genera of New Zealand, while introduced legume weeds are nodulated by \emph{Bradyrhizobium} species},
Journal = {Applied and Environmental Microbiology},
Volume = {70},
Number = {10},
Pages = {5980-5987},
Year = {2004} }

上述内容我们称为一条记录,或者一篇文献(我们将这个内容存为 ref.bib)。其中 article 代表的是这个文献类型为期刊文章,如果是书籍,则为 book。需要注意的是第一行的 Weir04,这个是 bibkey(文献键值),也是我们引用文献时用到的标签。而其他的条目我们称为 field,也就是字段。在使用最基本的样式(plain)的情况下,我们通过 \cite 命令进行引用,参考示例:

\documentclass{article}

\begin{document}

Blablabla said Nobody ~\cite{Weir04}.

\bibliography{ref}
\bibliographystyle{plain}

\end{document}

在通过 pdflatex -> bibtex -> pdflatex -> pdflatex 编译(texstudio 的编译按钮为完整编译,只需要一次)之后,效果如下:

QQ截图20200106132204

test_bib.zip

@EthanDeng
Copy link
Owner

如果有多篇文献,只需要将其放在 ref.bib 文件内,然后在引用的时候引用他们的 bibkey 就行了。我自己的一个 bib 文件你可以看下:Risk Awareness Bib。如果遇到特殊字符,可以参考 Special Symbols 修改 bib 文件就行了。

bib 文件可以从很多来源获取,比如 Google Scholar,百度学术以及参考文献管理工具:Endnote、Mendeley 等等。这里列出 Google Scholar 如何获得 bib 文件:

  1. 搜索文献内容,然后点击下方 引号:

QQ截图20200106133046

  1. 在弹出的窗口下拉,点击 BibTeX,将其复制到自己文献文件 ref.bib 里即可。

QQ截图20200106133108

如果文献管理工具比如 Endnote 已有文献条目,只需要借助导出功能即可,参考 Endnote Convert

@EthanDeng
Copy link
Owner

上述内容是如何使用 bib 文件和 BibTeX,但是对于不同的杂志,不同要求,文献的格式不太一样,可以修改 \bibliographystyle 将其设置为满足要求的格式,对于比较好的期刊(外文),文献格式一般都会在投稿模板那里给出(附带样式文件 bst),只需要改为期刊要求的样式即可。

Overleaf 上有 LaTeX 自带的一些 style 的效果,参考:BibTeX Styles

@EthanDeng
Copy link
Owner

最后评论下 BibTeX 对于参考文献的支持方式,我觉得是一劳永逸将文献库与格式分离。不管是 Endnote 或 Google Scholar 上 bib 文件,可能都不是非常准确,但是只要校对过一遍之后,这篇文献就是对的,后续不用再管,而文献格式交由文献样式 bib style 决定,大部分需要自定义文献输出格式的杂志也都会提供文献样式。

另外,如果想要使用专门的 bib 文件管理工具,则推荐 Jabref。

@Lihua1990
Copy link
Collaborator Author

Lihua1990 commented Jan 15, 2020

do we need \usepackage{cite} in the preamble?

@Lihua1990
Copy link
Collaborator Author

What is the difference between bibtex and biblatex?
https://tex.stackexchange.com/questions/8411/what-is-the-difference-between-bibtex-and-biblatex

@EthanDeng
Copy link
Owner

do we need \usepackage{cite} in the preamble?

不需要。

@EthanDeng
Copy link
Owner

What is the difference between bibtex and biblatex?
https://tex.stackexchange.com/questions/8411/what-is-the-difference-between-bibtex-and-biblatex

简单说,两者是完全不同的东西,准确来说,应该是 bibtex 对应的应该是 biber,而 biblatex 是使用 biber 的一个宏包,就像 natbib 是 bibtex 的一个宏包一样。那么 bibtex 和 biber 有什么区别呢?biber 能更加好处理一些特殊字符,利用 biblatex 能更加方便定制样式,比如国内的国标使用 biber,用的宏包是 gbt7714,是 biblatex 的衍生宏包。

@EthanDeng
Copy link
Owner

bibtex vs. biber

Many of the disadvantages of natbib are a consequence of its reliance on bibtex for formatting. This is the main (huge) distinction between the natbib and biblatex, as the latter, even when it uses bibtex as the backend, doesn't use it for formatting, only for sorting. However, biblatex is also designed to use biber, a new backend that adds further functionality to biblatex.

bibtex

Advantages

  • very stable and widely used

Disadvantages

  • very hard to modify bibliography styles without learning a different language (if using natbib; not an issue if using biblatex)
  • very poor cross-language support and non-European script support. Non-ASCII characters are best avoided. See How to write "ä" and other umlauts and accented letters in bibliography for guidance on how to write characters with accents and diacritics.

biber

Advantages

  • able to deal with many more entry and field types in the .bib file.
  • able to deal with UTF-8 encoded .bib files.
  • better sorting control.

Disadvantages

  • Only works with biblatex, not with natbib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants