obsidian zotero 联动方案 配置记录

前言

Obsidian 和 zotero 都是非常好用的开源软件,两个软件能做到无缝联动也是很多人的想法,文献笔记可以丝滑的放进 obsidian 中,那多好,网上有很多教程,但能够一步到位讲清楚的很少。我也踩了很多坑才完成部署,希望本文能帮你少走弯路。
搭建 zotero 与 Obsidian 联动部署的目的是让我们更加专注做笔记,从来回折腾笔记中抽离出来,让我们更加沉浸的阅读和总结。

操作步骤

下载插件

Obsidian 插件(插件市场搜索下载)

  • Zotlit
    Zotero 插件
  • Obsidian Note for Zotero
  • Zotero style

GitHub 搜索 zotero style 或者Obsidian Note for Zotero
点击 Releases 选择最新版本 xpi 下载。
Obsidian Note for Zotero 地址:
https://github.com/aidenlx/obsidian-zotero/releases/download/zt1.0.1/zotero-obsidian-note-1.0.1.xpi

Note for Zotero配置

Obsidian Note for Zotero 启动 enable

Zotero style 配置

Zotero style 功能非常强大,作者在 B 站也做了很详细的讲解,包括自定义文件属性列,修改标签格式,修改标记格式等等,这里不展开讲,主要讲怎么设置标注的颜色和注释。
安装后,enable。
Shfit+P, 点击或者输入标注
image.png

点开后默认有 8 种颜色,是以颜色命名的。
image.png
鼠标移动到颜色标记的位置,长按鼠标左键,进入配置界面,如果点按右键则是删除配置。可以点击下方的加号,再新增。
长按后根据自己喜好设置颜色及名称。这是我的设置,其实一般也记不住那么多标记,默认有 8 种分类,太多,根本用不完。设置四种颜色完全够用了,红、蓝、黄、绿,背景色调整低一点。
image.png

安装好 Zotero style 插件后,会对标注进行美化。
image.png
类似这样,会比之前好看很多。这也大致是导入 obsidian 后的样子。

Zotlit 设置

设置各种文件存储、读取位置

文献笔记位置

image.png

Zotero 数据库位置

点击 启用服务器enable
image.png

笔记模板文件位置

image.png

修改模板配置文件

修改文件名配置代码,用标题就好了
修改模板,代码看不懂没关系,可以用已经设置好的。

1
<%= it.title%>.md

image.png

修改代码

将ZtTemplates 对应文件进行修改。

Zt-annot. Eta
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<%
var colorToLabelMap = {
" #ffd400": "重要方法",
"#ff6666": "重要概念",
"#5fb236": "重要结论",
"#2ea8e5": "研究背景",
"#a28ae5": "硏究路线",
"#e56eee": "文章素材",
"#f19837": "优秀配图",
"#aaaaaa": "其他",
"default": "暂时未分类 "
};
var labelToShow = colorToLabelMap[it.color] || colorToLabelMap["default"];
%>

[!note] <span style=" background:<%= it.color %>"><%= labelToShow %></span>

<font color="#000000"><%= it.imgEmbed %><%= it.text %></font>
zt-annots.eta
1
2
3
<% for (const annotation of it) { %>
<%~ include("annotation", annotation) %>
<% } %>
Zt-field. Eta
1
2
3
4
5
6
7
8
9
10
title: "<%= it.title %>"
citekey: "<%= it.citekey %>"
itemType: "<%= it.itemType %>"
标题翻译: "<%= it.shortTitle %>"
tags: "<%= it.tags %>"
影响因子: "<%= it.libraryCatalog %>"

出版期刊: "<%= it.publicationTitle %>"
出版年份: "<%= it.date %>"
修改日期: "<%= it.dateModified %>"
Zt-note. Eta
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# <%= it.title %>
## 基础信息

| 属性 | 信息 |
| ------------ | ---------------------------------- |
| **标题翻译** | <%= it.shortTitle %> |
| **作者** | <%= it.creators %> |
| **出版年份** | <%= it.date %> |
| **期刊** | <%= it.publicationTitle %> |
| **期刊等级** | <%= it.libraryCatalog %> |
| **标签** | <%= it.tags %> |
| **附件链接** | <%= it.fileLink %> |
| **zotero跳转** | [点这里跳回zotero哈](<%= it.backlink %>) |

> [!note]- 论文摘要
> <%= it.abstractNote[[0]].replace(/\n/g, '') %>
>

## 论文注释

<%~ include("annots", it.annotations) %>

最终效果

笔记流程
Zotero 做标注笔记,切换到列表视图,右键 obsidian Actions-Create notes。
image.png

Obsidian 中就新建了一条笔记。这个笔记会带有完善的元数据,方便检索。
image.png
以下是笔记正文:

image.png

问题记录

No literature note found for zotero item withkey K9HQMJ9Q

Not implemented yet

点击创建笔记时出错。

错误记录

以前的插件
Zotero tag
Better bibtex
Obsidian note
Reference
Style
Bnotes
茉莉花
翻译

Jasminum

Zotero 中文社区 | Zotero 中文维护小组 (zotero-chinese.com)


obsidian zotero 联动方案 配置记录
https://maoyu92.github.io/2024/05/29/04 经验分享/obsidian zotero 联动方案 配置记录/
作者
陈文茂
发布于
2024年5月29日
许可协议