Citavi批量制作Obsidian前导区
文献精读笔记需要一个模板,方便溯源:
下面是我按模板设置好的开头,这里全部都是citavi自动生成的:
其中:
Cite是可以自定义citavi Style打印
File是citavi条目中所有的pdf, excel和word,可以点击用默认应用打开
Style可以根据影响因子和分区范围,显示不同的颜色。我设置的区段是<3,3-5,5-10,>10。
ShortNote是我的文献备注说明
后面就是论文精读笔记了。
那么这样的模板该怎么做呢,思路就是,用Citavi的宏读取所有相关字段,用宏脚本DebugMacro.WriteLine()
打印成markdown格式,然后复制粘贴过来。
具体如下:
1、前置需求:
使用Citavi的宏翻译标题和摘要 - 知乎 (zhihu.com)
使用Citavi的宏配合easyScholar获取期刊信息 - 知乎 (zhihu.com)
使用这两个方法获取条目的翻译和影响因子信息。
2、整合信息:
打开宏脚本器,用宏脚本运行之后,复制粘贴到obsidian即可:
下面是宏脚本,建议有动手能力的人尝试,注意可能需要设置styleName
using System;
using System.Linq;
using System.ComponentModel;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using SwissAcademic.Citavi;
using SwissAcademic.Citavi.Metadata;
using SwissAcademic.Citavi.Shell;
using SwissAcademic.Collections;
using SwissAcademic.Citavi.Citations;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
// Implementation of macro editor is preliminary and experimental.
// The Citavi object model is subject to change in future version.
public static class CitaviMacro
{
public static void Main()
{
//Get the active project
Project project = Program.ActiveProjectShell.Project;
//Get the active ("primary") MainForm
MainForm mainForm = Program.ActiveProjectShell.PrimaryMainForm;
//reference to active Project
Project activeProject = Program.ActiveProjectShell.Project;
List<Reference> references = mainForm.GetSelectedReferences();
foreach (Reference reference in references)
{
// Cite
string newShortTitle = null;
newShortTitle = NewShortTitle(reference);
// DebugMacro.WriteLine(newShortTitle);
DebugMacro.WriteLine("> Cite:: "+newShortTitle);
// 路径打印:
List<Location> refLocation = reference.Locations.ToList();
string pathString = "";
foreach (Location location in refLocation)