200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > Zotero-word中引用跳转到参考文献/建立超链接-引用格式(Xie et al Achanta et al )

Zotero-word中引用跳转到参考文献/建立超链接-引用格式(Xie et al Achanta et al )

时间:2021-06-26 22:00:35

相关推荐

Zotero-word中引用跳转到参考文献/建立超链接-引用格式(Xie et al   Achanta et al )

参考文献格式:

引用格式:

,其中数字部分为超链接。

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

2.创建

3.将代码全部替换为下面这个代码

Public Sub ZoteroLinkCitation()Dim nStart&, nEnd&nStart = Selection.StartnEnd = Selection.EndApplication.ScreenUpdating = FalseDim title As StringDim titleAnchor As StringDim style As StringDim fieldCode As StringDim numOrYear As StringDim pos&, n1&, n2&ActiveWindow.View.ShowFieldCodes = TrueSelection.Find.ClearFormattingWith 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.ExecuteWith ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="Zotero_Bibliography".DefaultSorting = wdSortByName.ShowHidden = TrueEnd WithActiveWindow.View.ShowFieldCodes = FalseFor Each aField In ActiveDocument.Fields' check if the field is a Zotero in-text referenceIf InStr(aField.Code, "ADDIN ZOTERO_ITEM") > 0 ThenfieldCode = aField.Codepos = 0Do While InStr(fieldCode, """title"":""") > 0n1 = InStr(fieldCode, """title"":""") + Len("""title"":""")n2 = InStr(Mid(fieldCode, n1, Len(fieldCode) - n1), """,""") - 1 + n1title = Mid(fieldCode, n1, n2 - n1)titleAnchor = Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(title, " ", "_"), "&", "_"), ":", "_"), ",", "_"), "-", "_"), ".", "_"), "(", "_"), ")", "_"), "?", "_"), "!", "_")titleAnchor = Left(titleAnchor, 40)Selection.GoTo What:=wdGoToBookmark, Name:="Zotero_Bibliography"Selection.Find.ClearFormattingWith Selection.Find.Text = Left(title, 255).Replacement.Text = "".Forward = True.Wrap = wdFindAsk.Format = False.MatchCase = False.MatchWholeWord = False.MatchWildcards = False.MatchSoundsLike = False.MatchAllWordForms = FalseEnd WithSelection.Find.ExecuteSelection.Paragraphs(1).Range.SelectWith ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:=titleAnchor.DefaultSorting = wdSortByName.ShowHidden = TrueEnd WithaField.SelectSelection.Find.ClearFormattingWith Selection.Find.Text = "^#".Replacement.Text = "".Forward = True.Wrap = wdFindContinue.Format = False.MatchCase = False.MatchWholeWord = False.MatchWildcards = False.MatchSoundsLike = False.MatchAllWordForms = FalseEnd WithSelection.Find.ExecuteSelection.MoveLeft Unit:=wdCharacter, Count:=1Selection.MoveRight Unit:=wdCharacter, Count:=posSelection.Find.ExecuteSelection.MoveLeft Unit:=wdCharacter, Count:=1Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtendnumOrYear = Selection.Range.Text & ""pos = Len(numOrYear)style = Selection.styleActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:="", SubAddress:=titleAnchor, ScreenTip:="", TextToDisplay:="" & numOrYearaField.SelectSelection.style = style'Selection.style = ActiveDocument.Styles("CitationFormating")fieldCode = Mid(fieldCode, n2 + 1, Len(fieldCode) - n2 - 1)LoopEnd IfNext aFieldActiveDocument.Range(nStart, nEnd).SelectEnd Sub

:要为生成的链接设置样式,请取消注释该行, 并在那里写下您的样式。

'Selection.style = ActiveDocument.Styles("CitationFormating")

代码链接: Zotero

4. Ctrl+s保存,左下角重命名为ZoteroLinkCitation,关闭页面,并关闭Word。

5. 打开word,查看

6. 运行ZoteroLinkCitation

7. 引用展示

8. tips

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

技巧可以插完全部参考文献再运行!!

注意:该方法根据标题作者日期数字样式引用链接到他们的参考文献条目。它在字段中搜索数字年份或序号),选择它,然后将其链接到 zotero 字段中的标题。尚不支持上标样式,因为选择数字会导致整个字段被链接替换。

9. 运行出错的解决办法

1. 问题界面:

2. 点击调试,会出现下面的界面,会提示出现有问题的文献

解决办法:

点击结束,WORD会跳到有问题的文献

打开Zotero,查看有问题的文献

检查标题,会议名称,页码等信息。

:这个错误是标题出现问题了。

找其他正确的文献,把正确的标题复制过来,在这个正确的基础上修改成自己的标题名称。

重新添加文献,最后在运行

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。