我的 TexStudio 已停止工作,不断提示第 y 页上的引用“x”未定义

我的 TexStudio 已停止工作,不断提示第 y 页上的引用“x”未定义

我不知道为什么,但出于某种原因,我的 Texstudio 程序不再工作,通知我文件中的所有引用.bib均无效。它有许多警告,包括缺少引用和扫描使用时文件结束\harvardurl

我觉得奇怪的是它以前一直在工作,直到我开始一个新的部分,但现在其中一个却开始工作了。

编辑:这是 bib 文件条目给出错误

\usepackage{filecontents}

\begin{filecontents*}{ref.bib}
@online{HyperPhysicsEM,
    author = "Rod Nave",
    title = "{Electromagnetic Waves}",
    year = "2005", 
    url  = "http://hyperphysics.phy-astr.gsu.edu/hbase/Waves/emwavecon.html",
    OPTurldate  = {accessed: 25/02/2018}        
}
@online{Microwave,
    author = "Jim Lucas",
    title = "{What Are Microwaves?}",
    year = "2018", 
    url  = "https://www.livescience.com/50259-microwaves.html",
    OPTurldate  = {25/02/2018}      
}

@online{Transducer,
    author = "CyberPhysics",
    title = "{The Piezoelectric Transducer}",
    year = "2018", 
    url  = "http://www.cyberphysics.co.uk/topics/medical/Ultrasound/PETransducer.html",
    note = "(accessed: 23/02/2018)"     
}


@online{Peffect,
    author = "D. Vatansever and E Siores and T. Shah",
    title = "{Alternative Resources for Renewable Energy: Piezoelectric and Photovoltaic Smart Structures}",
    year = "2012", 
    url  = "https://www.intechopen.com/books/global-warming-impacts-and-future-perspective/alternative-resources-for-renewable-energy-piezoelectric-and-photovoltaic-smart-structures",
    OPTurldate  = { 23/02/2018}     
}

@online{InversePeffect,
    author = "Carmen Emily Yang ",
    title = "{What is the Piezoelectric Effect?}",
    year = "2016", 
    url  = "http://www.electronicdesign.com/power/what-piezoelectric-effect",
    OPTurldate  = { 23/02/2018}         
}

