0

I'm currently writing a thesis using latex and bibtex and want to cite some arXiv articles with a bibtex entry like

@article{attention,
  author    = {Dzmitry Bahdanau and
               Kyunghyun Cho and
               Yoshua Bengio},
  title     = {Neural Machine Translation by Jointly Learning to Align and Translate},
  journal   = {arXiv preprint arXiv:1409.0473},
  year      = {2014}
}

When citing this entry, the resulting output is [Bahdanau & Cho + 14] D. Bahdanau, K. Cho, Y. Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, Vol., 2014.

which has an empty Volume entry. How can I suppress this volume entry for arXiv? I think, one solution might be to change the .bst file, which I got as part of a template for my thesis. Here is a part of the bst file, which I think might be relevant:

FUNCTION {format.vol.num.pages}
{ "Vol." volume tie.or.space.connect % field.or.null
  number empty$
    'skip$
    { ", No." number tie.or.space.connect *
      volume empty$
        { "there's a number but no volume in " cite$ * warning$ }
        'skip$
      if$
    }
  if$
  pages empty$
    'skip$
    { duplicate$ empty$
        { pop$ format.pages }
        { ", pp.~" * pages n.dashify * }
      if$
    }
  if$
}

Unfortunately, I don't know, how the .bst files work. To be clear, I do not want to remove all Volume entries, but only in the case, that the entry is missing I want nothing to appear, instead of an empty Vol.

  • Can you try to remove the Journal from the bib entry and add the field archivePrefix = "arXiv", eprint = {1409.0473},? Otherwise please post a compilable minimal working example with bibliography (MWEB) – user36296 Sep 19 '16 at 13:55
  • And welcome to TeX.SX!. I hope the cat is alive! – user36296 Sep 19 '16 at 13:57
  • 1
    As @samcarter says, it is better to use archivePrefix = "arXiv", eprint = {1409.0473} because then, with a bit of extra work, you can add hyperlinks to the arxiv. You don't say what bst file you are trying to edit, but the function that you want to change is almost certainly format.vol.num.pages (look for Vol.). Assuming so, if you paste it above I can tell you tomorrow how to change it. – Andrew Sep 19 '16 at 14:11
  • archivePrefix and eprint unfortunately don't work for me, probably, because my .bst file does not support it. I updated the code from the .bst file, which now shows the format.vol.num.pages function. – Heisenberg Sep 19 '16 at 14:30
1

I now found the solution with the help of Andrew's comment and some trial and error. I changed the code of the format.vol.num.pages to handle the case of a missing volume entry:

FUNCTION {format.vol.num.pages}
{ volume empty$
    'skip$
    {  "Vol." volume tie.or.space.connect }% field.or.null
  if$
  number empty$
    'skip$
    { ", No." number tie.or.space.connect *
      volume empty$
        { "there's a number but no volume in " cite$ * warning$ }
        'skip$
      if$
    }
  if$
  pages empty$
    'skip$
    { duplicate$ empty$
        { pop$ format.pages }
        { ", pp.~" * pages n.dashify * }
      if$
    }
  if$
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.