ZotLit Templates: Color-Coding và Custom Literature Notes | Research Tools

Bạn đã kết nối ZotLit với Zotero, tạo được literature note đầu tiên. Nhưng note mặc định trông khá basic - không có màu sắc, không phân loại highlight, metadata thiếu fields cần thiết.

Bài này hướng dẫn thiết lập 7-color coding systemcustom templates để mỗi literature note trở thành tài liệu có cấu trúc, dễ scan và dễ query sau này.

Đây là bài nâng cao. Nếu chưa setup ZotLit cơ bản, xem phần ZotLit trong bài Foundation trước.

Color-Coding System

Một hệ thống highlight màu nhất quán giúp phân loại thông tin khi đọc paper. Đây là system tôi dùng:

Màu Emoji Label Mục đích
🔴 Red 🔴 Skeptical Không đồng ý, hoài nghi
🟡 Yellow 🟡 Important Ý quan trọng, insight hay
🟢 Green 🟢 Agree Đồng ý, resonate
🟣 Purple 🟣 Heading Đề mục, chapter titles
🔵 Blue 🔵 Read more Cần đọc thêm, cite liên quan
🩷 Magenta 🤔 Question Thắc mắc, cần clarify
🟠 Orange 🟠 Concept/Method Khái niệm, methodology

Tại sao English labels? Dễ collaborate với team quốc tế, nhất quán với academic tools khác, tránh lỗi encoding tiếng Việt.

Cấu trúc Template Files

ZotLit sử dụng Eta template engine. Các file chính:

5 - Template/ZotLit/
├── zt-note.eta      # Cấu trúc toàn bộ literature note
├── zt-field.eta     # Frontmatter/properties
├── zt-annot.eta     # Từng annotation
└── zt-annots.eta    # Vòng lặp render annotations

Eject template để chỉnh sửa: Settings → ZotLit → Template → Ejectable Templates → click Eject bên cạnh template muốn chỉnh → Open template file để edit.

Plugin bổ trợ: Highlightr

Để hiển thị màu highlight trong Obsidian (không chỉ plain text), cài Highlightr: Community plugins → Browse → tìm "Highlightr" → Install và Enable.

Template zt-field.eta (Frontmatter)

Template này quyết định metadata trong frontmatter - quan trọng cho Dataview queries sau này.

title: "<%= it.title %>"
citekey: "<%= it.citekey %>"
authors: "<%= it.authorsShort %>"
year: "<%= it.date %>"
journal: "<%= it.publicationTitle %>"
doi: "<%= it.DOI %>"
tags:
  - paper
status: unread
Field Nguồn Dùng cho
citekey Better BibTeX Link, citation
authors Zotero Dataview query
year Zotero Filter theo năm
status Manual Track đã đọc/chưa đọc

Template zt-annot.eta (Single Annotation)

Template này quyết định mỗi annotation hiển thị như thế nào - đây là nơi color-coding được áp dụng.

<%
const colorMap = {
  "red": { emoji: "🔴", label: "Skeptical", hex: "#FF6666" },
  "yellow": { emoji: "🟡", label: "Important", hex: "#FFD400" },
  "green": { emoji: "🟢", label: "Agree", hex: "#5FB236" },
  "purple": { emoji: "🟣", label: "Heading", hex: "#A28AE5" },
  "blue": { emoji: "🔵", label: "Read more", hex: "#2EA8E5" },
  "magenta": { emoji: "🤔", label: "Question", hex: "#E56EEE" },
  "orange": { emoji: "🟠", label: "Concept/Method", hex: "#F19837" }
};
const color = colorMap[it.colorName] ?? { emoji: "⚪", label: it.colorName, hex: "#AAAAAA" };
-%>
<%= color.emoji %> **<%= color.label %>** |<% if (it.text) { %> <mark style="background: <%= color.hex %>;"><%= it.text %></mark><% } %> [Page <%= it.pageLabel %>](<%= it.backlink %>)
<% if (it.comment) { -%>
    ↳ *<%= it.comment %>*
<% } -%>

<%= it.imgEmbed %>
Phần Giải thích
colorMap Map màu Zotero → emoji, label, hex
<mark style="background:..."> Highlight có màu nền (cần Highlightr)
it.comment Comment của bạn, hiển thị italic với ↳
it.imgEmbed Nhúng hình nếu là area selection

Template zt-note.eta (Literature Note)

Template này quyết định cấu trúc toàn bộ note.

# <%= it.title %>

**Authors:** <%= it.authorsShort %>
**Year:** <%= it.date %>
**Journal:** <%= it.publicationTitle %>
**DOI:** <%= it.DOI %>

🔗 [Open in Zotero](<%= it.backlink %>)

---

## Abstract

<%= it.abstractNote %>

---

## My Notes

> Write your own thoughts here...

---

## Annotations

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

---

## 🗂 Action Items

<%
const defined_colors = {
  "magenta": "🤔 Questions to Clarify",
  "blue": "🔵 Further Reading"
};
const defined_action_colors = ["magenta", "blue"];
const defined_annotations = it.annotations.filter(a => defined_action_colors.includes(a.colorName));
const defined_groupBy = Object.groupBy(defined_annotations, a => a.colorName);

for (const color_key of defined_action_colors) {
  if (!defined_groupBy[color_key]) continue;
-%>
### <%= defined_colors[color_key] %>

<% for (const annot of defined_groupBy[color_key]) { -%>
- [ ] "<%= annot.text.substring(0, 80) %><%= annot.text.length > 80 ? "..." : "" %>" ([Page <%= annot.pageLabel %>](<%= annot.backlink %>))
<% } -%>

<% } -%>
Section Mục đích
Header Metadata + link Zotero
Abstract Tóm tắt từ Zotero
My Notes Personal thoughts
Annotations Highlights theo thứ tự PDF
Action Items Auto-tổng hợp Questions + Further Reading thành checklist
Action Items section tự động extract các highlight màu Magenta (Questions) và Blue (Read more) thành task list - rất tiện để track những gì cần follow up.

Mẹo sử dụng

Highlight có hệ thống: Đọc paper lần đầu, dùng Yellow cho important points. Đọc lại, thêm Red/Green cho opinions, Orange cho definitions, Magenta cho questions.

Comments là key: Mỗi highlight nên có comment ngắn giải thích tại sao bạn highlight đoạn đó. Comment xuất hiện dưới highlight trong literature note.

Consistency: Stick với color system đã chọn. Sau 10-20 papers, bạn sẽ scan notes rất nhanh vì não đã quen với màu sắc.

Resources


Bài tiếp theo: Pandoc Reference List - Citations đẹp trong Obsidian

Bài trước: Notero Setup - Kết nối Zotero với Notion

Series: Research Tool Stack