5

Similar to here I would like to add articleno to article and inproceedings.

When I add

    \DeclareDatamodelEntryfields[inproceedings]{articleno}

to articleno.dbx the article number does not appear in the output. What else needs to be done?

1 Answer 1

3

inproceedings does not use the bibmacro note+pages which was modified by the previous answer. But in the same manner the chapter+pages macro can be adjusted:

\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .