问题描述:Endnote是常用的文献管理工具,并提供国标模板Chinese Std GBT7714 (numeric).ens,但Endnote在中英文混排上略欠考虑。Chinese Std GBT7714使用序号的形式(******1)对文献进行引用,但有时我们需要以作者-年份的形式进行引用,例如:使用******(张三 等)或者******(张三和李四),而endnote出现的引用经常是******(张三 et al.)或者******(张三 and 李四)。虽然用替换或手动修改也可以解决上述问题,但如果论文篇幅较长(如:学位论文)或者需要反复修改(好不容易把et al.改成了等,若需要再插入文献,更新Endnote后等又变回et al.了),手动修改或替换就过于繁琐了。
  为了解决该问题,也有博客介绍了:将secondary author填为中文名的方法,具体可参考:
endnote管理中文文献及其双语引用: https://blog.csdn.net/rookieWhoCanProduce/article/details/115326114
  但该方法将中文作者设定为secondary author,背离了Endnote的使用逻辑。而且仅能解决参考文献中的et al.,不能解决文中引用的et al.。
  本文采用更加直接的思路——编写VBA程序,使用宏的方法一键修改张三 et al.或者张三 and 李四为张三 等或者张三和李四。不仅修改文章引用中的张三 et al.或者张三 and 李四问题,也修改文末中文参考文献中出现的张三, et al.。
VBA代码的实现思路:
- 模糊查找[中文] et al.的内容,将其替换为[中文] 等.
- 模糊查找[中文] and [中文].的内容,将其替换为[中文]和[中文].
- 模糊查找[中文], et al.的内容,将其替换为[中文], 等.
VBA代码如下:
Sub UCAS_Thesis_Formate()
Attribute UCAS_Thesis_Formate.VB_ProcData.VB_Invoke_Func = "Normal.NewMacros.宏2"
'replace 'et al.' in citation with '等'
    ActiveDocument.Content.Select
        With Selection.Find
            .ClearFormatting
            .Text = "[一-龥] et al."
            .MatchWildcards = True
        End With
        While Selection.Find.Execute = True
            c = Selection.Range
            Selection.Range = Left(c, 1) & " 等"
        Wend
        
'replace 'and' in citation with '和'
    ActiveDocument.Content.Select
        With Selection.Find
            .ClearFormatting
            .Text = "[一-龥] and [一-龥]"
            .MatchWildcards = True
        End With
        While Selection.Find.Execute = True
            c = Selection.Range
            Selection.Range = Left(c, 1) & "和" & Right(c, 1)
        Wend
        
'replace 'et al.' in reference with '等'
    ActiveDocument.Content.Select
        With Selection.Find
            .ClearFormatting
            .Text = "[一-龥], et al"
            .MatchWildcards = True
        End With
        While Selection.Find.Execute = True
            c = Selection.Range
            Selection.Range = Left(c, 1) & " 等"
        Wend
End Sub
修改前:
 
 修改后:
 
 修改的gif动画:
 
测试数据如下,以中科院学位论文的参考文献要求为例,包含基于国标GBT7714修改后的Endnote模板、修改用的VBA代码和测试文档:
VBA替换中文文献引用出现的et al.和and——以中科院学位论文的参考文献要求为例



















