我在参考书目中的 URL 链接后看到一个逗号,我想将其删除,因为它不属于那里。
我怎样才能从参考书目中删除逗号?
tex 文件:
\documentclass[
11pt,
english,
twoside,
a4paper,
headsepline,
footsepline
]{scrbook}
\usepackage{a4}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[numbers]{natbib}
\usepackage[hyphens]{url}
\usepackage{color}
\usepackage[bookmarks=true,
bookmarksopen=true,
bookmarksnumbered=true,
colorlinks=true,
citecolor=black,
linkcolor=black
]
{hyperref}
\begin{document}
Mowing down trees, flooding streets and battering buildings, Patricia hit land as a Category 5 hurricane on Friday \cite{wazeText} evening before grinding inland. It moved quickly but lost power in the mountains that rise up along the Pacific coast and was downgraded to a tropical depression on Saturday morning as it headed through central \cite{restRoy} Mexico \cite{jdkWiki}.
\bibliographystyle{unsrtnat}
\bibliography{bibliography}
\end{document}
参考书目
@misc{wazeText,
author = {Wikipedia},
title = {Waze},
howpublished = {\url{https://en.wikipedia.org/wiki/Waze}},
note = {Accessed: 06.11.2015}
}
@misc{restRoy,
author = {Wikipedia},
title = {{Representational state transfer}},
howpublished = {\url{https://en.wikipedia.org/wiki/Representational_state_transfer}},
note = {Accessed: 07.11.2015}
}
@misc{jdkWiki,
author = {Wikipedia},
title = {{Java Development Kit}},
howpublished = {\url{https://en.wikipedia.org/wiki/Java_Development_Kit}},
note = {Accessed: 06.11.2015}
}
@misc{waze,
author = {androidcommunity},
title = {Waze traffic app updates with {Foursquare} and {Yelp} integration},
howpublished = {\url{http://androidcommunity.com/waze-traffic-app-updates-with-foursquare-and-yelp-integration-20120131/}},
note = {Accessed: 29.09.2015}
}
答案1
您看到了 bib 条目中缺少年份的警告吗?添加它们后,一切就都按您的意愿进行了。您可以使用url
而不是howpublished
。
请参阅 mwe:
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{wazeText,
author = {Wikipedia},
title = {Waze},
year = {2015},
url = {https://en.wikipedia.org/wiki/Waze},
note = {Accessed: 06.11.2015},
}
@misc{restRoy,
author = {Wikipedia},
title = {{Representational state transfer}},
howpublished = {\url{https://en.wikipedia.org/wiki/Representational_state_transfer}},
year = {2015},
note = {Accessed: 07.11.2015},
}
@misc{jdkWiki,
author = {Wikipedia},
title = {{Java Development Kit}},
howpublished = {\url{https://en.wikipedia.org/wiki/Java_Development_Kit}},
note = {Accessed: 06.11.2015},
}
\end{filecontents*}
\documentclass[%
11pt,
english,
twoside,
a4paper,
headsepline,
footsepline
]{scrbook}
%\usepackage{a4}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[numbers]{natbib}
\usepackage[hyphens]{url}
\usepackage{color}
\usepackage[%
bookmarks=true,
bookmarksopen=true,
bookmarksnumbered=true,
colorlinks=true,
citecolor=black,
linkcolor=black
]{hyperref}
\begin{document}
Mowing down trees, flooding streets and battering buildings, Patricia hit land as a Category 5 hurricane on Friday \cite{wazeText} evening before grinding inland. It moved quickly but lost power in the mountains that rise up along the Pacific coast and was downgraded to a tropical depression on Saturday morning as it headed through central \cite{restRoy} Mexico \cite{jdkWiki}.
\bibliographystyle{unsrtnat}
\bibliography{\jobname}
\end{document}
结果: