josephwright / biblatex-phys

A biblatex implementation of the AIP and APS bibliography style
LaTeX Project Public License v1.3c
25 stars 6 forks source link

Minor formatting differences (mainly arXiv) #7

Closed josephwright closed 11 years ago

josephwright commented 11 years ago

There are minor formatting differences between revtex4-1 and biblatex-phys:

  1. If the author initials contain a non-breaking space, e.g. D.~M., then biblatex treats this as a first name and uses only the first initial D., whereas revtex4-1 shows D. M. in the reference. A non-breaking space is common for arXiv references obtained from the ADS database, e.g. this one.
  2. For biblatex-phys, \urlstyle{rm} changes the eprint reference (e.g. 1205.1888) from monospaced (texttt?) to roman, but the arXiv class (e.g. cond-mat.quant-gas) is still typeset as monospaced. revtex4-1 uses rm by default for the eprint reference and the arXiv class.
  3. Following the very nice resolution of issue #5, with the eprint option (necessary to get close to revtex4-1 behaviour) for Arxiv e-prints (2012), arXiv: 1205.1888 [cond-mat.quant-gas]., biblatex-phys has a hyperlink on all but , arXiv: whereas the hyperlink from revtex4-1 starts at arXiv: a goes up to the last period, i.e. all of arXiv:1205.1888 [cond-mat.quant-gas].
  4. For inbook references, biblatex-phys puts a comma after the in and before the page number (e.g. Condensates", in, Coherent ... (2001), p. 139., whereas revtex4-1 does not (e.g. Condensates,” in Coherent ... (2001) p. 139.).
  5. biblatex-phys has a space after the colon and no space before the final period arXiv: 1205.1888 [cond-mat.quant-gas]. whereas the opposite is true for revtex4-1: arXiv:1205.1888 [cond-mat.quant-gas] . Trivial and the biblatex-phys looks better.
  6. A hyperlink is not made for an inbook reference (e.g. using the doi from this one)) whereas revtex4-1 does make a hyperlink. I've made a comment on issue #5.

The following example illustrates all of the above behaviour for revtex4-1. Uncomment %\biblatextrue for biblatex-phys behaviour.

\newif\ifbiblatex
%\biblatextrue 
\ifbiblatex
  \documentclass{article}
\else
  \documentclass{revtex4-1}
\fi
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inbook{Stamper-Kurn2001a,
    Author = {{Stamper-Kurn}, D.~M. and {Ketterle}, W.},
    Booktitle = {Coherent atomic matter waves},
    Doi = {10.1007/3-540-45338-5_2},
    Editor = {{Kaiser}, R. and {Westbrook}, C. and {David}, F.},
    Pages = {139},
    Title = {Spinor Condensates and Light Scattering from {B}ose-{E}instein Condensates},
    Year = 2001}

@article{Stamper-Kurn2012a,
    Archiveprefix = {arXiv},
    Author = {{Stamper-Kurn}, D.~M. and {Ueda}, M.},
    Eprint = {1205.1888},
    Journal = {ArXiv e-prints},
    Primaryclass = {cond-mat.quant-gas},
    Title = {Spinor {B}ose gases: Explorations of symmetries, magnetism and quantum dynamics},
    Year = 2012}
\end{filecontents}

\ifbiblatex
  \usepackage[style=phys,pageranges=false,biblabel=brackets,articletitle=false,eprint]{biblatex} 
  \addbibresource{\jobname.bib}
  \urlstyle{rm}
\fi

\usepackage[colorlinks]{hyperref}

\begin{document}
\cite{Stamper-Kurn2012a} 
\cite{Stamper-Kurn2001a}
\ifbiblatex
  \printbibliography 
\else
  \bibliography{\jobname}
\fi
\newpage
\end{document}
josephwright commented 11 years ago

I'll take the points one at a time. On point 1, D.~M. is wrong: BibTeX's name formatting system does not understand ~ as a space, so treats this as a single name. As such, this is not a bug in biblatex-phys.

josephwright commented 11 years ago

Further on point 1, this shows up as biblatex-phys prints initials and surnames, not just 'whatever was in the database'. Most physical science reference styles seem to work that way: full first names tend not to be given. I'm not sure if REVTeX deliberately prints full names or simply expects that the database will be set up without them!

josephwright commented 11 years ago

Point 5 looks to me like one that could be argued either way. Certainly the full stop is wrong in REVTeX! On the colon part, without some official statement from one of the journals I'm minded to leave alone.

josephwright commented 11 years ago

Re point 1, REVTeX doesn't show the full name, e.g. Stamper-Kurn, Dan.~M gets typeset as D. M. Stamper-Kurn, so it is recognising the non-breaking space rather than showing the full "name". Checking through my arXiv preprints, it seems that for all of them, if authors have two initials, then there is a ~ between them. I think that the ADS database puts the ~ in there (and ADS is the source for arXiv bibtex entries). I have found a workaround though, I added the following to my .tex file to sanitise the author (I also sanitised the title (issue #4), putting { } around any inline maths):

  \DeclareSourcemap{
    \maps[datatype=bibtex,overwrite=true]{
      \map{
        \step[fieldsource=author,
          match=\regexp{([^\\])\~},
          replace=\regexp{$1\x20}]
        \step[fieldsource=title,
          match=\regexp{(\$[^\$]*\$)},
          replace=\regexp{\{$1\}}]
        }
    }
  }

but I'm sure I'm missing something. I should try to sanitise the author for diacritics (issue #6), but that could be a bit messier.

josephwright commented 11 years ago

Re point 5, the APS (Table I) and AIP (Table II) style guides don't have many examples and none that cover arXiv preprints in this detail. Looking at some articles (e.g. this one, open access), the style seems to be [authors], arXiv:1203.0948v1. So there is no ArXiv e-prints (2012), and no arXiv class. To get this behaviour from REVTeX4-1, I need to delete the fields Year, Primaryclass and Journal from the .bib file (I don't think it's easy to do automatically without biblatex since published and arXiv are all covered by the same FUNCTION {article} in the .bst). I then get the same result from REVTex4-1 and biblatex-phys, except that biblatex-phys has a space after the colon and doesn't hyperlink the arXiv:, neither of which is of any consequence.

josephwright commented 11 years ago

I've taken another look at point 1: it looks like a biber versus BIbTeX thing. I've raised this with PLK (who writes biber).

josephwright commented 11 years ago

Point two is due to a hard-coded \texttt in the standard definition: I'll alter this to \UrlFont.

josephwright commented 11 years ago

On point 5, I'll remove the space after :, as this looks intention, but will not add the one before . (which must I think be wrong).

josephwright commented 11 years ago

Point 3: I've removed the link from the first part and added it to the "arXiv:" part (1822bbfb7701a429d956598b2fb9e69e84db8968).

josephwright commented 11 years ago

Point 6: I've added a hyperlink for all book titles (f9c9afe946a508bd8d33e191bceebca7092e1291).

josephwright commented 11 years ago

I've had confirmation from PLK that point 1 is a Biber bug, so this should be fixed 'up stream' soon-ish.