Zotero如何在word中引用跳转到参考文献/建立超链接

article/2025/7/15 16:13:36

省流目录

文章目录

  • 问题:如标题
  • 解决方案
      • 1.打开word->视图->宏->点击,选查看宏
      • 2.创建宏
      • 3.将代码全部替换为下面这个
      • 4. Ctrl+s保存,左下角重命名为ZoteroLinkCitation,关闭页面
      • 5.查看宏
      • 6.运行宏

问题:如标题

Zotero不支持引用和参考文献之间的超链接。
什么坑爹的玩意。。。最重要的功能竟然没有!!!
刚从endnote换到Zotero就遇到这。。。。好感度-1-1-1-1-1~~~

解决方案

警告⚠️仅测试个人案例,运行前请备份!
警告⚠️仅测试个人案例,运行前请备份!
警告⚠️仅测试个人案例,运行前请备份!
软件:word2019
引用格式:数字类型的2015年国标7714
引用格式

1.打开word->视图->宏->点击,选查看宏

在这里插入图片描述

2.创建宏

在这里插入图片描述

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 styleSelection.style = 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. Ctrl+s保存,左下角重命名为ZoteroLinkCitation,关闭页面

在这里插入图片描述

5.查看宏

在这里插入图片描述

6.运行宏

前提:你已经插入好引用,并构建好参考文献了。这个宏只是将两者添加超链接

在这里插入图片描述

完美解决!!!★,°:.☆( ̄▽ ̄)/$:.°★。撒花!!!


http://chatgpt.dhexx.cn/article/8qTVNeP0.shtml

相关文章

论文word引用参考文献

最近在写小论文&#xff0c;查重率竟然达到11%&#xff0c;我就仔细看了看报告&#xff0c;原来参考文献也给我查重了。。。。后来发现是文献引用格式错误&#xff0c;所以被查重&#xff0c;下面记录下文献正确引用方法&#xff1a; 1、将参考的文献内容复制到word中。 eg. …

Word引用参考文献

正确引用参考文献是写论文时重要部分之一。Word引用参考文献有两种方式&#xff1a;通过Word自带的功能实现&#xff0c;使用Endnote辅助Word引用参考文献。两种方法各有利弊。 第一种方法无需下载任何软件&#xff0c;且文献管理是在Word中&#xff0c;可以随Word一起与他人共…

WPS/Word参考文献格式规范及引用的方法

WPS/Word参考文献格式规范及引用的方法 文章目录 WPS/Word参考文献格式规范及引用的方法1.论文参考文献格式规范&#xff1a;2.将参考文献编号3.设置交叉引用4.菜单栏找到上角标符号5.效果和好处 1.论文参考文献格式规范&#xff1a; 举例&#xff1a; 1.期刊类 [格式] [序号]作…

Word操作之参考文献自动关联和引用

首先准备好一篇word文档和待引用的参考文献&#xff0c;如下图所示。 然后对参考文献进行自动编号&#xff0c;将光标定位到第一篇参考文献处&#xff0c;然后选择编号选项->定义新编号格式&#xff0c;如下图所示。 设置编号格式&#xff0c;如下图所示。 编完号的效果如下…

word如何在文中添加参考文献的引用并自动更新

步骤 1.添加参考文献 打开word&#xff0c;将文章末尾写第一个参考文献&#xff0c;如下图所示。 2.添加参考文献的编号 点击编号库&#xff0c;在下拉菜单中选择需要的编号格式&#xff0c;如下所示。 如果编号库中没有所需格式&#xff0c;可以选择【定义新编号格式】&am…

linux grep命令详解

Linux中grep常见用法示例 grep 命令标准格式&#xff1a; grep [-options] -pattern [file…]; 即可理解为 在 指定文件&#xff08;可利用正则表达式表示多个文件&#xff09;中 搜索 模式串(pattern) ,并将结果 按照 -options 指示格式 输出查询结果 [options]主要参数&a…

【Linux入门学习之】grep命令详解

一、grep命令的功能是分析一行信息&#xff0c;若其中有我们所需要的信息&#xff0c;就将其拿出来。需要注意的是它以整行为单位进行数据的选取。 语法&#xff1a;grep [-acinv] [--colorauto] 要查找的字符串 filename -a:将binary文件以text文件的方式查找数据 -c:计算找到…

shell中grep命令详解

grep(Globel Search Regular Expression and Printing out the line)全面搜索正则表达式并把行打印出来&#xff09;是一种强大的文本搜索工具&#xff0c;是一个对行进行操作的搜索工作&#xff0c;它能使用正则表达式搜索文本&#xff0c;并把匹配的行打印出来。Unix的grep家…