@online{PulseEcho ,
    author = "Barnana Pal",
    title = {Pulse-echo method can't measure wave attenuation accurately },
    year = "2014",
    url  = "http://www.electronicdesign.com/power/what-piezoelectric-effect",
    OPTurldate  = { 23/03/2018}     
}

@online{HarbourPorpoise,
    author = "Lee A. Miller and Magnus Wahlberg",
    title = {Echolocation by the harbour porpoise: life in coastal waters},
    year = "2013",
    url  = "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3625834/",
    OPTurldate  = { 26/03/2018}     
}

@online{UltrasonicFrogs,
    author = "Albert S. Feng and Peter M. Narins and Chun-He Xu and Wen-Yu Lin and Zu-Lin Yu and Qiang Qiu and Zhi-Min Xu and Jun-Xian Shen",
    title = {Ultrasonic communication in frogs},
    year = "2006",
    url  = "https://www.nature.com/articles/nature04416.epdf?referrer_access_token=LNiCFtk3I0dn2v_AQJi7L9RgN0jAjWel9jnR3ZoTv0Mg8z7v5gDUqEkMtxgbkmfnvtnkk6K-DSpQAwlhEv7S09o7Z1CcRAGZ-jRhIZrCBxEnNLEm-Hh2WWuS7KsV2QRDgRk1XxPWezWv0JDp4VGznNDREMvAIetTrYWhs-_WUHSXAiAcnqL4ZFrjt7BaN85qwq1dToDeNugpAcT9jN9--j-DNo5sboys5-h8E0-gCYE%3D&tracking_referrer=www.nature.com",
    OPTurldate  = { 30/03/2018}     
}
\end{filecontents*}

\bibliography{ref}

带有文档类report、参考样式asgmnatbib引用管理包。最后我确实使用了url包。

答案1

一些评论:

  • 参考书目样式agsm无法识别名为 的字段OPTurldate。如果您希望访问日期显示在格式化的参考书目中,则需要将字段名称更改为note

  • 请注意,agsm围兜样式不具有称为的条目类型;而是使用@online包罗万象的条目类型。@misc

  • 这些author字段被花括号和双引号括起来,阻止了句子样式(默认)的应用agsm。我会删除它。

  • 由于url条目的字段UltrasonicFrogs包含一个%字符以及几个_(下划线)字符,因此无法使用设置正确处理它agsm(这依赖于\harvardurl,而 并不像 那样\url对此类“特殊”字符的存在那么强大)。经过一些测试,我发现成功排版其余条目(以及所有其他 bib 条目)的唯一方法是将字段重命名url为 无法识别的字符串agsm

最后,一个相当广泛的问题:为什么你使用这种agsm风格吗?自 1991 年以来,它一直基本没有变化 [!],它有很多怪癖,它排版 URL 的方式相当古怪(说得客气一点),而且它不能正确处理一般的 URL 字符串。在我看来,它agsm带来的麻烦远远超过了它的价值。

在此处输入图片描述

\RequirePackage{filecontents}   
\begin{filecontents*}{ref.bib}
@online{HyperPhysicsEM,
    author = "Rod Nave",
    title = "Electromagnetic Waves",
    year = "2005", 
    url = "http://hyperphysics.phy-astr.gsu.edu/hbase/Waves/emwavecon.html",
    note = {Accessed on 25/02/2018}        
}
@online{Microwave,
    author = "Jim Lucas",
    title = "What Are Microwaves?",
    year = "2018", 
    url = "https://www.livescience.com/50259-microwaves.html",
    note = {Accessed on 25/02/2018}      
}

@online{Transducer,
    author = "CyberPhysics",
    title = "The Piezoelectric Transducer",
    year = "2018", 
    url = "http://www.cyberphysics.co.uk/topics/medical/Ultrasound/PETransducer.html",
    note = "(accessed on 23/02/2018)"     
}

@online{Peffect,
    author = "D. Vatansever and E Siores and T. Shah",
    title = "Alternative Resources for Renewable Energy: Piezoelectric and Photovoltaic Smart Structures",
    year = "2012", 
    url = "https://www.intechopen.com/books/global-warming-impacts-and-future-perspective/alternative-resources-for-renewable-energy-piezoelectric-and-photovoltaic-smart-structures",
    note = {Accessed on 23/02/2018}     
}

@online{InversePeffect,
    author = "Carmen Emily Yang ",
    title = "What is the Piezoelectric Effect?",
    year = "2016", 
    url = "http://www.electronicdesign.com/power/what-piezoelectric-effect",
    note = {Accessed on 23/02/2018}         
}

@online{PulseEcho ,
    author = "Barnana Pal",
    title = "Pulse-echo method can't measure wave attenuation accurately",
    year = "2014",
    url = "http://www.electronicdesign.com/power/what-piezoelectric-effect",
    note = {Accessed on 23/03/2018}     
}

@online{HarbourPorpoise,
    author = "Lee A. Miller and Magnus Wahlberg",
    title = {Echolocation by the harbour porpoise: life in coastal waters},
    year = "2013",
    url = "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3625834/",
    note = {Accessed on 26/03/2018}     
}

@online{UltrasonicFrogs,
    author = "Albert S. Feng and Peter M. Narins and Chun-He Xu and Wen-Yu Lin and Zu-Lin Yu and Qiang Qiu and Zhi-Min Xu and Jun-Xian Shen",
    title = {Ultrasonic communication in frogs},
    year = "2006",
    xurl = "https://www.nature.com/articles/nature04416.epdf?referrer_access_token=LNiCFtk3I0dn2v_AQJi7L9RgN0jAjWel9jnR3ZoTv0Mg8z7v5gDUqEkMtxgbkmfnvtnkk6K-DSpQAwlhEv7S09o7Z1CcRAGZ-jRhIZrCBxEnNLEm-Hh2WWuS7KsV2QRDgRk1XxPWezWv0JDp4VGznNDREMvAIetTrYWhs-_WUHSXAiAcnqL4ZFrjt7BaN85qwq1dToDeNugpAcT9jN9--j-DNo5sboys5-h8E0-gCYE%3D&tracking_referrer=www.nature.com
    ",
    note = {Accessed on 30/03/2018}     
}
\end{filecontents*}

\documentclass{article}
\usepackage[hyphens]{url}
\usepackage[comma]{natbib}
\bibliographystyle{agsm}

\begin{document}
\nocite{*}
\bibliography{ref}
\end{document}

附录:我想指出的另一件事是,您几乎只使用@online作为书目条目类型几乎肯定是错误的。例如,带有关键字的出版物UltrasonicFrogs发表在期刊上自然. 您应该使用以下输入类型@article

@article{UltrasonicFrogs,
    author  = "Albert S. Feng and Peter M. Narins and Chun-He Xu and 
               Wen-Yu Lin and Zu-Lin Yu and Qiang Qiu and Zhi-Min Xu 
               and Jun-Xian Shen",
    title   = "Ultrasonic communication in frogs",
    journal = "Nature",
    year    = 2006,
    volume  = 440,
    pages   = "333--336",
    url     = "https://www.nature.com/articles/nature04416.epdf",     
}

请注意,出版物的 URL 可以(而且几乎肯定应该!)比您在帖子中提供的内容大大缩短。还请注意,我删除了note带有“访问日期...”提示的字段,因为访问日期信息与期刊上发表的文章几乎无关。

您可能应该努力浏览整个参考书目,并决定哪些当前类型的条目@online应该真正被赋予诸如、、等条目类型@article@book当然,Miller 和 Wahlberg 发表在杂志 *Frontiers in Physiology* 上的文章也@techreport应该属于该类型。@article

相关内容