biblatex 中 Article 和 InProceedings 的 Articleno

biblatex 中 Article 和 InProceedings 的 Articleno

如同这里我想补充articleno一下articleinproceedings

当我添加

    \DeclareDatamodelEntryfields[inproceedings]{articleno}

articleno.dbx文章编号没有出现在输出中。还需要做什么?

答案1

inproceedings不使用note+pages被修改的bibmacro上一个答案。但可以用同样的方式chapter+pages调整宏:

\documentclass{article}
\usepackage[backend=biber,style=authoryear,datamodel=articleno]{biblatex}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@article{mooney,
  author    = {Mooney, Carl H. and Roddick, John F.},
  title     = {Sequential Pattern Mining -- Approaches and Algorithms},
  journal   = {ACM Comput. Surv.},
  volume    = {45},
  number    = {2},
  date      = {2013-03},
  pages     = {19:1--19:39},
  articleno = {19},
  pagetotal = {39},
  doi       = {10.1145/2431211.2431218},
}

@inproceedings{mooneyy,
  author    = {Mooney, Carl H. and Roddick, John F.},
  title     = {Sequential Pattern Mining -- Approaches and Algorithms},
  journal   = {ACM Comput. Surv.},
  volume    = {45},
  number    = {2},
  date      = {2013-03},
  pages     = {19:1--19:39},
  articleno = {19},
  pagetotal = {39},
  doi       = {10.1145/2431211.2431218},
}
\end{filecontents*}

\begin{filecontents*}{articleno.dbx}
\ProvidesFile{articleno.dbx}

\DeclareDatamodelFields[type=field,datatype=integer]{articleno}
\DeclareDatamodelEntryfields[article]{articleno}
\DeclareDatamodelEntryfields[inproceedings]{articleno}
\end{filecontents*}

\NewBibliographyString{artno}
\DefineBibliographyStrings{english}{artno = {Art\adddotspace No\adddot}}

\DeclareFieldFormat{articleno}{\bibstring{artno}\addabbrvspace #1}

\renewbibmacro*{note+pages}{%
  \printfield{note}%
  \setunit{\bibpagespunct}%
  \printfield{articleno}
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \newunit}

\renewbibmacro*{chapter+pages}{%
  \printfield{chapter}%
  \setunit{\bibpagespunct}%
  \printfield{articleno}
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \newunit}  

\addbibresource{\jobname.bib}

\begin{document}
  \cite{mooney} \cite{mooneyy}
  \printbibliography
\end{document}

相关内容