当前位置: 首页 > news >正文

word中插入zotero引用

1、参考文献末尾没有文献?

在文献条目要显示的地方点击“refresh”

2、参考文献条目没有悬挂缩进?

把“书目”添加到样式库中,修改样式为悬挂缩进1.5字符

3、交叉引用?

新建一个宏

粘贴下面代码

Public Sub ZoteroLinkCitation()' get selected area (if applicable)Dim nStart&, nEnd&nStart = Selection.StartnEnd = Selection.End' toggle screen updatingApplication.ScreenUpdating = False' define variablesDim title As StringDim titleAnchor As StringDim style As StringDim fieldCode As StringDim numOrYear As StringDim pos&, n1&, n2&, n3&ActiveWindow.View.ShowFieldCodes = TrueSelection.Find.ClearFormatting' find the Zotero bibliographyWith Selection.Find.Text = "^d ADDIN ZOTERO_BIBL".Replacement.Text = "".Forward = True.Wrap = wdFindContinue.Format = False.MatchCase = False.MatchWholeWord = False.MatchWildcards = False.MatchSoundsLike = False.MatchAllWordForms = FalseEnd WithSelection.Find.Execute' add bookmark for the Zotero bibliographyWith ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="Zotero_Bibliography".DefaultSorting = wdSortByName.ShowHidden = TrueEnd With' loop through each field in the documentFor Each aField In ActiveDocument.Fields' check if the field is a Zotero in-text reference'##################################################If InStr(aField.Code, "ADDIN ZOTERO_ITEM") > 0 ThenfieldCode = aField.Code'#############' Prepare' Plain citation== Format of Textfield shown' must be in BracketsDim plain_Cit As StringplCitStrBeg = """plainCitation"":""["plCitStrEnd = "]"""n1 = InStr(fieldCode, plCitStrBeg)n1 = n1 + Len(plCitStrBeg)n2 = InStr(Mid(fieldCode, n1, Len(fieldCode) - n1), plCitStrEnd) - 1 + n1plain_Cit = Mid$(fieldCode, n1 - 1, n2 - n1 + 2)'Reference 'as shown' in word as a string'Title array in fieldCode (all referenced Titles within this field)Dim array_RefTitle(32) As Stringi = 0Do While InStr(fieldCode, """title"":""") > 0n1 = InStr(fieldCode, """title"":""") + Len("""title"":""")n2 = InStr(Mid(fieldCode, n1, Len(fieldCode) - n1), """,""") - 1 + n1If n2 < n1 Then 'Exception the type 'Article'n2 = InStr(Mid(fieldCode, n1, Len(fieldCode) - n1), "}") - 1 + n1 - 1End Ifarray_RefTitle(i) = Mid(fieldCode, n1, n2 - n1)fieldCode = Mid(fieldCode, n2 + 1, Len(fieldCode) - n2 - 1)i = i + 1LoopTitles_in_Cit = i'Number array with References shown in PlainCit'Numer is equal or less than Titels, depending on the type'[3], [8]-[10]; [2]-[4]; [2], [4], [5]' All citations have to be in Brackets each! [3], [8] not [3, 8]' This doesnt work otherwise!' --> treatment of other delimiters could be implemented hereDim RefNumber(32) As Stringi = 0Do While (InStr(plain_Cit, "]") Or InStr(plain_Cit, "[")) > 0n1 = InStr(plain_Cit, "[")n2 = InStr(plain_Cit, "]")RefNumber(i) = Mid(plain_Cit, n1 + 1, n2 - (n1 + 1))plain_Cit = Mid(plain_Cit, n2 + 1, Len(plain_Cit) - (n2 + 1) + 1)i = i + 1LoopRefs_in_Cit = i'treat only the shown references (skip the rest)'[3], [8]-[10] --> skip [9]'Order of titles given from fieldcode, not checked!If Titles_in_Cit > Refs_in_Cit Thenarray_RefTitle(Refs_in_Cit - 1) = array_RefTitle(Titles_in_Cit - 1)i = 1Do While Refs_in_Cit + i <= Titles_in_Citarray_RefTitle(Refs_in_Cit + i - 1) = ""i = i + 1LoopEnd If'#############'Make the linksFor Refs = 0 To Refs_in_Cit - 1 Step 1title = array_RefTitle(Refs)array_RefTitle(Refs) = ""' make title a valid bookmark nametitleAnchor = titletitleAnchor = MakeValidBMName(titleAnchor)ActiveWindow.View.ShowFieldCodes = FalseSelection.GoTo What:=wdGoToBookmark, Name:="Zotero_Bibliography"'' locate the corresponding reference in the bibliography'' by searching for its titleSelection.Find.ClearFormattingWith Selection.Find.Text = Left(title, 255).Replacement.Text = "".Forward = True.Wrap = wdFindContinue.Format = False.MatchCase = False.MatchWholeWord = False.MatchWildcards = False.MatchSoundsLike = False.MatchAllWordForms = FalseEnd WithSelection.Find.Execute' select the whole caption (for mouseover tooltip)Selection.MoveStartUntil ("["), Count:=wdBackwardSelection.MoveEndUntil (vbBack)lnkcap = "[" & Selection.Textlnkcap = Left(lnkcap, 70)' add bookmark for the reference within the bibliographySelection.ShrinkWith ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:=titleAnchor.DefaultSorting = wdSortByName.ShowHidden = TrueEnd With' jump back to the fieldaField.Select' find and select the numeric part of the field which will become the hyperlinkSelection.Find.ClearFormattingWith Selection.Find.Text = RefNumber(Refs).Replacement.Text = "".Forward = True.Wrap = wdFindContinue.Format = False.MatchCase = False.MatchWholeWord = False.MatchWildcards = False.MatchSoundsLike = False.MatchAllWordForms = FalseEnd WithSelection.Find.ExecutenumOrYear = Selection.Range.Text & ""' store current stylestyle = Selection.style' Generate the Hyperlink -->Forward!ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:="", SubAddress:=titleAnchor, ScreenTip:=lnkcap, TextToDisplay:="" & numOrYear' reset the style' comment if you want standard link styleaField.SelectWith Selection.Font.Underline = wdUnderlineNone.ColorIndex = wdBlackEnd WithNext Refs 'References in CitEnd If  'If Zotero-Field'#########################Next aField ' next field' go back to original range selectedActiveWindow.View.ShowFieldCodes = FalseActiveDocument.Range(nStart, nEnd).SelectEnd SubFunction MakeValidBMName(strIn As String)Dim pFirstChr As StringDim i As LongDim tempStr As StringstrIn = Trim(strIn)pFirstChr = Left(strIn, 1)If Not pFirstChr Like "[A-Za-z]" ThenstrIn = "A_" & strInEnd IfFor i = 1 To Len(strIn)Select Case Asc(Mid$(strIn, i, 1))Case 49 To 57, 65 To 90, 97 To 122tempStr = tempStr & Mid$(strIn, i, 1)Case ElsetempStr = tempStr & "_"End SelectNext itempStr = Replace(tempStr, "  ", " ")MakeValidBMName = Left(tempStr, 40)End Function

