8

I am using the package natbiband the following jf.bst-file for the citation in my thesis http://faculty.haas.berkeley.edu/stanton/texintro/. According to the citation requirements the citation has to print out all the last names of the author when the number of authors are less than four. The problem now is, as sson as I have more than two authors I get for instance "Doyle et al. (2006)" whereas the output is supposed to be "Doyle, Lundholm and Soliman (2006)". According to the natbib reference sheet http://merkel.zoneo.net/Latex/natbib.php I can get my desired output by using \citet*. This actually is tedious as I have to check every time the number of authors before deciding which cite-command to use. Is there a way to automatically make Late understands that with the normal \cite command I can get the output mentionend above?

7

To change the truncation criterion for using "et al." in a citation callout, from a piece having three or more authors to it having four or more authors, it is necessary to modify the function format.lab.names in the bibliography style file.

I suggest you do the following:

  • Make a copy of the version of jf.bst you've been working with so far. Name the copy, say, jf3.bst -- "3" to indicate non-truncation if a piece has exactly three authors. (Don't modify jf.bst directly.)

  • Open the file jf3.bst in a text editor and find the function format.lab.names. It should start around line 1160 and span 18 lines.

  • Delete the entire function (i.e., all 18 lines) and insert the following chunk of code (46 lines total) in its place:

    FUNCTION {format.lab.names}
    {'s :=
     "" 't :=
      #1 'nameptr :=
      s num.names$ 'numnames :=
      numnames 'namesleft :=
        { namesleft #0 > }
        { s nameptr
          "{vv~}{ll}" format.name$
          't :=
          nameptr #1 >
            {
              nameptr #2 =
              numnames #3 > and
                { "others" 't :=
                  #1 'namesleft := }
                'skip$
              if$
              namesleft #1 >
                { ", " * t * }
                {
                  s nameptr "{ll}" format.name$ duplicate$ "others" =
                    { 't := }
                    { pop$ }
                  if$
                  t "others" =
                    { " et~al." * }
                    {
                      numnames #2 >
                        { "," * }
                        'skip$
                      if$
                      bbl.and
                      space.word * t *
                    }
                  if$
                }
              if$
            }
            't
          if$
          nameptr #1 + 'nameptr :=
          namesleft #1 - 'namesleft :=
        }
      while$
    }
    
  • Save the file jf3.bst either in the directory where your main tex file is located or in a directory that's searched by BibTeX. If you choose the second option, be sure to update the filename database of your TeX distribution.

  • Start using the new bibliography style by using the instruction \bibliographystyle{jf3} instead of \bibliographystyle{jf}. After you first switch bibliography styles, be sure to run LaTeX, BibTeX, and LaTeX twice more to fully propagate all changes.

Happy BibTeXing!


Addendum: Here are the citation callouts produced with \citet running the MWE below, first the jf and then with jf3. (One entry has three authors and the other has four.)

With jf, both citation callouts truncate to Andersen et al.:

enter image description here

With jf3, only one citaton callout -- for the piece with four authors -- is truncated:

enter image description here

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{abd:2007,
  author      = "Torben G. Andersen and Tim Bollerslev and Francis X. Diebold",
  title       = "Roughing it up: {Including} jump components in the
                measurement, modeling and forecasting of return volatility",
  journal     = "Review of Economics and Statistics",
  year        = 2007,
  volume      = 89,
  number      = 4,
  month       = "November",
  pages       = "701--720",
}

@article{abde:2001,
  author      = "Torben G. Andersen and Tim Bollerslev and Francis X. Diebold
                and Heiko Ebens",
  title       = "The distribution of realized stock return volatility",
  journal     = "Journal of Financial Economics",
  year        = 2001,
  volume      = 61,
  number      = 1,
  month       = "July",
  pages       = "43--76",
}
\end{filecontents*}
\usepackage[round,authoryear,comma]{natbib}
\bibliographystyle{jf}  % or: jf3
\begin{document}
\citet{abd:2007}; \citet{abde:2001}
\bibliography{\jobname}
\end{document}
  • Dear Mico, thank you for the modification of the code. There is a problem when running LaTeX, BibTeX and LaTeX. The first error has actually nothing to do with the question, but anyways: Running Latex creates an error with my a *.png-file, because LaTeX cannot determine the size of my graphic. The second error caused by BibTeX is: "line 1368 of file jf3.bst You can't pop an empty literal stack for entry xyz while executing..." this happens for all my citations. My citation turns into (2004b). – eternity1 Aug 17 '14 at 16:11
  • @eternity1 - I'm afraid I don't think I have anything original to say about png file formats -- maybe you should ask a new question rather than mix this issue into a BibTeX question? About the second error: It sounds like there may be a problem with every single one of your entries -- or that you didn't perform the edits as I suggested them. I will post an MWE showing how things (should) work with jf3. – Mico Aug 17 '14 at 16:15
  • thank you for the example. there was a misunderstanding, I used \cite instead of \citet. Moreover, I think my problems lies in the entries because mine is: "Last name, First name and Last name, First name". While your entries are "First name Last name and First name Last name". – eternity1 Aug 17 '14 at 16:35
  • @eternity1 -- The natbib package redefines \cite to act exactly like \citet, so both commands should produce identical output. There should also be no difference whatsoever in output whether one enters an author's name as "First Middle Last" or as "Last, First Middle". If you find that the ordering makes a difference, there's something seriously wrong either with your .bib file or with the way you created jf3.bst. Please run the MWE above and verify that you get the same output as I do. If that's not the case, recreate the file jf3.bst from scratch. Iterate until convergence... – Mico Aug 17 '14 at 16:49

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.