timj / mn2e-bst

Monthly Notices of the Royal Astronomical Society bibtex style file
13 stars 5 forks source link

eprint field left out and not working for field other than arxiv? #12

Closed rokroskar closed 10 years ago

rokroskar commented 10 years ago

The eprint number isn't being added correctly somehow -- I have this .bib entry:

@ARTICLE{Koss:2014,
   author = {{Koss}, M. and {Blecha}, L. and {Mushotzky}, R. and {Hung}, C.~L. and 
    {Veilleux}, S. and {Trakhtenbrot}, B. and {Schawinski}, K. and 
    {Stern}, D. and {Smith}, N. and {Li}, Y. and {Man}, A. and {Filippenko}, A.~V. and 
    {Mauerhan}, J.~C. and {Stanek}, K. and {Sanders}, D.},
    title = "{SDSS1133: An Unusually Persistent Transient in a Nearby Dwarf Galaxy}",
  journal = {ArXiv e-prints},
archivePrefix = "arXiv",
   eprint = {1401.6798},
 primaryClass = "astro-ph.GA",
 keywords = {Astrophysics - Galaxy Astrophysics, Astrophysics - High Energy Astrophysical Phenomena},
     year = 2014,
    month = jan,
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

but using mn2e.bst I get in the .bbl file

\bibitem[\protect\citeauthoryear{{Koss} et~al.,}{{Koss}
  et~al.}{2014}]{Koss:2014}
{Koss} M.,  et~al., 2014, ArXiv e-prints

Is there smomething else I'm supposed to do (an option to turn on) to get the eprint number in the bibliography? On a related note, it seems that it doesn't work with non-arxiv eprints -- for example, the Astronomy Source Code Library bibtex fails:

@MISC{Pontzen:2013,
   author = {{Pontzen}, A. and {Roskar}, R. and {Stinson}, G. and {Woods}, R.
    },
   title = "{pynbody: N-Body/SPH analysis for python}",
   note = {Astrophysics Source Code Library},
   year = 2013,
   archivePrefix = "ascl",
   eprint = {1305.002},
   month = may,
   adsurl = {http://adsabs.harvard.edu/abs/2013ascl.soft05002P},
   adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

after running latex and bibtex and running latex the second time, it crashes with

! Extra \fi.
\mn@eprint@ ...c \@tempb \let \@tempb \@tempa \fi 
                                                  \ifx \@tempb \@empty \def ...
l.161 ...for python}, \mn@eprint {ascl} {1305.002}
nxg commented 10 years ago

@rokroskar The first is because the MN style doesn't display eprints or DOIs on published articles, by choice, so the .bst style respects this (no, I don't think that's particularly good, either, but ...).

Unfortunately, I can't reproduce the second problem.

I tried with try.tex

\documentclass{mn2e}
\usepackage{url,hyperref}
\begin{document}
Hello.
\cite{*}
\bibliographystyle{mn2e}
\bibliography{rokroskar}
\end{document}

and with rokroskar.bib as

@misc{Koss:2014,
   author = {{Koss}, M. and {Blecha}, L. and {Mushotzky}, R. and {Hung}, C.~L. and 
    {Veilleux}, S. and {Trakhtenbrot}, B. and {Schawinski}, K. and 
    {Stern}, D. and {Smith}, N. and {Li}, Y. and {Man}, A. and {Filippenko}, A.~V. and 
    {Mauerhan}, J.~C. and {Stanek}, K. and {Sanders}, D.},
    title = "{SDSS1133: An Unusually Persistent Transient in a Nearby Dwarf Galaxy}",
  journal = {ArXiv e-prints},
archivePrefix = "arXiv",
   eprint = {1401.6798},
 primaryClass = "astro-ph.GA",
 keywords = {Astrophysics - Galaxy Astrophysics, Astrophysics - High Energy Astrophysical Phenomena},
     year = 2014,
    month = jan,
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
@MISC{Pontzen:2013,
   author = {{Pontzen}, A. and {Roskar}, R. and {Stinson}, G. and {Woods}, R.
    },
   title = "{pynbody: N-Body/SPH analysis for python}",
   note = {Astrophysics Source Code Library},
   year = 2013,
   archivePrefix = "ascl",
   eprint = {1305.002},
   month = may,
   adsurl = {http://adsabs.harvard.edu/abs/2013ascl.soft05002P},
   adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

With that, pdflatex, bibtex, pdflatex, then pdflatex seemed to work fine. Do you have some minimal files which reproduce the problem?

rokroskar commented 10 years ago

aha, that would explain it (the first problem). I didn't realize that was the case.

re: second issue -- this is another version problem apparently. Your test file works on my mac with 0.99d but not with 0.99c. :/

timj commented 10 years ago

Leaving out the arXiv identifier when referencing an arXiv paper seems like the definition of madness.

rokroskar commented 10 years ago

agreed -- and those references don't show up on ADS either because ADS needs the identifier (afaik)...!

rokroskar commented 10 years ago

well actually, they do show up -- see e.g. the ref to Adibekyan in http://mnras.oxfordjournals.org/content/433/2/976.full.pdf -- it's even hyperlinked

nxg commented 10 years ago

@timj well: an arXiv preprint can be cited as 'misc' without difficulty. I can see MN's logic, but yes... it does seem a bit old-fogeyish.

@rokroskar wow: can you attach the .bbl file which 0.99c produces (I would not have expected this to be another bibtex problem). How about removing the \usepackage from the test file, and ignoring the 'undefined \href' error that results. If that changes things, then it might be a hyperref problem, I suppose.

rokroskar commented 10 years ago

tried that -- still gives an error similar to before:

Document Class: mn2e 2001/02/06 v2.2 LaTeX2e MN document class
Document Style `MN' v2.2, released 2001 February 20
) (./try.aux) (./try.bbl
! Extra \fi.
\mn@eprint@ ...c \@tempb \let \@tempb \@tempa \fi 
                                                  \ifx \@tempb \@empty \def ...
l.20 ...rf Galaxy}, \mn@eprint {arXiv} {1401.6798}

here's the bbl

\begin{thebibliography}{}
\makeatletter
\relax
\def\mn@urlcharsother{\let\do\@makeother \do\$\do\&\do\#\do\^\do\_\do\%\do\~}
\def\mn@doi{\begingroup\mn@urlcharsother\@ifnextchar[{\mn@doi@}{\mn@doi@[]}}
\def\mn@doi@[#1]#2{\def\@tempa{#1}\ifx\@tempa\@empty\href{http://dx.doi.org/#2%
}{doi:#2}\else\href{http://dx.doi.org/#2}{#1}\fi\endgroup}
\def\mn@eprint#1#2{\mn@eprint@#1:#2::\@nil}
\def\mn@eprint@arXiv#1{\href{http://arxiv.org/abs/#1}{{\tt arXiv:#1}}}
\def\mn@eprint@dblp#1{\href{http://dblp.uni-trier.de/rec/bibtex/#1.xml}{dblp:#%
1}}
\def\mn@eprint@#1:#2:#3:#4\@nil{\def\@tempa{#1}\def\@tempb{#2}\def\@tempc{#3}\%
ifx\@tempc\@empty\let\@tempc\@tempb\let\@tempb\@tempa\fi\ifx\@tempb\@empty\def%
\@tempb{arXiv}\fi\@ifundefined{mn@eprint@\@tempb}{\@tempb:\@tempc}{\expandafte%
r\expandafter\csname mn@eprint@\@tempb\endcsname\expandafter{\@tempc}}}

\bibitem[\protect\citeauthoryear{{Koss} et~al.,}{{Koss}
  et~al.}{2014}]{Koss:2014}
{Koss} M.,  et~al., 2014, {SDSS1133: An Unusually Persistent Transient in a
  Nearby Dwarf Galaxy}, \mn@eprint {arXiv} {1401.6798}

\bibitem[\protect\citeauthoryear{{Pontzen}, {Roskar}, {Stinson}  \&
  {Woods}}{{Pontzen} et~al.}{2013}]{Pontzen:2013}
{Pontzen} A.,  {Roskar} R.,  {Stinson} G.,   {Woods} R.,  2013, {pynbody:
  N-Body/SPH analysis for python}, \mn@eprint {ascl} {1305.002}

\makeatother
\end{thebibliography}
nxg commented 10 years ago

I see the problem.

Bloody BibTeX! The problem is that the bibtex implementation is cropping lines to 80 characters (earth calling bibtex: it's not the 80s any more!). It's putting in % characters -- this is OK with the sort of (text) lines that would normally appear in output, but it's not OK with these, because, as you can see, sometimes the line is broken inside a control sequence.

It appears that bibtex 0.99d (at least in the build in TeXLive 2013) avoids this technique. It really is is quite substantially different from 0.99c (at least in the build on SL).

I've modified mn2e.bst so that it stops this linebreaking step breaking things. As before, can you confirm this works with your bibtex version, and close if so?

rokroskar commented 10 years ago

wow! that is pretty archaic. Thanks for the fix, it works perfectly now.