2

I'm searching for a special bibliographystyle to meet the following requirements (I post one example):

LÜTKEPOHL H., KRÄTZIG M. (2004).

Applied Time Series Econometrics. Cambridge University Press, Cambridge.

So names should be in upper case; format: last name and then initials of first name (with or without a following dot), year in brackets (with or without a following dot), followed by a line-break, the titel should be displayed italic.

I use the natbib package because I want to have author-year citation in the text (e.g. Lütkepohl and Krätzig (2004)), which is working fine already.

By the way the entry in the reference list should begin directly with the last name of the author, i.e. without numbering or acronym in front (I think this will be achieved automatically by means of using the natbib package?).

I'm using \documentclass[a4paper]{article} and JabRef as reference manager.

Would be very happy if someone can help me! Thank you very much!

lockstep
  • 250,273
Dani84
  • 151
  • Do you want to use natbib or are you OK with biblatex as well? Unfortunately, the information you provide is quite limited. What about @article entries, @online, etc. pp.? ISBN, URL ...? – moewe Sep 27 '13 at 14:42
  • I'm not familiar with biblatex and it appeared to be more complicated than the natbib package to me. I don't need entries of the type ISBN, URL... I only need authors, year, title, publisher, edition. Does this information help enough? – Dani84 Sep 27 '13 at 14:48
  • Off the top of my head, I would say what you want can be easily achieved with biblatex (it might be quite daunting to begin with, but is actually quite easy to use What to do to switch to biblatex? and biblatex for idiots). I'm still not sure what format for @articles you like, these normally do not have publisher and edition, but journal, number, issue etc. – moewe Sep 27 '13 at 15:04
  • note: I only need URL, if there is no book or article to cite and the source is only available via internet. But there are no demands for a special ordering of this entries, if you wanted to know this – Dani84 Sep 27 '13 at 15:04
  • ah ok, for article I like the entries author, title, journal, year, volume, pages – Dani84 Sep 27 '13 at 15:08
  • But then it does not make sense to include a line break where there would be one with @books. That might end up looking quite inconsistent. – moewe Sep 27 '13 at 15:10
  • Our requirements say that we have to include a line break after authors and year, irrespective of the entry type (article/book/...) – Dani84 Sep 27 '13 at 15:14
  • But if you have "author, title, journal, year, volume, pages", where does the line break go? You could have "author (year)\ title, journal, year, volume, pages" (year is repeated) or "author title, journal, year,\ volume, pages" (inconsistent break cf @book) or ... – moewe Sep 27 '13 at 15:16
  • Actually the main question is how to get the first line with the special displaying of the authors and the year in brackets, followed by a line break. – Dani84 Sep 27 '13 at 15:17
  • I had a look at the requirements and in detail it would be the best solution to have authors (year) in the first line, title in the second line and the rest (journal volume pages [article] or publisher edition pages [book]) in the last line. – Dani84 Sep 27 '13 at 15:24
  • It's going to be difficult to find an existing bibliography style file that would need relatively few hacks to satisfy fully your formatting needs. However, if you want to stay with BibTeX (and natbib), help is close at hand: Run the makebst utility (via latex makebst from the command line) and follow the detailed prompts. The output of the program will be a custom-made .bst file that should meet all of your requirements. – Mico Sep 28 '13 at 10:44

1 Answers1

3

This can be quite easily be done with biblatex.

Just load biblatex with style=authoryear and firstinits=true (the latter is - you guessed it, to display only initials), and add the following to your preamble. For some of the following patches you will need the awesome xpatch.

\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[incollection,article]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[incollection,article]{citetitle}{\mkbibemph{#1}}

\renewbibmacro{in:}{%
  \ifentrytype{article}{}{%
  \printtext{\bibstring{in}\intitlepunct}}}

\DefineBibliographyStrings{german}{%
  bibliography     = {Literaturverzeichnis},
  references       = {Literaturverzeichnis},
}

\AtBeginBibliography{%
  \renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}%
  \renewcommand*{\labelnamepunct}{\\}%
  \renewbibmacro*{title}{%
    \ifboolexpr{
      test {\iffieldundef{title}}
      and
      test {\iffieldundef{subtitle}}
    }
      {}
      {\printtext[title]{%
         \printfield[titlecase]{title}%
         \setunit{\subtitlepunct}%
         \printfield[titlecase]{subtitle}}%
       \newunit}%
    \printfield{titleaddon}%
    \printunit{\newunitpunct\\}}%
}

\newbibmacro*{ineditor+others}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}
    {}}

\xpatchbibdriver{incollection}
  {\usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }
  {\usebibmacro{ineditor+others}%
   \setunit{\addcolon\space}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }%
  {\typeout{replaced \usebibmacro{byeditor+others} by \usebibmacro{ineditor+others} in BibliographyDriver{incollection}}}
  {\typeout{failed to replace \usebibmacro{byeditor+others} by \usebibmacro{ineditor+others} in BibliographyDriver{incollection}}}%


