我正在写一份申请,他们希望我将自己的相关论文放在文档的某个位置,不带编号,然后在另一个位置放上正常的参考书目。我查看了这里关于多个参考书目的旧答案,并或多或少地让它起作用了。但有一件事让我失望,现在所有在我自己的相关论文部分之后引用的论文都会得到一个标记 [0]。不过,它们仍然会以正常编号出现在参考书目中。
我的最小工作示例是
\documentclass[11pt]{article}
\usepackage[pdfauthor="Me",pdftitle="generic title",breaklinks=true]{hyperref}
\usepackage[sorting=none,giveninits=true, uniquename=init,doi=false,isbn=false,backend=biber,defernumbers=true]{biblatex}
\begin{filecontents}{mythings.bib}
@MISC{me,
author = {Me Myself},
title = {Some Title},
year = 2001
}
\end{filecontents}
\begin{filecontents}{otherthings.bib}
@MISC{se1,
author = {Someone Else},
title = {Some Title},
year = 1001
}
@MISC{se2,
author = {Someone Else},
title = {Some Title II- this is different},
year = 1001
}
@MISC{se3,
author = {Someone Else},
title = {Some Title III},
year = 1001
}
\end{filecontents}
\defbibenvironment{mypubs}
{\list
{$\bullet$}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endlist}
{\item}
\def\printbib#1{
\newrefcontext[sorting=none]
\printbibliography[category=#1,heading=#1,omitnumbers=false]}
\def\printPRbib#1{
\newrefcontext[sorting=ynt]
\printbibliography[env=mypubs,category=#1,heading=#1,omitnumbers=true]}
\renewcommand{\bibfont}{\normalfont\fontsize{11}{13.4}\sffamily}
\def\makebibsubsubsec#1#2{\DeclareBibliographyCategory{#1}\defbibheading{#1}{\subsubsection{#2}}}
\def\makebibsubsec#1#2{\DeclareBibliographyCategory{#1}\defbibheading{#1}{\subsection{#2}}}
\makebibsubsubsec{prpub}{Articles}
\makebibsubsec{published}{Articles }
\makebibsubsec{other}{Other publications}
\addbibresource{mythings.bib}
\addbibresource{otherthings.bib}
\addtocategory{other}{se2}
\addtocategory{published}{se1,se3}
\addtocategory{prpub}{me}
\nocite{me}
\begin{document}
Test \cite{se2} and another \cite{se3}
\printPRbib{prpub}
And now somemore text and another citation~\cite{se1}
\printbib{published}
\printbib{other}
\end{document}
我正在使用 biber 2.4 和 biblatex 版本 3.4
答案1
使用当前的biblatex
3.11,Biber 2.11 我得到
来自你的 MWE。所以这肯定是 3.4 版的一个错误biblatex
现在已经修复了。我敢打赌https://github.com/plk/biblatex/issues/396暂时如此,但我还不能确定。
正如评论中所建议的,您应该考虑使用refcontext
环境来发布您自己的出版物。这样您就不会影响文档中的其他参考资料 - 您不需要\newrefcontext[sorting=none]
。
以下 MWE(用\newcommand
代替\def
)应该有效
\documentclass[11pt]{article}
\usepackage[pdfauthor="Me",pdftitle="generic title",breaklinks=true]{hyperref}
\usepackage[sorting=none,giveninits=true, uniquename=init,doi=false,isbn=false,backend=biber,defernumbers=true]{biblatex}
\begin{filecontents}{mythings.bib}
@MISC{me,
author = {Me Myself},
title = {Some Title},
year = 2001
}
\end{filecontents}
\begin{filecontents}{otherthings.bib}
@MISC{se1,
author = {Someone Else},
title = {Some Title},
year = 1001
}
@MISC{se2,
author = {Someone Else},
title = {Some Title II- this is different},
year = 1001
}
@MISC{se3,
author = {Someone Else},
title = {Some Title III},
year = 1001
}
\end{filecontents}
\defbibenvironment{mypubs}
{\list
{$\bullet$}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endlist}
{\item}
\newcommand*{\printbib}[1]{%
\printbibliography[category=#1,heading=#1,omitnumbers=false]}
\newcommand*{\printPRbib}[1]{%
\begin{refcontext}[sorting=ynt]
\printbibliography[env=mypubs,category=#1,heading=#1,omitnumbers=true]
\end{refcontext}}
\newcommand*{\makebibsubsubsec}[2]{%
\DeclareBibliographyCategory{#1}%
\defbibheading{#1}{\subsubsection{#2}}}
\newcommand*{\makebibsubsec}[2]{%
\DeclareBibliographyCategory{#1}%
\defbibheading{#1}{\subsection{#2}}}
\makebibsubsubsec{prpub}{Articles}
\makebibsubsec{published}{Articles}
\makebibsubsec{other}{Other publications}
\addbibresource{mythings.bib}
\addbibresource{otherthings.bib}
\addtocategory{other}{se2}
\addtocategory{published}{se1,se3}
\addtocategory{prpub}{me}
\nocite{me}
\begin{document}
Test \cite{se2} and another \cite{se3}
\printPRbib{prpub}
And now somemore text and another citation~\cite{se1}
\printbib{published}
\printbib{other}
\end{document}