运行即可

4、多篇参考文献[1,2]修改成[1-2]

点击“多重参考来源”-点击左下角“编辑器”即可

相关文章:

word中插入zotero引用

1、参考文献末尾没有文献&#xff1f; 在文献条目要显示的地方点击“refresh” 2、参考文献条目没有悬挂缩进&#xff1f; 把“书目”添加到样式库中&#xff0c;修改样式为悬挂缩进1.5字符 3、交叉引用&#xff1f; 宏 新建一个宏 粘贴下面代码 Public Sub ZoteroLinkCita…...

需求上线,为什么要刷缓存?

在需求上线的过程中&#xff0c;刷缓存主要有以下几个重要原因&#xff1a; 一、保证数据的准确性 旧数据残留问题 缓存是为了加快数据访问速度而存储的数据副本。在需求更新后&#xff0c;之前缓存中的数据可能已经不符合新的业务逻辑。例如&#xff0c;一个电商网站修改了商…...

TVS二极管选型【EMC】

TVS器件并联在电路中&#xff0c;当电路正常工作时&#xff0c;他处于截止状态&#xff08;高阻态&#xff09;&#xff0c;不影响线路正常工作&#xff0c;当线路处于异常过压并达到其击穿电压时&#xff0c;他迅速由高阻态变为低阻态&#xff0c;给瞬间电流提供一个低阻抗导通…...