\xpatchbibdriver{inbook}
  {\usebibmacro{bybookauthor}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }
  {\usebibmacro{ineditor+others}%
   \setunit{\addcolon\space}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }%
  {\typeout{replaced \usebibmacro{byeditor+others} by \usebibmacro{ineditor+others} in BibliographyDriver{inbook}}}
  {\typeout{failed to replace \usebibmacro{byeditor+others} by \usebibmacro{ineditor+others} in BibliographyDriver{inbook}}}%

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\xpatchbibmacro{editor}%
  {\setunit{\addcomma\space}%
  }
  {\setunit{\addspace}%
  }
  {\typeout{patched bibmacro{editor}}}
  {\typeout{failed to patch bibmacro{editor}. Note that this is not necessarily bad if bibmacro{bbx:editor} was succesfully patched}}

% bibmacro{bbx:editor} is specially defined by authortitle and friends for some internal fun
\xpatchbibmacro{bbx:editor}%
  {\setunit{\addcomma\space}%
  }
  {\setunit{\addspace}%
  }
  {\typeout{patched bibmacro{bbx:editor}}}
  {\typeout{failed to patch bibmacro{bbx:editor}, note that this is not necessarily bad if bibmacro{editor} was succesfully patched}}

\renewrobustcmd*{\bibinitperiod}{}
\renewrobustcmd*{\bibinitdelim}{}
\renewrobustcmd*{\bibinithyphendelim}{}
\renewcommand*{\revsdnamepunct}{}

This makes sure names in the bibliography are "last, first" and there are no quotation marks for @incollection. Note though that this change is quite inconsistent, as normally the "main work" is emphasised (that would be the @collection) and the specific part (the @incollection) is in quotation marks. Also the heading (for German documents) is changed to "Literaturverzeichnis". The \AtBeginBibliography{...} portion makes sure that only in the bibliography names are small caps, there is a new line after the author and year and after the title as well. We then define a new macro (this is necessary so we do not get any dashes) for the editor of "in ..."-works. The bibliography drivers for @incollection and @inbook are patched to include the editor before the title. Finally, we make sure the editor string ("eds."/"Hrsg." etc.) is printed in parentheses without any preceding comma. The last chunk of code formats names and initials. There are no periods after the initial, neither are there spaces between two initials. Hyphenated names are treated like non-hyphenated ones and there is no comma between the last name and the initials of the first name

The MWE

\documentclass[ngerman]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear, maxnames=999, maxcitenames=3, firstinits=true]{biblatex}
\usepackage{xpatch}
\usepackage{hyperref}

\addbibresource{biblatex-examples.bib}

\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[incollection,article]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[incollection,article]{citetitle}{\mkbibemph{#1}}

\renewbibmacro{in:}{%
  \ifentrytype{article}{}{%
  \printtext{\bibstring{in}\intitlepunct}}}

\DefineBibliographyStrings{german}{%
  bibliography     = {Literaturverzeichnis},
  references       = {Literaturverzeichnis},
}

\AtBeginBibliography{%
  \renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}%
  \renewcommand*{\labelnamepunct}{\\}%
  \renewbibmacro*{title}{%
    \ifboolexpr{
      test {\iffieldundef{title}}
      and
      test {\iffieldundef{subtitle}}
    }
      {}
      {\printtext[title]{%
         \printfield[titlecase]{title}%
         \setunit{\subtitlepunct}%
         \printfield[titlecase]{subtitle}}%
       \newunit}%
    \printfield{titleaddon}%
    \printunit{\newunitpunct\\}}%
}

\newbibmacro*{ineditor+others}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}
    {}}

\xpatchbibdriver{incollection}
  {\usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }
  {\usebibmacro{ineditor+others}%
   \setunit{\addcolon\space}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }%
  {\typeout{replaced \usebibmacro{byeditor+others} by \usebibmacro{ineditor+others} in BibliographyDriver{incollection}}}
  {\typeout{failed to replace \usebibmacro{byeditor+others} by \usebibmacro{ineditor+others} in BibliographyDriver{incollection}}}%


\xpatchbibdriver{inbook}
  {\usebibmacro{bybookauthor}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }
  {\usebibmacro{ineditor+others}%
   \setunit{\addcolon\space}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}%
  }%
  {\typeout{replaced \usebibmacro{byeditor+others} by \usebibmacro{ineditor+others} in BibliographyDriver{inbook}}}
  {\typeout{failed to replace \usebibmacro{byeditor+others} by \usebibmacro{ineditor+others} in BibliographyDriver{inbook}}}%

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\xpatchbibmacro{editor}%
  {\setunit{\addcomma\space}%
  }
  {\setunit{\addspace}%
  }
  {\typeout{patched bibmacro{editor}}}
  {\typeout{failed to patch bibmacro{editor}. Note that this is not necessarily bad if bibmacro{bbx:editor} was succesfully patched}}

