我目前正在尝试更改我的互联网书目的排序类型,使其不按字母顺序排序,而是按引用顺序排序。我已经尝试过这两个选项,但没有成功:
\printbibliography[sorting=none, env=onlinebib, type=online, heading=bibintoc, title={Internet Sources}, resetnumbers]
和
\newrefcontext[sorting=none]
\printbibliography[env=onlinebib, type=online, heading=bibintoc, title={Internet Sources}, resetnumbers]
我的代码如下所示:
\documentclass{article}
\usepackage[sorting=nyt,style=authoryear, backend=bibtex8, defernumbers]{biblatex}
\ExecuteBibliographyOptions{labelnumber}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
% bib environment for numeric citations (@online) from numeric.bbx
\defbibenvironment{onlinebib}
{\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}
% taken from numeric.cbx
\providebool{bbx:subentry}
\newbibmacro*{cite:num}{%
\printtext[bibhyperref]{%
\printfield{labelprefix}%
\printfield{labelnumber}%
\ifbool{bbx:subentry}
{\printfield{entrysetcount}}
{}}}
% switch citation style based on entry type
\DeclareCiteCommand{\parencite}
{\ifentrytype{online}{\bibopenbracket}{\bibopenparen}%
\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\ifentrytype{online}{\usebibmacro{cite:num}}{\usebibmacro{cite}}}
{\multicitedelim}
{\usebibmacro{postnote}%
\ifentrytype{online}{\bibclosebracket}{\bibcloseparen}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{Wikipedia.27.02.2017,
author = {Wikipedia, the free encyclopedia},
year = {2017},
title = {MALDI-TOF},
url = {https://de.wikipedia.org/wiki/MALDI-TOF},
urldate = {2017-06-02},
}
@article{Rouhiainen.2004,
author = {Rouhiainen, Leo and Vakkilainen, Tanja and Siemer, Berit Lumbye and Buikema, William and Haselkorn, Robert and Sivonen, Kaarina},
year = {2004},
title = {Genes coding for hepatotoxic heptapeptides (microcystins) in the cyanobacterium Anabaena strain 90},
pages = {686--692},
volume = {70},
number = {2},
issn = {0099-2240},
journal = {Applied and environmental microbiology},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
\parencite{Rouhiainen.2004} \parencite{Wikipedia.27.02.2017} \parencite{sigfridsson} \parencite{worman} \parencite{ctan} \parencite{baez/online}
\printbibliography[nottype=online, heading=bibintoc, title={Literature}]
\printbibliography[env=onlinebib, type=online, heading=bibintoc, title={Internet Sources}, resetnumbers]
\end{document}
答案1
此解决方案需要 Biber。
无法sorting
再传递给\printbibliography
。您将需要使用refcontext
。将在线围兜包装在 中\begin{refcontext}[sorting=none]...\end{refcontext}
。
\printbibliography[nottype=online, heading=bibintoc, title={Literature}]
\begin{refcontext}[sorting=none]
\printbibliography[env=onlinebib, type=online, heading=bibintoc, title={Internet Sources}, resetnumbers]
\end{refcontext}
引用将自动选取正确的上下文。
一般来说,biblatex
不允许我们使用不同的方案对不同的条目类型进行排序;但是正如您之前的问题一样,有时可以解决这个问题。