《从入门到精通:蓝桥杯编程大赛知识点全攻略》(一)-递归实现指数型枚举、递归实现排列型枚举

本篇博客将聚焦于通过递归来实现两种经典的枚举方法&#xff1a;指数型枚举和排列型枚举。这两种枚举方式在计算机科学和算法竞赛中都有广泛应用&#xff0c;无论是在解题中&#xff0c;还是在实际工作中都极具价值。 目录 前言 斐波那契数列递归 递归实现指数型枚举 算法思…...

C#对线程同步的应用

什么是线程同步&#xff1f;线程同步的应用场景有哪些&#xff1f;在C#中有哪些线程同步方式&#xff1f;下面对这些问题做一个总结&#xff0c;让大家在面试的时候遇到这些问题能够游刃有余。 线程同步是指在多线程环境下&#xff0c;多个线程同时访问共享资源时&#xff0c;确…...

基于微信小程序的面部动作检测系统

引言 本技术文档旨在详细阐述一个基于微信小程序的面部动作检测系统的技术路线、实现方法及关键技术框架。系统的核心功能包括检测用户的左右转头、眨眼和张嘴动作&#xff0c;并根据检测结果逐步引导用户完成任务。为确保系统的安全性和准确性&#xff0c;特别是防止用户通过…...

Activation Functions

Chapter4&#xff1a;Activation Functions 声明&#xff1a;本篇博客笔记来源于《Neural Networks from scratch in Python》&#xff0c;作者的youtube 其实关于神经网络的入门博主已经写过几篇了&#xff0c;这里就不再赘述&#xff0c;附上链接。 1.一文窥见神经网络 2.神经…...

《Vue3实战教程》37:Vue3生产部署

如果您有疑问&#xff0c;请观看视频教程《Vue3实战教程》 生产部署​ 开发环境 vs. 生产环境​ 在开发过程中&#xff0c;Vue 提供了许多功能来提升开发体验&#xff1a; 对常见错误和隐患的警告对组件 props / 自定义事件的校验响应性调试钩子开发工具集成 然而&#xff…...

Linux:各发行版及其包管理工具

相关阅读 Linuxhttps://blog.csdn.net/weixin_45791458/category_12234591.html?spm1001.2014.3001.5482 Debian 包管理工具&#xff1a;dpkg&#xff08;低级包管理器&#xff09;、apt&#xff08;高级包管理器&#xff0c;建立在dpkg基础上&#xff09;包格式&#xff1a;…...

【计算机网络】课程 作业一 搭建连续覆盖的办公网络

作业一 搭建连续覆盖的办公网络 题目&#xff1a;论述题&#xff08;共1题&#xff0c;100分&#xff09; 充分利用所学习的数据链路层局域网知识&#xff0c;加上物理层的基础知识&#xff0c;请给一个办公场所&#xff08;三层&#xff0c;每层约100平方&#xff09;&#xf…...

C++ 设计模式:单例模式(Singleton Pattern)

链接&#xff1a;C 设计模式 链接&#xff1a;C 设计模式 - 享元模式 单例模式&#xff08;Singleton Pattern&#xff09;是创建型设计模式&#xff0c;它确保一个类只有一个实例&#xff0c;并提供一个全局访问点来访问这个实例。单例模式在需要全局共享资源或控制实例数量的…...