% bibmacro{bbx:editor} is specially defined by authortitle and friends for some internal fun
\xpatchbibmacro{bbx:editor}%
  {\setunit{\addcomma\space}%
  }
  {\setunit{\addspace}%
  }
  {\typeout{patched bibmacro{bbx:editor}}}
  {\typeout{failed to patch bibmacro{bbx:editor}, note that this is not necessarily bad if bibmacro{editor} was succesfully patched}}

\renewrobustcmd*{\bibinitperiod}{}
\renewrobustcmd*{\bibinitdelim}{}
\renewrobustcmd*{\bibinithyphendelim}{}
\renewcommand*{\revsdnamepunct}{}

\begin{document}
  \nocite{murray,brandt,hyman,wilde,westfahl:space,aristotle:anima,herrmann,baez/article}

  \printbibliography
\end{document}

gives enter image description here

Feel free to comment, in case your requirements specify things differently.

moewe
  • 175,683
  • Thank you so much for you support moewe. Most of it works. But I've got a few more questions: How can I add the line break again after the title? How can I get rid of the "" in case of incollections? And how is it possible to show the authornames in the text itself not in upper case (only in the reference)? And I used "\renewcommand{\refname}{Literaturverzeichnis}" for changing the title of the reference list, but it doesn't work anymore. There was a problem that I had to write backend=bibtex8 for the citation to work. I hope, this is ok. – Dani84 Sep 27 '13 at 17:19
  • @Dani84 You might want to have a look at the edited answer. Regarding backend=bibtex8, if it works for you that is fine; biber does support some for features though, so you might want to install it on your system. – moewe Sep 28 '13 at 07:22
  • Thank you sooo much, Moewe! It works. But I still like to know: how can I get rid of the "" that are still present for the title of articles? And I want to have these titles also in italics and there should be no IN: in front of the journal... hope you understand, what I mean. And it would be more suitable for Incollections to be in this format: In: authors (Hrsg.): title and so on. [Hrsg. means editors in german] Sorry for so much detailed questions, but I'm not getting familiar with codes in biblatex :( – Dani84 Sep 30 '13 at 11:13
  • @Dani84 See the edit. There is quite some modification to be done, sou you will need xpatch. – moewe Sep 30 '13 at 11:50
  • @Dani84 You will have to install l3kernel, l3packages, l3experimental and, of course, xpatch. What TeX distribution do you use? – moewe Sep 30 '13 at 14:37
  • I've found and installed the packages and now it works - thank you very much for your patience and trying so hard!!! I hope that everything is fixed now. Unfortunately I worked with multibib before, which doesn't work anymore. But I will find a solution for this, too - I hope. – Dani84 Sep 30 '13 at 15:23
  • @Dani84 biblatex offers options to replace multibib. Just have a look at the documentation (especially § 3.6.6) and, if need be, ask a new question here. – moewe Sep 30 '13 at 15:29
  • I'm so sorry, but I have one more question concerning the display in the reference list. I'd like to have this format: last name with no following comma, then the intials of the first name without a following dot, then comma and other authors. For example: HERRMANN WA, ÖFELE K, SCHNEIDER S, ... und HOFFMANN SD. And even if there is a "-" in the forname like Hans-Christoph, HC should be printed as intial (handled like Hans Christoph). – Dani84 Oct 01 '13 at 15:23
  • @Dani84 Have a look at the edited version. For hyphenated first names, you might be interested in "Hostetler et al.", consider Chuan-Jian Zhong's initials. – moewe Oct 01 '13 at 18:41
  • Unfortunately nothing changes in my output when I add the last 4 new lines from your edit, only the comma between the last name and the initials of the first name is gone. So there might be a problem with '\renewrobustcmd' ? – Dani84 Oct 02 '13 at 09:46
  • or it's a problem of using bibtex8 and not biber? But biber doesn't work fine – Dani84 Oct 02 '13 at 12:57
  • @Dani84 Yes, these commands are biber only (see the documentation); the same might be possible with bibtex8 but it will be infinitely more complicated. If you cannot get biber to work, I suggest you ask a new question describing in detail what problems you are having with biber. – moewe Oct 02 '13 at 14:24
  • Everything works fine now, thanks @moewe! Now I've one problem that in the case of 2 publications with exactly the same authors the following is displayed in the bibliography: Author(s) (year) First title. -- (year) Second title. So for the second publication there is a dash instead of the authors. I'd like to have the authors again there and like to keep the same format. I tried this suggestion (http://www.mrunix.de/forums/showthread.php?t=65454) but then the format is another one - the year is no longer in brackets behind the authors. I think it's only a little detail in the code. – Dani84 Oct 10 '13 at 15:23
  • @Dani84 Just pass dashed=false to biblatex as a load-time option. So the call to biblatex looks like this: \usepackage[backend=biber, style=authoryear, maxnames=999, maxcitenames=3, firstinits=true, dashed=false]{biblatex} or \usepackage[backend=bibtex, style=authoryear, maxnames=999, maxcitenames=3, firstinits=true, dashed=false]{biblatex} – moewe Oct 10 '13 at 15:42
  • I found the option exactly at the same time... sorry for asking :( Thaaanks again! – Dani84 Oct 10 '13 at 15:53