考慮下面的 MWE。產生的參考書目在網站名稱後面顯示一個惱人的逗號。有什麼辦法可以修復它(但保留unsrtnat所有其他類型(如文章)的樣式)?
\documentclass{scrartcl}
\usepackage{filecontents}
\usepackage[square,numbers]{natbib}
\bibliographystyle{unsrtnat}
\usepackage[english]{babel}
\usepackage{url}
\begin{filecontents}{\jobname.bib}
@Other{some-web,
Title = {A Website},
url = {https://en.wikipedia.org/wiki/Main_Page},
Note = {Last visited: 15.03.2014},
}
@Other{some-web2,
Title = {Another Website},
url = {https://en.wikipedia.org/wiki/Main_Page},
Note = {Last visited: 15.03.2014},
}
\end{filecontents}
\begin{document}
\section{first section}
some content \cite{some-web,some-web2}
\newpage
\section{Bibliography}
\bibliography{\jobname}
\end{document}
答案1
逗號位於 之前year
。 (當您運行bibtex
該文件時,您會收到有關“空年”的警告。)
的文檔natbib
似乎表明(在“2.7 Authorless and Yearless References”中)應該忽略它,但似乎它不適用於所有樣式。
我會使用 Biblatex 來很好地處理缺少的字段(運行biber
而不是bibtex
):
\documentclass{scrartcl}
\usepackage{filecontents}
\usepackage[style=numeric-comp]{biblatex}
\addbibresource{\jobname.bib}
\usepackage[english]{babel}
\usepackage{url}
\begin{filecontents}{\jobname.bib}
@online{some-web,
Title = {A Website},
url = {https://en.wikipedia.org/wiki/Main_Page},
urldate = {2014-03-15},
}
@online{some-web2,
Title = {Another Website},
url = {https://en.wikipedia.org/wiki/Main_Page},
urldate = {2014-03-15},
}
\end{filecontents}
\begin{document}
\section{first section}
some content \cite{some-web,some-web2}
\newpage
\printbibliography[title=Bibliography]
\end{document}