4.4. 引文(文献引用)#

按Sphinx的设计,其更适合编写技术文档。 但对于要求更加严格,或者说严肃的学术写作也提供了支持。 作为最终的格式 Sphinx 可能支持的不够好, 但是在撰写过程中可以充分利用其特点进行资料的管理也是一个很重要的特点。

论文参考文献是指在研究、撰写论文过程中, 作者在引用、借鉴、参考他人的研究成果、学术文献或相关资料时所列出的文献清单。 它包括了作者、出版年份、文章标题、期刊名称、卷数、期数、页码等信息, 以便读者可以查找到作者所使用的文献来源,核实信息的真实性和准确性, 并在需要时进一步了解相关内容。

论文参考文献的作用是为了显示个人学术诚信,尊重他人的研究贡献, 同时也方便读者深入研究和扩展相关领域的知识。 在撰写论文时,作者需要引用和参考先前已发布的文献中的思想观点、数据信息和资料等, 以支持和证明自己的论述。 这些被引用的文献在论文中被称为引证文献。

4.4.1. 使用Sphinx内置功能实现引文#

第一种使用 Sphinx 内置功能实现引文。 这种方式相对简单,但是对于引文要达到的目前完全能够支持。

这种方式与脚注的用法是一样的,只不过引文需要用文本作为标识而不能用数字。 注意文本中不能有空格,逗号, |

示例如下:

引用参考的内容通常放在页面结尾处,比如 [One]_,Two_

.. [One] 参考引用一
.. [Two] 参考引用二

效果如下:

引用参考的内容通常放在页面结尾处,比如 [One][Two]

[One]

参考引用一

[Two]

参考引用二

For the examples above, the alpha style citation would be: [BDB79] , [BB79a] and [BB79b] , respectively.

BiDB79

References

[BDB79]

Biskup, J.; Dayal, U.; Bernstein, P.A..: Synthesizing independent database schemas. In: ACM SIGMOD 1979 Int. Conf. On Management of Data Proceedings, S. 143-151.

[BB79a]

Beeri, C.; Bernstein, P.A.: Computational problems related to the design of normal relational schemas. ACM Trans. Database Syst., No. 1, 1979, S. 30-59.

[BB79b]

Beeri, C.; Bernstein, P.A.: Computers are stupid. ACM Trans. Database Syst., No. 4, 1979, S. 253-266.

玲珑骰子安红豆,入骨相思知不知。——温庭筠《南歌子词二首 / 新添声杨柳枝词》
云想衣裳花想容,春风拂槛露华浓。—— [李白-638] 《清平调·其一》
君埋泉下泥销骨,我寄人间雪满头。——白居易《梦微之》
[李白-638]

李白(701年-762年) ,字太白,号青莲居士,又号“谪仙人”,祖籍陇西成纪(今甘肃省秦安县),出生于蜀郡绵州昌隆县(一说出生于西域碎叶)。唐代伟大的浪漫主义诗人,被后人誉为“诗仙”,与杜甫并称为“李杜”,为了与另两位诗人李商隐与杜牧即“小李杜”区别,杜甫与李白又合称“大李杜”。

4.4.2. 使用BibTeX扩展实现文献引用#

可以使用 sphinxcontrib-bibtex 扩展在Sphinx中生成括号引用。 sphinxcontrib-bibtex 扩展允许将bibtex引用插入到Sphinx生成的文档中。 该扩展定义了一个新的参考书目指令和一个新的引用角色。 这些与LaTeX的 thebibliography 环境和 \cite 命令的工作方式类似。 引用存储在单独的纯文本BibTeX格式文件中。

这个扩展通过以下命令安装:

pip install sphinxcontrib-bibtex

For Windows users. To facilitate the installation of 3rd party Python packages, follow the instructions on how to add Distribute and Pip to the Python installation .

Including the extension in the project configuration file The Sphinx project conf.py file must be altered to include:

extensions = ['sphinxcontrib.bibtex']

Example In the document, use the following syntax:

See :cite: Strunk1979 for an introduction to stylish blah, blah... And place the directive at the end of the document:

.. bibliography:: references.bib

The references.bib file should contain a BibTex bibliography, including an entry for:

@BOOK{Strunk1979,
title = {The Elements of Style},
publisher = {Macmillan},
year = {1979},
author = {Strunk, Jr., William and E. B. White},
edition = {Third}
}

This documentation can be completed iff required in this specific project.

Using the Sphinx Thesis Resource

See also http://jterrace.github.io/sphinxtr/html/ch-intro/index.html for various useful adaptations/extensions of Sphinx.

示例:#

For the examples above [1] , the alpha style citation would be: [BDB79], [BB79a] and [BB79b], respectively.

.. bibliography:: ./refs.bib
   :style: unsrt
   :all:
曾经沧海难为水,除却巫山不是云。—— [2] 《离思五首·其四》
入我相思门,知我相思苦。—— [3] 《三五七言 / 秋风词》
玲珑骰子安红豆,入骨相思知不知。——温庭筠《南歌子词二首 / 新添声杨柳枝词》
云想衣裳花想容,春风拂槛露华浓。——李白《清平调·其一》
君埋泉下泥销骨,我寄人间雪满头。——白居易《梦微之》
春风得意马蹄疾,一日看尽长安花。——孟郊《登科后》

参考文献

[1]

Orthogonal matching pursuit: recursive function approximation with applications to wavelet decomposition, volume 1, Nov 1993.

[2]

元稹. 将进酒. \jcp , 118:6720–6724, Apr 2003.

[3]

李白. 将进酒. \jcp , 118:6720–6724, Apr 2003.

[4]

Y. Wu and V. S. Batista. Matching-pursuit for simulations of quantum processes. \jcp , 118:6720–6724, Apr 2003.