OpenCV调整图像亮度和对比度

【欢迎关注编码小哥&#xff0c;学习更多实用的编程方法和技巧】 1、基本方法---线性变换 // 亮度和对比度调整 cv::Mat adjustBrightnessContrast(const cv::Mat& src, double alpha, int beta) {cv::Mat dst;src.convertTo(dst, -1, alpha, beta);return dst; }// 使用…...

Kafka Offset explorer使用

Kafka集群配置好以后以后运维这边先用工具测试一下&#xff0c;便于rd展开后续的工作&#xff0c;本地调试时一般使用Offset explorer工具进行连接 使用SASL(Simple Authentication and Security Layer)验证方式 使用SCRAM-SHA-256(Salted Challenge Response Authentication…...

二维码文件在线管理系统-收费版

需求背景 如果大家想要在网上管理自己的文件&#xff0c;而且需要生成二维码&#xff0c;下面推荐【草料二维码】&#xff0c;这个系统很好。特别适合那些制造业&#xff0c;实体业的使用手册&#xff0c;你可以生成一个二维码&#xff0c;贴在设备上&#xff0c;然后这个二维码…...

UE4.27 Android环境下获取手机电量

获取电量方法 使用的方法时FAndroidMisc::GetBatteryLevel(); 出现的问题 但是在电脑上编译时发现&#xff0c;会发现编译无法通过。 因为安卓环境下编译时&#xff0c;包含 #include "Android/AndroidPlatformMisc.h" 头文件是可以正常链接的&#xff0c;但在电…...

vue-i18n报错

