2

I am using babelbib in order to generate my bibliography. However, it won't satisfy all my needs. I just want the entrys to be formatted like

[1] Knuth, D. and Torvalds, L.: We didn't write anything together etc.

[2] Abraham, A. and Barbara, B.: Our entry is not at the first place

So it has to fulfill:

  • Order items as they appear within the text (and use numbers)
  • Abbreviate names
  • Names must all be in the order of "lastname, firstname"

I was using either

\bibliographystyle{bababbrv-lf}

\bibliographystyle{babunsrt-lf}

Each one only achieves 2 of the 3 points above. How can I get the whole thing to work? Below, you see a minimal working example, compiled with

pdflatex mwe.tex
bibtex mwe
pdflatex mwe.tex
pdflatex mwe.tex
pdflatex mwe.tex

mwe.tex


\documentclass[a4paper]{scrbook}

\usepackage[ngerman]{babel}
\usepackage{babelbib}

\begin{document}
    \chapter{One}
    Once, Lastname1 Firstname1 wrote a story~\cite{randomGuyStory}. And so did Derpina Derp~\cite{randomDerpinaStory}.
    \backmatter
    \bibliographystyle{babunsrt-lf}
%    \bibliographystyle{bababbrv-lf}
    \bibliography{mwebib}
\end{document}

mwebib.bib


@article{randomDerpinaStory,
  title={The Story of tl;dr},
  author={Derp, Derpina and Herp, Herpington},
  journal={Journal of Sunday-workers},
  volume={284},
  number={46},
  pages={31548--31554},
}
@MASTERSTHESIS{randomGuyStory,
    author = {Lastname1, Firstname1 and Lastname2, Firstname2 and Lastname3, Firstname3},
    title = {Cool Story Bro},
    school = {Random University},
    year = {2012}
}
1
  • 1
    Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Jun 9, 2013 at 13:58

1 Answer 1

2

Copy the file babunsrt-lf.bst to your working directory and rename this file e.g. mybabunsrt-lf

After this change the function format.names to the following definition:

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { nameptr #1 >
      {
        s nameptr "{ll}" format.name$ lastnamefont
        s nameptr "{,~jj}{,~f{.\btxfnamespaceshort }.}{~vv}" format.name$ *
        't :=
          namesleft #1 >
            { ", " * t namefont * }
            { numnames #2 >
                { "\btxandcomma {}" * }
                'skip$
              if$
              s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ "others" =
                { " " "\btxetalshort {.}" etalfont * * }
                { " \btxandshort {.}\ " * t namefont * }
              if$
            }
          if$
        }
        {
          s nameptr "{ll}" format.name$ lastnamefont
          s nameptr "{,~jj}{,~f{.\btxfnamespaceshort }.}{~vv}"
          format.name$ * namefont
        }
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

After this modification I got the following result:

enter image description here

2
  • thank you, works fine :-) I'm really stunned, that you cannot achieve this with a small parameter… Jun 9, 2013 at 16:32
  • @Vincent: Than you have to use biblatex ;-) Jun 9, 2013 at 16:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .