[Tex/LaTex] Author’s initials in longbibliography for revtex4-1 aps style

bibtexrevtex

I'm using the aps option for a revtex4-1 documentclass, and I'd like the bibliography to print the article titles. However, the longbibliography option also writes out the author's full names, as opposed to using first initials. Is there a way to get both initialed author names as well as article titles in the bibliography using this documentclass?

Here's a MWE:

\begin{filecontents}{testbiblio.bib}
   @ARTICLE{one,
   author = {John Smith},
   title = {Recent advances in physics},
   journal = {Phys. Rev. D}, 
   year = {2015},
   volume = {10},
   pages = {123456},
   number = {5}
   }
\end{filecontents}


\documentclass[aps,prd,twocolumn,longbibliography]{revtex4-1}

\begin{document}

\cite{one}

\bibliography{testbiblio}

\end{document}

This gives me the article title but not the author name as "J. Smith". Is there some way to modify this to make that work, ideally using the revtex bibliography style, which handles hyperlinks and eprint references nicely?

For this, the desired output would be something like

  1. J. Smith, "Recent advances in physics," Phys. Rev. D 10, 123456 (2015).

I'm also wondering if there is a way to do this without modifying the revtex bst file. For example, in the answer here, they say you can change the filenameNotes.bib file to set the bibliography options. But it seems like every time I run latex on the file, it resets the values of things living in the filenameNotes.bib file.

Best Answer

Using the 'aps' option for a revtex4-1 documentclass, the following solution allows to keep all other particularities of the aps bibliographic style unchanged. Notably, it is possible to use a modified version of apsrev4-1.bst but this will probably affect the other behaviours. Here we will simply overwrite the parameters passed to apsrev4-1.bst style file.

Originally, the output of the RevTex package without 'longbibliography' will be

Original output

Now when you add the 'longbibliography' option you get this

Output with 'longbibliography' with the awful mix of initials and full first names.

Actually the parameters for building the bibliography are stored in an extension of the .bib file called [Your file]Notes.bib of your document folder. To overwrite its output, add into your preamble, after the calls to packages,

\AtBeginDocument{%
    \newwrite\bibnotes
    \def\bibnotesext{Notes.bib}
    \immediate\openout\bibnotes=\jobname\bibnotesext
    \immediate\write\bibnotes{@CONTROL{REVTEX41Control}}
    \immediate\write\bibnotes{@CONTROL{%
    apsrev41Control,author="08",editor="1",pages="1",title="0",year="1"}}
     \if@filesw
     \immediate\write\@auxout{\string\citation{apsrev41Control}}%
    \fi
}%

This will replace the text generated at the time of building the file. You can set manually all parameters in these lines of code. Here author="08" stands for "initials for authors". The integer value used for authors is actually encoded in a sum of powers of two, each one corresponding to a different parameter. title="0" allows the production of the article titles. Your output now looks like this

Output with overwritten Notes.bib

Note that the use of 'longbibliography' option is now ineffective but replaced by the manual values.

Beyond just initials, here is the list of all authors parameters as found in apsrev4-1.bst

  'control.author.jnrlst   swap$ duplicate$ #64 control.decode
  'control.author.dotless  swap$ duplicate$ #32 control.decode
  'control.author.nospace  swap$ duplicate$ #16 control.decode
  'control.author.initials swap$ duplicate$  #8 control.decode
  'control.author.nocomma  swap$ duplicate$  #4 control.decode
  'control.author.first    swap$ duplicate$  #2 control.decode
  'control.author.reversed swap$ duplicate$  #1 control.decode

so for example use 16+8+1=25 to reverse order without spaces and use of initials. You need to set editor="0" to allow full control over author format. The parameter entered for author="HH" is actually an hexdecimal value. This means that for the previous example you have to set author="19"

Related Question