简介

Zotero是一个开源的文献管理软件,可以跨平台同步文献库,这里记录一下个人的配置。

安装

本体

Windows上安装Zotero直接去官网下载安装就行了,Linux下则要下载后自行解压到想放的文件夹里,并自己生成桌面图标。参考官方说明
需要注意的是,Windows的Zotero可以自动更新,但Ubuntu的可能有bug,自动更新从没成功过,需要自己重新下载解压覆盖,并再生成一次桌面图标。

插件

很有用的两个插件是ZotFileBetter BibTex,从各自的官网下载xpi文件,然后Zotero选择Tools -> Add-ons,点右上角的齿轮,选择Install Add-on From File,选择刚下载的文件即可安装。

设置

作为一个开源软件,想用得舒服就得自己去折腾配置。以下为个人的工作流:用Zotero官方帐号同步文献库的条目,但免费版的只有300M的存储空间,所以不同步PDF文档。用OneDrive等网盘来同步PDF,利用ZotFile来管理附件,把所有文档集中放在OneDrive的一个文件夹里。引用时用Better BibTex来导出各个条目的BibTex,最后在Latex里微调。

基础设置

基础设置在上面的Edit -> Preferences里:

General -> Open PDF using选择System Default,自带的不好用。
Sync -> Settings,登录注册的Zotero帐号,勾选Sync automaticallySync full-text content,下面的File Syncing都不勾选。
Search不变。
ExportItem Format选择Better BibTex
Cite不变。
Advanced -> Files and Folders -> Base directory选择OneDrive里要放PDF的文件夹,下面的Data Directory Location可以按需修改。

ZotFile设置

2025更新: ZotFile和最新版的Zotero 7不兼容,作者似乎也没有计划更新,因此以下的设置已不适用于最新版的Zotero。可以使用ZotMoov作为替代,但还是有一定的区别,需要适应一下。

ZotFile的设置在Tools -> ZotFile Preferences里:

General Settings -> Location of FilesCustom Location选择跟基础设置里一样的OneDrive文件夹。勾选Use subfolder definded by,填入%c,指按文章类别(collection)分文件夹。
Tablet Settings不用管。
Renaming Rules是对导入的PDF文档的命名规则,个人是设置为“年份_标题_作者 (备注).pdf”,论文本体备注一般留空,supplementary material会在备注里填supp。具体设置如下:Format for all Item Types except Patents以及Format for Patents都填{%y_}{%t_}{%a},下面Additional Settings里,Delimiter between multiple authors设为下划线_,勾选Add user input to filename.Default is留空,勾选Maximum length of title80Maximum number of authors2Numbers of authors to display when authors are omitted1,最后Add suffix when authors are omittedet al。其他的没提到选项都不勾选。
Advanced Settings里应该不用改。

Better BibTex设置

Better BibTex的设置在Tools -> Better BibTex Preferences

Citation keysCitation key formula设为extra('field').clean.len + ":" + shorttitle(3,3) + year | shorttitle(3,3) + year ,这样设置可以在Zotero的extra栏里填入“field: xxx”,导出时生成的bibtex key会变成“xxx:”加上文章标题的前三个词加上发表年份,例如"Attention is All You Need"的key是"nlp:AttentionAllYou2017"。下面的Force citation key to plain text不勾选,Enable citation key search可以选。
Export选项卡里,BibTex勾选Export unicode as plain-text latex commandsAdd URLs to BibTex export选择in the 'url' fieldpostscript里加入一段把ArXiv文章从journal改为misc的代码:

if (Translator.BetterBibTeX) { 
  tex.remove("file"); 
  tex.remove("abstract"); 
  tex.remove("annotation"); 
  if (tex.entrytype === "article" && zotero.arXiv) { 
    if (tex.has.journal && zotero.arXiv.source === "publicationTitle") { 
      tex.add({name: "howpublished", value: zotero.publicationTitle}); 
      tex.remove("journal"); 
    } 
    if (!tex.has.journal) tex.entrytype = "misc"; 
  } 
}

Export -> Miscellaneous取消勾选Apply title-casing to titles,同时也不勾选Apply case-protection to capitalized words by enclosing them in bracesImport选项卡里选择no (import titles as-is),导入条目的时候一般标题里该大写的都会自动大写,不用这软件教我怎么设置大小写,更不能信任这些自动大小写转换,最终还是得在bib里一个一个改。

Last modification:February 5, 2025
点赞喵,点个赞谢谢喵