我写了一篇双栏格式的文章,并使用 bibtex 制作了参考文献列表。我需要使用哈佛格式。URL 都乱了。我该如何修复?我看到一些帖子建议在 URL 中有连字符时将其断开。但我拥有的几乎所有 URL 中都没有连字符。很少有连字符,这些连字符会自动调整。编辑以添加 MWE:
\documentclass[twocolumn, 11pt]{article}
\usepackage{natbib}
\usepackage{hyperref}
\begin{filecontents}{\jobname.bib}
@article{example,
title = {Predicting the need for ICU admission in community-acquired pneumonia},
journal = {Respiratory Medicine},
volume = {155},
pages = {61-65},
year = {2019},
issn = {0954-6111},
doi = {https://doi.org/10.1016/j.rmed.2019.07.007},
url = {https://www.sciencedirect.com/science/article/pii/S0954611119302331},
author = {Alessandra Morello Gearhart and Stephen Furmanek and Connor English and Julio Ramirez and Rodrigo Cavallazzi}
}
}
\end{filecontents}
\begin{document}
\cite{example}
\bibliographystyle{agsm}
\bibliography{\jobname}
\end{document}
答案1
该natbib
包裹了解哈佛家族,并定义
\newcommand\harvardurl[1]{\textbf{URL:} \textit{#1}}
这当然会弄乱包所做的工作url
(而且hyperref
,因为它不创建链接)。然后,您应该重新定义此宏以正确使用\url
。我还会将参考书目输入得参差不齐,否则您一定会在两列布局中得到很多不完整的\hbox
内容。
\begin{filecontents}{\jobname.bib}
@article{example,
title = {Predicting the need for ICU admission in community-acquired pneumonia},
journal = {Respiratory Medicine},
volume = {155},
pages = {61-65},
year = {2019},
issn = {0954-6111},
doi = {https://doi.org/10.1016/j.rmed.2019.07.007},
url = {https://www.sciencedirect.com/science/article/pii/S0954611119302331},
author = {Alessandra Morello Gearhart and Stephen Furmanek and Connor English and Julio Ramirez and Rodrigo Cavallazzi}
}
}
\end{filecontents}
\documentclass[twocolumn, 11pt]{article}
\usepackage{natbib}
\renewcommand\harvardurl[1]{\textbf{URL:} \url{#1}}
\usepackage{hyperref}
\begin{document}
Text text \cite{example}.
\begingroup
\raggedright
\bibliographystyle{agsm}
\bibliography{\jobname}
\endgroup
\end{document}