2

I use

\bibliographystyle{apalike}

It is perfect to me, except for one (not so little) detail, the way authors names are displayed in the bibliography (example) :

Dupond, P., Beh, M., ...

LastName1, FirstName1, LastName2, FirstName2, ...

you will have to admit, this is completly awful to read, the point/comma thing or the use of the same separator (comma) for firstname-lastname and different authors is confusing and wrong, I would like to obtain something like that :

P. Dupond, M. Beh, ...

FirstName1 LastName1, FirstName2 LastName2, ...

but I don't want to change the way apalike manage everything else (especialy citation display \cite), is there any way I can achieve this? Or any other bibliographystyle that might suits my needs?

Edit 1 : MWE under Bernard suggestion, everything worked previously, now the citation is just bold (no link) and no bibliography appears anywhere

\documentclass[
twoside,
a4paper,
11pt,
chapterprefix=true]{scrbook}

\usepackage[UTF8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}

\usepackage[style=apa]{biblatex}
\usepackage[ocgcolorlinks, allcolors=blue]{hyperref}

\addbibresource{./bib/database.bib}

\begin{document}

\cite{NameDate}

\renewcommand{\bibname}{Références} \markboth{Références}{Références}
\printbibliography \addcontentsline{toc}{chapter}{Références}

\end{document}

bib file :

% This file was created with JabRef 2.9.2.
% Encoding: Cp1252

@ARTICLE{NameDate,
  author = {LName1, FName1 and LastName2, FirstName2 and LastName3, FirstName3},
  title = {title},
  journal = {journal},
  year = {2013},
  volume = {10},
  pages = {23--29},
  number = {0},
  __markedentry = {[myname:6]},
  booktitle = {booktitle},
  issn = {2212-8271},
  keywords = {keywaords},
  owner = {my name},
  timestamp = {2014.03.05},
  url = {an url}
}

Editor warning : Citation 'NameDate' undefiened

V.B.
  • 35
  • Could you consider using biblatex? I don't know if apalike is very different from apa, but there exists a biblatex-apa package and modifying some details of a bibtex style is much easier with biblatex. – Bernard Mar 18 '14 at 16:59
  • Sure, I am open to suggestions, so instead of calling \bibliographystyle{apalike} as I didn't find biblatex-apa nor apa under style, bibstyle and citestyle options in biblatex documentation, I used \usepackage[bibstyle=authoryear, citestyle=author-year]{biblatex} but i'm confused, I get all sorts of errors, my database is created with Jabref, and it doesn't seems to work properly, EDIT : I forgot to change some other code, doing it right now – V.B. Mar 19 '14 at 14:06
  • Which distribution do you have? Normally, if biblatex-apa is installed, you just have to specify \usepackage[style=apa]{biblatex}. – Bernard Mar 19 '14 at 14:21
  • the doc is from 11/2013, even not mentionned in the doc, apa is there you are right, I have just downloaded it, trying it right now. – V.B. Mar 19 '14 at 14:28
  • Post edited with a MWE not working as intended. – V.B. Mar 19 '14 at 14:38
  • I see two errors in your MWE: you should write \addbibresource instead of \bibliography and biblatex requires to write the .bib extension. – Bernard Mar 19 '14 at 15:03
  • fixed, I realized my bibliography is empty because on the only citation from the MWE I get citation database_reference unidentified but the bib file hasn't change from my previous working code, and the database_reference (NameDate) is still the same, I can't understand why the citation isn't recognized. (I did compile latex>bibtex>latex) – V.B. Mar 19 '14 at 15:39
  • Could you add to your post an extract of your .bib file? – Bernard Mar 19 '14 at 15:44
  • First post edited – V.B. Mar 19 '14 at 15:54
  • I posted a solution. Btw, if you use biber, it is better to encode your .bib file in UTF8 format. This will make it more portable. – Bernard Mar 19 '14 at 18:25

1 Answers1

1

Here is a solution for the APA style. It uses the xpatch package to modify the apauthor name format. The package has a series of commands to patch most, if not all, biblatex commands.

    \documentclass[twoside,a4paper,11pt,chapterprefix=true]{scrbook}

    \usepackage[UTF8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}
    \usepackage[british]{babel}

    \usepackage[style=apa]{biblatex}
    \usepackage[ocgcolorlinks, allcolors=blue]{hyperref}
    \DeclareLanguageMapping{british}{british-apa}
    \usepackage{xpatch}
    \xpatchnameformat{apaauthor}{%
            {\mkbibbrackets{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}?}}
            {\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}}}%
    {%
            {\mkbibbrackets{\usebibmacro{name:apa:first-last}{#1}{#3}{#4}{#5}{#7}?}}
            {\usebibmacro{name:apa:first-last}{#1}{#3}{#4}{#5}{#7}}}%
    {}{}%

    \bibliography{bibli.bib}

    \begin{document}

    \nocite{*}
    \printbibliography

    \end{document} 

enter image description here

Other features may be modified in the same way. The method is always the same: identify the macros that are, as a last resort, responsible for the formatting you want to change and patch it. This supposes you look deep into the .bbx (for bibliography formatting) or .cbx (for citations formatting) files.

Bernard
  • 271,350