在这个问题,原发帖人询问如何pagetotal
使用 biblatex 让该字段出现在文章中,但我想让相同的字段@inproceedings
也显示在条目中,但我无法做到这一点。基于答案对于链接的问题,以下是我到目前为止尝试过的方法(但没有效果):
\documentclass{article}
\usepackage[style=authoryear, backend=biber]{biblatex}
\usepackage{filecontents}
\usepackage{hyperref}
\begin{filecontents*}{\jobname.bib}
@inproceedings{BarPalNumEst,
author = {Hilary C. Barth and Annie M. Paladino},
title = {The development of numerical estimation},
subtitle = {Evidence against a representational shift},
journal = {Developmental Science},
volume = {14},
number = {1},
date = {2011-01},
doi = {10.1111/j.1467-7687.2010.00962.x},
gender = {pf},
pagetotal = {11},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\DeclareFieldFormat[inproceedings]{pagetotal}{\mkpagetotal[pagination]{#1}}
\renewbibmacro*{note+pages}{%
\printfield{note}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\setunit{\bibpagespunct}%
\printfield{pagetotal}%
\newunit}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
因为inproceedings
相关宏chapter+pages
不是note+pages
。您需要查看standard.bbx
才能发现这一点。通过此更改,解决方案有效。
\documentclass{article}
\usepackage[style=authoryear, backend=biber]{biblatex}
\usepackage{filecontents}
\usepackage{hyperref}
\begin{filecontents*}{\jobname.bib}
@inproceedings{BarPalNumEst,
author = {Hilary C. Barth and Annie M. Paladino},
title = {The development of numerical estimation},
subtitle = {Evidence against a representational shift},
journal = {Developmental Science},
volume = {14},
number = {1},
date = {2011-01},
doi = {10.1111/j.1467-7687.2010.00962.x},
gender = {pf},
pagetotal = {11},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\DeclareFieldFormat[inproceedings]{pagetotal}{\mkpagetotal[bookpagination]{#1}}
\renewbibmacro*{chapter+pages}{%
\printfield{note}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\setunit{\bibpagespunct}%
\printfield{pagetotal}%
\newunit}
\begin{document}
\nocite{*}
\printbibliography
\end{document}