4

There seems to be some trouble where bibtex truncates 9 digit arXiv numbers to 8 digits on both preprint references and links. This generates the wrong reference number in addition to the wrong hyperlink. has anyone else had this trouble? What is the most transparent way to correct it?

  • 6
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Apr 21 '15 at 21:54
  • 7
    bibtex itself knows nothing at all about arXiv (or links). If there is an error in the bibtex style you are using it would help if you said what style that is (and include it here if it is a non-standard one). – David Carlisle Apr 21 '15 at 22:20
  • It would help if you stated which bibliography style you use and posted a sample entry containing arxiv-related information. – Mico Apr 21 '15 at 22:37
  • What bibliography style are you using? – Nathan Musoke Jan 23 '16 at 9:53
  • I had the same problem with the JHEP bibliography style. I don't know what style you're using, but it's probably a similar issue. From January 1st 2015, the identifiers have had another digit. This broke JHEP.bst in a strange way: when creating the bibliography entry, it would grab only the first 4 characters after the dot. Then when following the link the arXiv would add a 0 to the beginning, so that you see the page for a seemingly random article. – Nathan Musoke Jan 23 '16 at 10:01
5

I was having the same problem and solved it in the .bst file. In particular my JHEP.bst has a part where it says:

FUNCTION {format.eprint.newarXivid}
{ eprint #1 #6 substring$ "arXiv:" =
    {"\href{http://xxx.lanl.gov/abs/" eprint #7 #9 substring$ * "}" *
        "{{\tt " * eprint #7 #9 substring$ * "}}" *}
    {"\href{http://xxx.lanl.gov/abs/" eprint #1 #9 substring$  * "}" *
        "{{\tt arXiv:" * eprint #1 #9 substring$ * "}}" *}
  if$
}

By changing the four #9 to #10 the problem was solved.

FUNCTION {format.eprint.newarXivid}
{ eprint #1 #6 substring$ "arXiv:" =
    {"\href{http://xxx.lanl.gov/abs/" eprint #7 #10 substring$ * "}" *
        "{{\tt " * eprint #7 #10 substring$ * "}}" *}
    {"\href{http://xxx.lanl.gov/abs/" eprint #1 #10 substring$  * "}" *
        "{{\tt arXiv:" * eprint #1 #10 substring$ * "}}" *}
  if$
}

I assume that this was happening because new arXiv numbers have 9 digits but one more slot is needed for the dot in the middle.

| improve this answer | |
  • 1
    Note that xxx.lanl.gov has long been abandoned as the canonical URI for arXiv's eprints. This should (ideally) be updated to be arxiv.org/abs in this code sample. – Jake Apr 2 '18 at 18:47

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.