biblatex
我刚刚从 BibTeX迁移到。我正在使用该mcite
选项来合并一些参考文献。我还使用backref
选项进行反向页面查找。我在常规参考文献上正确显示了“(cit on p #)”。
但是,mcite
参考文献没有括号,只有“引用第 1 页,第 2 页”。
如何才能让括号在两种情况下都显示出来?
以下是我剩余的包裹:
\usepackage[
backend=biber,
style=phys,articletitle=true,
biblabel=brackets,
pageranges=false,
autocite = superscript,
mcite = true,
natbib = true,
subentry = true,
hyperref=auto,
backref=true,
sortsets=true,
% doi=true
]{biblatex}
答案1
与其他条目之间的反向引用明显不一致,@set
至少从 1.7 版开始就存在,biblatex
并且不仅限于biblatex-phys
。所有标准样式和我认为许多自定义样式的行为都类似。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[
backend=biber,
style=phys,
subentry = true,
backref=true,
sortsets=true,
]{biblatex}
\addbibresource{biblatex-examples.bib}
\makeatletter
% change punctuation before the backref part
% from phys.bbx
\DeclareBibliographyDriver{set}{%
\entryset
{%
\ifbool{bbx:subentry}
{\printfield[bibentrysetcount]{entrysetcount}%
\setunit*{\addnbspace}}
{}%
}
{%
\ifdef{\bbx@set@journal}
{}
{\savefield{journaltitle}{\bbx@set@journal}}%
\ifdef{\bbx@set@namehash}
{}
{\savefield{namehash}{\bbx@set@namehash}}%
}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{setpageref}%
\finentry
\global\undef\bbx@set@namehash
\global\undef\bbx@set@journal
}
\makeatother
% we just added the "[parens]" in line 4, the rest is verbatim from biblatex.def
\renewbibmacro*{setpageref}{%
\iflistundef{pageref}
{}
{\printtext[parens]{%
\ifnumgreater{\value{pageref}}{1}
{\bibstring{backrefpages}\ppspace}
{\bibstring{backrefpage}\ppspace}%
\printlist[pageref][-\value{listtotal}]{pageref}}}}
\begin{document}
\cite{sigfridsson,stdmodel}
\printbibliography
\end{document}