11

I'm using the default style numeric in biblatex. In this style, the year is printed last in the bibliography: enter image description here

I would like to have the year directly after the author's name:

George Harrison. 2000. My music is better than Paul's and John's.

What command can I put into the preamble of my .tex file to enforce this?

\documentclass{article}
\usepackage{csquotes,biblatex,filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{harrison2000,
    AUTHOR = "George Harrison",
    TITLE = "My music is better than Paul's and John's",
    YEAR = "2000"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Text \parencite{harrison2000}.
\printbibliography
\end{document}
11

There's no need to change every BibliographyDriver -- the solution is similar to this one: load biblatex with the options citestyle=numeric,bibstyle=authoryear and add the \defbibenvironment definion of numeric.bbx. (The xpatch package is only used to remove the parentheses around the year.)

\documentclass{article}
\usepackage{csquotes,filecontents}
\usepackage[citestyle=numeric,bibstyle=authoryear]{biblatex}
\DeclareNameAlias{sortname}{first-last}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
    \printfield{prefixnumber}%
    \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}
\usepackage{xpatch}
\xpatchbibmacro{date+extrayear}{%
  \printtext[parens]%
}{%
  \setunit{\addperiod\space}%
  \printtext%
}{}{}
\begin{filecontents}{\jobname.bib}
@BOOK{harrison2000,
    AUTHOR = "George Harrison",
    TITLE = "My music is better than Paul's and John's",
    YEAR = "2000"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Text \parencite{harrison2000}.
\printbibliography
\end{document}

enter image description here

  • Works like a charm. Now I also learned how to remove parentheses from the year in the bibliography. I tested this, and it works with other styles too, such as style=authoryear. – Sverre Jan 25 '13 at 19:55
  • 1
    @Sverre See tex.stackexchange.com/questions/12254/… – lockstep Jan 25 '13 at 19:58
2

For somethings you can just set an option/toggle to change the formatting. There is a nice explanation in this question. Moving the date is not that simple. There currently is not a WYSIWYG editor for biblatex styles or even a system like makebst so your best bet is to find an existing style that meets your needs (or change your needs). If you really want to do it, you could redefine a bunch of macros in the preamble, but it will be much easier to create your own style.

Starting from standard.bbx you would need to redefine all the bibmacros which have "date" in their name like

\newbibmacro*{publisher+location+date}{%
  \printlist{location}%
  \iflistundef{publisher}
    {\setunit*{\addcomma\space}}
    {\setunit*{\addcolon\space}}%
  \printlist{publisher}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}

to be

\newbibmacro*{publisher+location}{%
  \printlist{location}%
  \iflistundef{publisher}
    {\setunit*{\addcomma\space}}
    {\setunit*{\addcolon\space}}%
  \printlist{publisher}%
  \newunit}

and then replace the references to the date version with the no date version. This will get rid of the date at the end of the reference.

Adding the date to the beginning of the reference requires adding

  \usebibmacro{date}%
  \newunit\newblock

to each BibliographyDriver in the appropriate place. For example, for books

\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
  \newunit

would become

\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{date}%
  \newunit\newblock
  \usebibmacro{maintitle+title}%
  \newunit
  • Wow, that entails a lot more stuff in the preamble than I had hoped for! Furthermore, I realized there is more stuff to sort out. For instance, some bibmacros have more than one \usebibmacro{date} fields. Then what? Delete all? Also, many of the BibliographyDrivers make reference to fields such as \usebibmacro{location+date}. But these don't exist anymore, since I've removed the date part. – Sverre Jan 25 '13 at 18:00
  • @Sverre I said it wasn't trivial. I definitely would define a new style (or better yet find a existing style that meets your requirements). As for the +date part, yes you need to modify everything. – StrongBad Jan 25 '13 at 18:07

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.