将Zotero BibTex文件转换为LaTeX友好表示。

zotero-bibtize的Python项目详细描述


佐特罗比茨

将导出的Zotero BibTex书目重新整理成一个更为latex友好的表示形式。在

在当前状态下,将Zotero数据库的内容导出到Bibtex 格式大多数特殊字符被Zotero内部版本或 在写入输出文件之前进行了转义。这种行为是异常的 如果条目包含要由^{img1}处理的代码,则很烦人$ (即标题中的化学或数学表达式和公式等)。在

zotero-bibtize可用于后处理生成的Zotero输出文件 转义序列和删除序列是相同的 存储在Zotero接口中的原始条目内容)

使用

安装包之后,zotero-bibtize可以通过调用 zotero-bibtize命令行上的命令:

$ zotero-bibtize zotero_bibliography.bib bibtized_bibliography.bib

它将处理原始内容zotero_bibliography.bib并写入 新的bibtized_bibliography.bib文件的已处理内容。 请注意,指定目标文件是可选的,输入文件将是 如果省略则重写。在

示例

Zotero export生成的原始bibtex条目:

^{pr2}$

运行zotero-bibtize zotero_bibliography.bib后:

$ cat zotero_bibliography.bib
@article{LangCM2015,  title = {Lithium Ion Conduction in \ce{LiTi2(PO4)3} and Related Compounds Based on the NASICON Structure: A First-Principles Study},  volume = {27},  issn = {0897-4756, 1520-5002},  shorttitle = {Lithium Ion Conduction in \ce{LiTi2(PO4)3} and Related Compounds Based on the NASICON Structure},  url = {http://pubs.acs.org/doi/10.1021/acs.chemmater.5b01582},  doi = {10.1021/acs.chemmater.5b01582},  language = {en},  number = {14},  urldate = {2019-02-11},  journal = {Chem. Mater.},  author = {Lang, Britta and Ziebarth, Benedikt and Els\"{a}sser, Christian},  month = jul,  year = {2015},  pages = {5040--5048}}

定制BibTex键(非常实验性)

自定义BibTex键可以通过可选的--key-format选项定义 将写入书目文件而不是默认键 由佐特罗生成。密钥格式定义了如何组合和格式化 从BibTex输入字段获取的内容,以构建自定义密钥格式。在 格式键的格式为 [field1:option][field2:option]... 其中field定义了BibTex条目字段,从中获取内容 选项定义将应用于内容的不同格式选项。 目前实现了以下字段:

作者

将作者的姓氏添加到密钥项
通用格式:[author:num:options]

数字

定义用于密钥的最大作者名称数

选项

将应用于作者姓名的格式选项,即

  • 大写:名称大写
  • 大写:变换名称大写
  • lower:将名称转换为小写
  • 缩写:只有我们的第一个字母,而不是全名

标题

将标题字符串的内容添加到密钥项
通用格式:[title:num:options]

数字

定义标题中用于关键字的最大字数 (注意function keys 不考虑在内)

选项

将应用于标题内容的格式选项,即

  • 大写:名称大写
  • 大写:变换名称大写
  • lower:将名称转换为小写
  • 缩写:只有我们的第一个字母,而不是全名

日志

将日志名称的内容添加到密钥项
通用格式:[journal:options]

选项

将应用于日志名称的格式选项,即

  • 大写:名称大写
  • 大写:变换名称大写
  • lower:将名称转换为小写
  • 缩写:只有我们的第一个字母,而不是全名

将发布年份添加到关键条目
通用格式:[year:option]

选项

添加年份仅允许指定两种类型的选项:

  • 短:将年份作为2位数添加到密钥中
  • long:将整年相加(即4位数)

示例

在下面的示例中,我们创建一个包含第一个 作者姓名和出版物后面的缩写期刊名 年。定义该密钥的密钥格式如下: [author:1:capitalize][journal:capitalize:abbreviate][year] Zotero生成的原始条目如下所示:

$ cat zotero_bibliography.bib
@article{lang_lithium_ion_conduction_2015,  title = {Lithium {Ion} {Conduction} in {\textbackslash}ce\{{LiTi}2({PO}4)3\} and {Related} {Compounds} {Based} on the \{{NASICON}\} {Structure}: {A} {First}-{Principles} {Study}},  volume = {27},  issn = {0897-4756, 1520-5002},  shorttitle = {Lithium {Ion} {Conduction} in {\textbackslash}ce\{{LiTi}2({PO}4)3\} and {Related} {Compounds} {Based} on the {NASICON} {Structure}},  url = {http://pubs.acs.org/doi/10.1021/acs.chemmater.5b01582},  doi = {10.1021/acs.chemmater.5b01582},  language = {en},  number = {14},  urldate = {2019-02-11},  journal = {Chem. Mater.},  author = {Lang, Britta and Ziebarth, Benedikt and Els{\textbackslash}"\{a\}sser, Christian},  month = jul,  year = {2015},  pages = {5040--5048}}

运行zotero-bibtize zotero_bibliography.bib --key-format [author:1:capitalize][journal:capitalize:abbreviate][year]后 原始内容将由zotero-bibtize和原件 Zotero密钥将替换为修改后的版本:

$ cat zotero_bibliography.bib
@article{LangCM2015,  title = {Lithium Ion Conduction in \ce{LiTi2(PO4)3} and Related Compounds Based on the NASICON Structure: A First-Principles Study},  volume = {27},  issn = {0897-4756, 1520-5002},  shorttitle = {Lithium Ion Conduction in \ce{LiTi2(PO4)3} and Related Compounds Based on the NASICON Structure},  url = {http://pubs.acs.org/doi/10.1021/acs.chemmater.5b01582},  doi = {10.1021/acs.chemmater.5b01582},  language = {en},  number = {14},  urldate = {2019-02-11},  journal = {Chem. Mater.},  author = {Lang, Britta and Ziebarth, Benedikt and Els\"{a}sser, Christian},  month = jul,  year = {2015},  pages = {5040--5048}}

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java中的第10个解决方案   Java中泛型的super和extends组合   Java Android OpenGL ES 2.0片段着色器texture2D不工作   在JList elementJava上按下时打开弹出窗口   字典Java数据结构允许对象上的布尔标志和排序?   java我该如何停止为AWS关系数据库服务收费?   java如何检查Google定位准确度是否提高?   java使用Mockito将方法存根在与被测类相同的类中(CUT)   java IntelliJIdea disable inspection:参数的实际值始终为   java CXF+多态POST数据   java命名空间“ads”未绑定   Sun(1999)的“Java编程语言的代码约定”的编码风格过时了吗?   JAVA中的隐式接口、类转换   javafx如何配置Java登录应用程序代码   java如何在滚动窗格中设置选项卡以及如何显示选项卡标题   java中等式和条件运算符的优先级   java Spring WS无法返回JAXB响应   错误响应上的java jaxws处理程序行为   java Hibernate HQL映射查询