自动检索bibtex条目的工具
caleb的Python项目详细描述
caleb
概述
caleb
是自动填写乳胶引用的工具。它假设
你的tex文件中的引文格式是\cite{author:title:year}
或者\cite{author:title}
。caleb
然后从aux中提取引文键
并将从
https://www.crossref.org/(默认)或https://mathscinet.ams.org/mrlookup。
默认情况下,这些条目会附加到bib文件中。如果
--dry-run
选项被传递,然后打印条目。
用法示例
查看caleb
正在做什么的最快方法是使用--get-this-key
旗帜。
$ caleb --get-this-key 'mazur:eisenstein' --method 'ams'
@article {mazur:eisenstein,
AUTHOR = {Mazur, B.},
TITLE = {Modular curves and the {E}isenstein ideal},
NOTE = {With an appendix by Mazur and M. Rapoport},
JOURNAL = {Inst. Hautes \'{E}tudes Sci. Publ. Math.},
FJOURNAL = {Institut des Hautes \'{E}tudes Scientifiques. Publications
Math\'{e}matiques},
NUMBER = {47},
YEAR = {1977},
PAGES = {33--186 (1978)},
ISSN = {0073-8301},
MRCLASS = {14G25 (10D05)},
MRNUMBER = {488287},
MRREVIEWER = {M. Ohta},
URL = {http://www.numdam.org/item?id=PMIHES_1977__47__33_0},
}
以下示例出现在examples
目录中。
- 首先运行
pdflatex an_example.tex
生成an_example.aux
。caleb
现在将解析an_example.aux
以生成适当的书目 文件。
$ caleb an_example
- 第一个重要的命令行选项是
--take-first
。当做一个 查询时,可能有多个结果。默认情况下,caleb
不会采取任何行动。但是,如果传递了--take-first
标志,caleb
将获取第一个条目。
$ caleb --take-first an_example
- 下一个重要的命令行选项是
--method
。默认情况下,caleb
使用crossref.org
。但是,我们也可以告诉caleb
使用 https://mathscinet.ams.org/mrlookup。
$ caleb --method ams an_example
工作流集成
晚些时候
- 最好的方法可能是集成到
latexmk
。-pdflatex
标志 允许我们在每次调用后运行caleb
。
latexmk -pdf -pdflatex='pdflatex %O %S; caleb -t -m ams %B' an_example
- 我们可以在
.latexmkrc
文件中设置-pdflatex
标志。这个可以进去 您的tex项目文件夹或在主目录中。所以在.latexmkrc
文件,包括以下行(参见示例目录中的示例):
$pdflatex='pdflatex %O %S; caleb %B'
赤骨
- 赤裸裸的方法是在运行bibtex之前运行
caleb
。
pdflatex an_example
caleb an_example
bibtex an_example
pdflatex an_example
pdflatex an_example
cocalc
http://cocalc.com包含一个协作乳胶编辑器,允许您使用
自定义生成命令。我们可以将caleb
更改为
latexmk -pdf -pdflatex='pdflatex %O %S; caleb -t -m ams %B' -f -g -bibtex -synctex=1 -interaction=nonstopmode an_example.tex
帮助
caleb
带有一些命令行参数。
$ caleb --help
usage: caleb [-h] [-t] [-v] [--version] [-m {crossref,ams}] [-g GET_THIS_KEY]
[-dr]
[input_name]
positional arguments:
input_name
optional arguments:
-h, --help show this help message and exit
-t, --take-first Take first result if multiple results
-v, --verbose Increase verbosity of output
--version Outputs the version
-m {crossref,ams}, --method {crossref,ams}
Specify a method for retrieving citations
-g GET_THIS_KEY, --get-this-key GET_THIS_KEY
Print the first entry with this key
-dr, --dry-run Write the changes to stdout instead of the bibtex
安装
依赖性
- crossref_commons_py
- requests
python3
(用>;=3.6测试)
测试和开发依赖性
pip
建议的方法是从其PyPI
repository中获取caleb
。
pip3 install caleb --user
setup.py
或者,使用以下命令自动生成setup.py
文件
dephell。如果出了什么事就告诉我
错了!
python setup.py install --user
项目目标
- []实现与IRL的功能对等 Caleb按版本2.13.1995。