Including arxiv refs in papers

Post Reply
Antony Lewis
Posts: 1936
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Including arxiv refs in papers

Post by Antony Lewis » July 21 2005

Modified BibTex files for including arxiv eprint references in most paper styles are available at

http://arxiv.org/hypertex/bibstyles/

Just include the eprint option in your bibtex file, and it will appear in your paper citation after the paper reference. RevTex4 (Phys Rev) also has built in support for this. Much easier to use than doing a reverse arxiv search from the reference!

(For those that don't know, you can get pre-formatted BibTex entries automatically from the arxiv: on the paper abstract page click "SLAC-SPIRES HEP", then click "BibTex"- which includes the arxiv reference)

Antony Lewis
Posts: 1936
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Including arxiv refs in papers

Post by Antony Lewis » March 30 2006

The email service described at

http://www.slac.stanford.edu/spires/hep ... btex.shtml

has now been repaired, and works well for automatically updating SPIRES bibtex reference files as papers become published. E.g. sending

Code: Select all

@Article{Lewis:2005tp,
     author    = "Lewis, Antony",
     title     = "Lensed CMB simulation and parameter estimation",
     eprint    = "astro-ph/0502469",
     SLACcitation  = "%%CITATION = ASTRO-PH 0502469;%%"
}
would return

Code: Select all

@Article{Lewis:2005tp,
     author    = "Lewis, Antony",
     title     = "Lensed CMB simulation and parameter estimation",

     journal   = "Phys. Rev.",
     volume    = "D71",
     year      = "2005",
     pages     = "083008",
     eprint    = "astro-ph/0502469",
     SLACcitation  = "%%CITATION = ASTRO-PH 0502469;%%",
}

(you can include as many references as you like and they will all be automatically updated)

Oliver Zahn
Posts: 9
Joined: March 10 2005
Affiliation: Berkeley Center for Cosmological Physics

Including arxiv refs in papers

Post by Oliver Zahn » April 02 2006

Has anybody figured out by any chance how to make eprint numbers appear in the bibliography when using emulateapj? Thanks.

Antony Lewis
Posts: 1936
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Including arxiv refs in papers

Post by Antony Lewis » April 10 2006

Here are modified bibtex style files:
[q]
apj: http://cosmologist.info/utils/apj_hyperref.bst
elsevier: http://cosmologist.info/utils/h-elsevier-hyperref.bst
[/q]
To use them include the following in your tex file (for apj):

Code: Select all

\usepackage{hyperref}
\bibliographystyle{apj_hyperref}
\newcommand{\eprint}[1]{\href{http://arxiv.org/abs/#1}{#1}}
\newcommand{\ISBN}[1]{\href{http://cosmologist.info/ISBN/#1}{ISBN: #1}}
\newcommand{\adsurl}[1]{\href{#1}{ADS}}
\providecommand{\url}[1]{\href{#1}{#1}}
\providecommand{\newblock}{}
This includes arXiv references after the paper info, and PDF (and dvi) files will be hyperlinked directly to the relevant arXiv (or ADS) web pages. An example using elsevier is astro-ph/0601594.

Note that to see hyperlinks in postscript you need to use dvips -z (not all postscript viewers support hyperlinks).

Antony Lewis
Posts: 1936
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Including arxiv refs in papers

Post by Antony Lewis » April 14 2006

There's also now a bst file for MNRAS:

http://cosmologist.info/utils/mn2e_eprint.bst

This also automatically converts SPIRES 'Astrophys. J.' to ApJ, and similarly for MNRAS, AJ, A&A and ApJS. Works the same way as in previous post.

Boud Roukema
Posts: 87
Joined: February 24 2005
Affiliation: Institute of Astronomy, Nicolaus Copernicus University
Contact:

A&A; nat2jour.pl needs to handle bibtex broken long line

Post by Boud Roukema » April 14 2006

(1) A&A

Previously i've been using a script which does:
latex
bibtex
nat2aa.pl (a slight variation on nat2jour.pl, which fixes a few trivial things like maximum no of authors etc.)
latex
latex
dvips

and using a copy of apj.bst with a one-line hack in this part, choosing "oldname" instead of "---"

Code: Select all

STRINGS {oldname}

FUNCTION {name.or.dash}
{ 's :=
   oldname empty$
     { s 'oldname := s }
     { s oldname =
         { oldname }
         { s 'oldname := s }
       if$
     }
   if$
}
IMHO the same should work for apj_hyperref.bst - it seems to work for me.

(2) nat2jour.pl needs to handle bibtex broken long lines

bibtex cuts lines longer than 79 characters, putting %\\n at the break, so that other programs can glue the pieces back together later on.

nat2jour.pl 2004/10/06 glues all lines back together, but does not remove these % signs. Since latex considers % as a comment, this causes a problem for long URLs like from the ADS urls (in principle, \\url and \\href know about % or _ in urls).

In any case, the hack to nat2jour is just one line:

Code: Select all

$item =~ s/%\n//g;
or with context:

Code: Select all

@@ -182,6 +182,9 @@
     $item =~ s/([0-9]+)\+\n/$1\n/g;           # AA replace +\n with \n # OK :)
 #    $item =~ s/\{pages[^\+}]\}\+}/\1}/g;          # failed test
 #    $item =~ s/Untangling/Tangunling/g;           # test that script functions
+
+#   14 April 2006 Boud Roukema
+    $item =~ s/%\n//g;                                  # paste together broken lines
 #
     $item =~ s/\n//g;                                  # remove newlines
     $item =~ s/\{\\natexlab\{(.*?)\}\}/\1/g;           # remove \natexlab's

Boud Roukema
Posts: 87
Joined: February 24 2005
Affiliation: Institute of Astronomy, Nicolaus Copernicus University
Contact:

nat2jour.pl

Post by Boud Roukema » April 14 2006

nat2jour.pl is here:

http://ads.harvard.edu/pubs/bibtex/astronat/nat2jour.pl

and it doesn't seem to have been updated (since 26-Apr-2000 03:37) to handle internal hyperrefs :(

Antony Lewis
Posts: 1936
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: nat2jour.pl

Post by Antony Lewis » July 14 2007

To use the above method of hyperlinking arxiv references with the new arxiv numbering scheme, you need to change the definition of \eprint to something like

Code: Select all

\usepackage{ifthen}

\def\eprinttmp@#1arXiv:#2 [#3]#4@{
\ifthenelse{\equal{#3}{x}}{\href{http://arxiv.org/abs/#1}{#1}
}{\href{http://arxiv.org/abs/#2}{arXiv:#2} [#3]}}

\renewcommand{\eprint}[1]{\eprinttmp@#1arXiv: [x]@}
(yup, I couldn't see a neat way to do it with just latex...)

This will work with bibtex entries of the form

Code: Select all

  eprint    = "arXiv:0706.0849 [astro-ph]"
as well as the old form

Code: Select all

   eprint    = "astro-ph/0611862"

Antony Lewis
Posts: 1936
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: nat2jour.pl

Post by Antony Lewis » July 29 2008

ADS and SPIREs keep changing the format of their arXiv eprint entries... here's a version of the revtex4 style file that should link them all correctly

http://cosmologist.info/utils/arxiv.bst

To use just do

Code: Select all

\usepackage{natbib,hyperref,ifthen}
...
\bibliographystyle{arxiv}

Antony Lewis
Posts: 1936
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: nat2jour.pl

Post by Antony Lewis » May 28 2012

Now also bst for A&A at

http://cosmologist.info/utils/aa_arxiv.bst

(useful for people writing Planck papers).

Code: Select all

\usepackage{natbib,hyperref,ifthen} 
...
\bibliographystyle{aa_arxiv}

Post Reply