我使用 Bibtex 和 Biber 来设置我的参考书目。我已配置字母样式。因此,正常的 \cite{} 将显示为 [XXX00],并带有作者和年份。存在的问题:我有在线网站作为来源,其中很多网站没有作者或年份,因此它们将显示为 []。是否可以将字母样式与数字混合?因此,包含作者和年份的文章将按字母顺序显示,而其他所有文章将按数字顺序显示?
谢谢您的回答。
答案1
复制以下想法Biblatex:两种具有不同风格和排序的书目并使其适应按类型过滤(@online
)而不是keyword
我们得到
\documentclass{article}
\usepackage[style = alphabetic, labelnumber, defernumbers = true, backend = biber]{biblatex}
\usepackage{hyperref}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\renewbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printfield{labelprefix}%
\ifentrytype{online}
{\printfield{labelnumber}}
{\printfield{labelalpha}%
\printfield{extraalpha}}}}
\defbibenvironment{bibliographyNUM}
{\list
{\printtext[labelnumberwidth]{%
\printfield{labelprefix}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\begin{filecontents}{\jobname.bib}
@article{BookA03,
author = {Author Aaa},
title = {Some Title},
journal = {Some Journal},
year = 2003,
}
@BOOK{BookB02,
author = {Author Bbb},
title = {Some Title},
publisher = {Some Publisher},
year = 2002,
}
@online{LinkC04,
author = {Author Ccc},
title = {Some Title},
year = 2004,
url = {http://www.example.com/1},
}
@online{LinkD01,
author = {Author Ddd},
title = {Some Title},
year = 2001,
url = {http://www.example.com/2},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
The first two citations \cite{LinkD01} and \cite{BookB02}.
The others are \cite{LinkC04} and \cite{BookA03}.
\printbibliography[title=Bibliography, nottype=online]
\newrefcontext[sorting=none]
\printbibliography[env=bibliographyNUM, title={Online References}, type=online, resetnumbers]
\end{document}
答案2
我发现 @online{} 文章有选项标签。我可以用它来解决我的问题。