linux grep -v多个关键字,Linux grep 命令详解

Grep 是 Global Regular Expression Print 的缩写,它搜索指定文件的内容,匹配指定的模式,默认情况下输出匹配内容所在的行。注意,grep 只支持匹配而不能替换匹配到的内容。 基本语法 语法格式: grep [OPTIONS] PATTERN [FILE...] grep [OPTIONS] [-e PATTERN | -f FILE] […

shell命令三剑客之grep命令详解

文章目录 1. 通配符&#xff08;globbing&#xff09;2. grep2.1 linux系统支持的三种形式的grep命令 3. 正则表达式3.1 扩展正则表达式 4. IP的正则4.1 ip地址的类别4.2 ip地址的正则 5. shell中的特殊字符6. 练习 正则表达式和grep、vim、awk、sed等的关系&#xff1a; 正则表…

tail、less、grep命令详解

linux查看日志命令 1、tail命令2、cat、more和less命令3、grep命令 1、tail命令 该命令主要用于监听文件新增的内容&#xff0c;实时查看文件新增的内容。 tail [选项] 文件名 选项&#xff1a;-n 行数:显示文件最近的n行数据-f : 监听文件新增的内容tail查看的文本内容 常用…

Linux-Grep命令详解

一、基础的grep命令 1.1 -A -B -C参数的使用 命令格式&#xff1a;grep -A m “关键字” xxxx&#xff08;文件&#xff09; 显示出关键字所在行以及关键字所在的以下m行内容 [rootlocalhost ~]# grep -A 10 “game” /etc/passwd #搜索出关键字“game” 并打印出关键字所在的…

Linux - grep命令详解

目录 grep命令 模式&#xff1a; 模式 &#xff1a; 其实就是一些条件的组合&#xff0c;用来表达某个意思 常见选项&#xff1a; -o 选项 --》 只显示匹配的内容 --only-matching -i 选项 --》 忽略大小写&#xff0c;都匹配显示出来 --ignore-case -n 选项 --》 给匹…

一看就懂-grep命令详解

转载自&#xff1a;https://www.zsythink.net/archives/1733 如果你是一个新手&#xff0c;请从头阅读这篇文章&#xff0c;如果你只是忘记了grep命令的一些常用选项&#xff0c;直接查看文章尾部的总结部分即可。 先说说grep命令能做什么&#xff1f; 我们可以使用grep命令在…

netdata mysql_netdata使用

简介 一直想找一个合适的系统监控软件&#xff0c;简单好用易安装易扩展易维护&#xff0c;转悠了好久没有找到合适的&#xff0c;偶然间在开源中国中看到了netdata&#xff0c;第一眼看到界面眼前就为之一亮&#xff0c;安装后更是觉得大赞&#xff0c;好东西分享一下。 Netda…

Docker系列 酷炫的服务器性能监测工具netdata

转自我的个人博客https://blognas.hwb0307.com。欢迎关注&#xff01; 前言 此文内容目前处于BETA版本 我之前在《Linux基础 目录管理的个人实践》曾经介绍过一款叫Ward的VPS性能监控应用&#xff0c;当时对它的privilegedtrue带来的安全性问题有点担忧。近期忽然发现它的Docke…

netdata安装方式

相关地址 : (建议按照官网文档进行操作) github : https://github.com/netdata/netdata 官网 : https://learn.netdata.cloud/docs/agent/packaging/installer/ 官网-docker安装 : https://hub.docker.com/r/netdata/netdata/ // 镜像拉取 : docker pull netdata/netdata// doc…

Netdata与centos7

Netdata是一个高度优化的Linux守护进程&#xff0c;它为Linux系统&#xff0c;应用程序&#xff0c;SNMP服务等提供实时的性能监测。 Github: https://github.com/firehol/netdata/wiki/Installation (安装教程) 开源中国&#xff1a;http://www.oschina.net/p/netdata/simila…

linux-netdata监控配置

netdata部署步骤记录 安装步骤的总结 1.wget https://github.com/netdata/netdata/archive/v1.16.1.tar.gz tar -zxvf v1.16.1.tar.gz 解压 2.# CentOS / Red Hat Enterprise Linux yum install autoconf automake curl gcc git libmnl-devel libuuid-devel openssl-devel …

netdata监控服务器主机(包括Docker容器)

效果 Docker部署 创建挂载目录 mkdir -p /data/netdata/{netdatacache,netdatalib}docker运行 docker run -d --namenetdata \-p 19999:19999 \-v /data/netdata/netdatalib:/var/lib/netdata \-v /data/netdata/netdatacache:/var/cache/netdata \-v /etc/passwd:/host/etc…