9

Does biblatex have an articleno field or equivalent? In addition, can I use article number in page ranges? The problematic article in questions has the following:

pages = {19:1--19:39},
articleno = {19},

and can be found here: http://dl.acm.org/citation.cfm?id=2431218

  • 1
    You could perhaps use the note field. – Bernard Aug 01 '14 at 20:49
  • As of now, http://dl.acm.org/citation.cfm?id=2431218 is redirected to https://dl.acm.org/doi/10.1145/2431211.2431218, and this DOESN'T show pages = {19:1--19:39}, articleno = {19} when clicking on he citation button. Instead, we see articleno = {19}, numpages = {39}. –  Feb 23 '23 at 19:16

1 Answers1

11

Updated answer

The field for these sort of jobs in the biblatex standard data model is called eid. (Up to and including version 3.14 of biblatex the field is only available for @articles, but from v3.15 onwards it will be supported by all types where it makes sense, see https://github.com/plk/biblatex/pull/1000).

If you don't like the default output, you can modify it to show "Art. No.".

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

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

\DeclareFieldFormat[article,periodical]{eid}{\bibstring{artno}\addabbrvspace #1}

\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},
  eid       = {19},
  pagetotal = {39},
  doi       = {10.1145/2431211.2431218},
}
\end{filecontents*}

\addbibresource{\jobname.bib}

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

Old answer

If for some reason you don't want to use eid you can define a new articleno field. This is done in a separate .dbx file called articleno.dbx (in the MWE it is created via filecontents)

\ProvidesFile{articleno.dbx}

\DeclareDatamodelFields[type=field,datatype=integer]{articleno}
\DeclareDatamodelEntryfields[article]{articleno}

We can also define a new bibstring to be printed before the article number

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

The articleno field is introduced by this new string

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

We then redefine the note+pages macro to also print the articleno field

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

MWE

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

\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},
}
\end{filecontents*}

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

\DeclareDatamodelFields[type=field,datatype=integer]{articleno}
\DeclareDatamodelEntryfields[article]{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}

\addbibresource{\jobname.bib}

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

enter image description here

moewe
  • 175,683
  • I'm trying to do the same for an @inproceedings bib entry. There above MWE doesn't work. I'm suspecting it's due to note+pages. Do you have any suggestion for this problem? – m8mble Jul 21 '18 at 15:51
  • 1
    @m8mble For @inproceedings you want to modify chapter+pages instead of note+pages. If that does not help you, please consider asking a new question. – moewe Jul 21 '18 at 15:55
  • Works like a charm. Highly appreciated! – m8mble Jul 21 '18 at 16:01
  • Is there any way to do this using bibtex as a backend instead of biber? Biber is causing a lot of problems with incorrect first/last name detection for me, so I had to switch to bibtex, but I also have citations with articleno... – Ralf Jung Jun 06 '20 at 11:48
  • @RalfJung There is no officially supported way to extend the standard data model with arbitrary field with BibTeX as backend. But actually, there already is a field like articleno, it is called eid. So maybe that helps you (see the edit). In any case I recommend you look into getting Biber to work for you. For most use cases it should be painless to switch from BibTeX to Biber. If you want to ask a question about your Biber troubles, I will be happy to look at it. – moewe Jun 06 '20 at 13:59
  • Thanks, I'll look into eid, but I doubt texlive has a new enough biblatex (how do I see the version number?). However, the publisher is using "articleno" so I'd have to edit their BibTeX, see for example this paper. As for Biber, I'll try to minimize but the behavior was really strange and it took me hours to even figure out what was going on. I'll make a Biber bugreport and ping you. – Ralf Jung Jun 06 '20 at 18:05
  • 1
    @RalfJung For @articles eid has been around for a long time. The pull request I linked will just make it available for more entry types in the next version of biblatex (which isn't released yet). – moewe Jun 07 '20 at 10:33
  • As of now, https://dl.acm.org/doi/10.1145/2431211.2431218 doesn't have pages = {19:1--19:39}, articleno = {19}. I see articleno = {19}, numpages = {39} instead. Does it change your answer? –  Feb 21 '23 at 22:22
  • Moreover, the value of the pagetotal field doesn't show up. Write pagetotal = {100} instead of pagetotal = {39} and observe that 100 doesn't show up in the PDF produced. –  Feb 21 '23 at 22:47
  • @AlbertNash No, I don't think this change in ACM .bib export changes anything relevant for the answer. If you need pagetotal, have a look at https://tex.stackexchange.com/q/151752/35864. – moewe Feb 24 '23 at 16:13