URL 后的引用中有空格

URL 后的引用中有空格

在此处输入图片描述

在我的第二和第三个引用中,URL 后面有一个很大的空格,为什么?我该如何删除它?

\usepackage{natbib}

\begin{document}

\bibliographystyle{agsm} % Harvard style
\bibliography{ref.bib}

\end{document}

以及ref.bib有问题的条目。

@article{Tabish2007,
   author = {Syed Amin Tabish},
   issn = {1658-3639},
   issue = {2},
   journal = {International journal of health sciences},
   month = {7},
   pages = {V-VIII},
   pmid = {21475425},
   publisher = {Qassim University, Kingdom of Saudi Arabia},
   title = {Is Diabetes Becoming the Biggest Epidemic of the Twenty-first Century?},
   volume = {1},
   url = {https://pubmed.ncbi.nlm.nih.gov/21475425 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3068646/},
   year = {2007},
}

@article{Ramachandran2014,
   author = {A Ramachandran},
   issn = {0971-5916},
   issue = {5},
   journal = {The Indian journal of medical research},
   keywords = {*Physical Examination,Diabetes Mellitus/diagnosis/*epidemiology/physiopathology,Humans,Prediabetic State/*diagnosis/epidemiology/physiopathology,Risk Factors},
   month = {11},
   pages = {579-581},
   pmid = {25579136},
   publisher = {Medknow Publications & Media Pvt Ltd},
   title = {Know the signs and symptoms of diabetes},
   volume = {140},
   url = {https://pubmed.ncbi.nlm.nih.gov/25579136 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4311308/},
   year = {2014},
}

答案1

我建议使用类似这样的方法(在将文件url中的字段缩减bib为仅包含一个 URL 而不是两个 URL 之后)。重新定义\harvardurl可以启用正确的 URL 中断,默认设置则不行,此外,xurl包会进行修改\url,以便它可以在基本上任何字符处中断 URL。

\documentclass[a4paper]{article}

\usepackage{natbib}
\usepackage{xurl}

\renewcommand\harvardurl[1]{\textbf{URL:} {\itshape\urlstyle{same}\url{#1}}}

\begin{filecontents}[overwrite]{\jobname.bib}
@article{Tabish2007,
   author = {Syed Amin Tabish},
   issn = {1658-3639},
   issue = {2},
   journal = {International journal of health sciences},
   month = {7},
   pages = {V-VIII},
   pmid = {21475425},
   publisher = {Qassim University, Kingdom of Saudi Arabia},
   title = {Is Diabetes Becoming the Biggest Epidemic of the Twenty-first Century?},
   volume = {1},
   url = {https://pubmed.ncbi.nlm.nih.gov/21475425},
   year = {2007},
}

@article{Ramachandran2014,
   author = {A Ramachandran},
   issn = {0971-5916},
   issue = {5},
   journal = {The Indian journal of medical research},
   keywords = {*Physical Examination,Diabetes Mellitus/diagnosis/*epidemiology/physiopathology,Humans,Prediabetic State/*diagnosis/epidemiology/physiopathology,Risk Factors},
   month = {11},
   pages = {579-581},
   pmid = {25579136},
   publisher = {Medknow Publications \& Media Pvt Ltd},
   title = {Know the signs and symptoms of diabetes},
   volume = {140},
   url = {https://pubmed.ncbi.nlm.nih.gov/25579136},
   year = {2014},
}
\end{filecontents}


\begin{document}

\nocite{*}

\bibliographystyle{agsm} % Harvard style
\bibliography{\jobname}

\end{document}

答案2

似乎bibtex不喜欢仅由空格分隔的多个 URL。一个有效的快速修复方法是用 替换此空格~。但是,行会变得非常宽,并且不遵守边距。也可能是仅由 强制换行\\

@article{Tabish2007,
   author = {Syed Amin Tabish},
   issn = {1658-3639},
   issue = {2},
   journal = {International journal of health sciences},
   month = {7},
   pages = {V-VIII},
   pmid = {21475425},
   publisher = {Qassim University, Kingdom of Saudi Arabia},
   title = {Is Diabetes Becoming the Biggest Epidemic of the Twenty-first Century?},
   volume = {1},
   url = {https://pubmed.ncbi.nlm.nih.gov/21475425,\\https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3068646/},
   year = {2007},
}

@article{Ramachandran2014,
   author = {A Ramachandran},
   issn = {0971-5916},
   issue = {5},
   journal = {The Indian journal of medical research},
   keywords = {*Physical Examination,Diabetes Mellitus/diagnosis/*epidemiology/physiopathology,Humans,Prediabetic State/*diagnosis/epidemiology/physiopathology,Risk Factors},
   month = {11},
   pages = {579-581},
   pmid = {25579136},
   publisher = {Medknow Publications & Media Pvt Ltd},
   title = {Know the signs and symptoms of diabetes},
   volume = {140},
   url = {https://pubmed.ncbi.nlm.nih.gov/25579136,\\https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4311308/},
   year = {2014},
}

相关内容