1. 开发环境报错Uncaught (in promise) TypeError: ‘set’ on proxy: trap returned falsish for property ‘$t’ legacy需要设置为false const i18n createI18n({legacy: false,// 默认语言locale: lang,// 设置语言环境messages, })2. 打包配置tsc --noEmit时报错&#…...

Docker新手:在tencent云上实现Python服务打包到容器

1 使用docker的原因 一致性和可移植性&#xff1a;Docker 容器可以在任何支持 Docker 的环境中运行&#xff0c;无论是开发者的笔记本电脑、测试服务器还是生产环境。这确保了应用在不同环境中的行为一致&#xff0c;减少了“在我的机器上可以运行”的问题。 隔离性&#xff…...

React基础知识学习

学习React前端框架是一个系统而深入的过程&#xff0c;以下是一份详细的学习指南&#xff1a; 一、React基础知识 React简介 React是一个用于构建用户界面的JavaScript库&#xff0c;由Facebook开发和维护。它强调组件化和声明式编程&#xff0c;使得构建复杂的用户界面变得更…...

ES IK分词器插件

前言 ES中默认了许多分词器&#xff0c;但是对中文的支持并不友好,IK分词器是一个专门为中文文本设计的分词工具&#xff0c;它不是ES的内置组件&#xff0c;而是一个需要单独安装和配置的插件。 Ik分词器的下载安装&#xff08;Winows 版本&#xff09; 下载地址&#xff1a;…...

二十三种设计模式-抽象工厂模式

抽象工厂模式&#xff08;Abstract Factory Pattern&#xff09;是一种创建型设计模式&#xff0c;它提供了一种方式&#xff0c;用于创建一系列相关或相互依赖的对象&#xff0c;而不需要指定它们具体的类。这种模式主要用于系统需要独立于其产品的创建逻辑时&#xff0c;并且…...

python opencv的orb特征检测(Oriented FAST and Rotated BRIEF)

官方文档&#xff1a;https://docs.opencv.org/4.10.0/d1/d89/tutorial_py_orb.html SIFT/SURF/ORB对比 https://www.bilibili.com/video/BV1Yw411S7hH?spm_id_from333.788.player.switch&vd_source26bb43d70f463acac2b0cce092be2eaa&p80 ORB代码 import numpy a…...

高阶数据结构----布隆过滤器和位图

&#xff08;一&#xff09;位图 位图是用来存放某种状态的&#xff0c;因为一个bit上只能存0和1所以一般只有两种状态的情况下适合用位图&#xff0c;所以非常适合判断数据在或者不在&#xff0c;而且位图十分节省空间&#xff0c;很适合于海量数据&#xff0c;且容易存储&…...

VScode使用密钥进行ssh连接服务器方法

如何正常连接ssh的方式可以看我原来那篇文章&#xff1a;Windows上使用VSCode连接远程服务器ssh 1.连接 点击ssh加号&#xff0c;然后关键点在第2步的书写上 2.命令 2的位置写命令&#xff1a; ssh -i "C:\Users\userName\.ssh\id_rsa" usernameIP -p 端口号 端…...

艾体宝产品丨加速开发:Redis 首款 VS Code 扩展上线!

Redis 宣布推出其首款专为 VS Code 设计的 Redis 扩展。这一扩展将 Redis 功能直接整合进您的集成开发环境&#xff08;IDE&#xff09;&#xff0c;旨在简化您的工作流程&#xff0c;提升工作效率。 我们一直致力于构建强大的开发者生态系统&#xff0c;并在您工作的每一步提…...

应用架构模式

设计模式 设计模式是指根据通用需求来设计解决方案的模板或蓝图&#xff0c;使用设计模式能够更加有效地解决设计过程中的常见问题。设计模式针对不同的问题域有不同的内涵&#xff0c;主要涉及业务、架构、程序设计等问题域&#xff0c;本文主要讨论架构设计模式。 业务设计模…...

注入少量可学习的向量参数: 注入适配器IA3

注入少量可学习的向量参数: 注入适配器IA3 简介:IA3通过学习向量来对激活层加权进行缩放,从而获得更强的性能,同时仅引入相对少量的新参数。它的诞生背景是为了改进LoRA,与LoRA不同的是,IA3直接处理学习向量,而不是学习低秩权重矩阵,这使得可训练参数的数量更少,并且原…...

【C++】B2076 球弹跳高度的计算

博客主页&#xff1a; [小ᶻ☡꙳ᵃⁱᵍᶜ꙳] 本文专栏: C 文章目录 &#x1f4af;前言&#x1f4af;题目描述输入格式输出格式输入输出示例 &#x1f4af;两种代码实现及其对比我的代码实现代码分析优点与不足 老师的代码实现代码分析优点与不足 &#x1f4af;两种实现的对…...

【Python】selenium结合js模拟鼠标点击、拦截弹窗、鼠标悬停方法汇总(使用 execute_script 执行点击的方法)

我们在写selenium获取网络信息的时候&#xff0c;有时候我们会受到对方浏览器的监控&#xff0c;对方通过分析用户行为模式&#xff0c;如点击、滚动、停留时间等&#xff0c;网站可以识别出异常行为&#xff0c;进而对Selenium爬虫进行限制。 这里我们可以加入JavaScript的使…...

CatBoost算法详解与PyTorch实现

CatBoost算法详解与PyTorch实现 目录 CatBoost算法详解与PyTorch实现@[TOC](目录)1. CatBoost算法概述1.1 梯度提升树(GBDT)1.2 CatBoost的优势2. CatBoost的核心技术2.1 类别特征处理2.2 对称树结构2.3 有序提升技术2.4 正则化技术3. PyTorch实现CatBoost3.1 环境准备3.2 Py…...

“TypeScript版:数据结构与算法-初识算法“

引言 在算法与编程的广阔世界里&#xff0c;总有一些作品以其独特的魅力和卓越的设计脱颖而出&#xff0c;成为我们学习和研究的典范。今天&#xff0c;我非常荣幸地向大家分享一个令人印象深刻的算法——Hello算法。 Hello算法不仅展现了作者深厚的编程功底&#xff0c;更以…...