1

I'm trying to insert a Harvard reference list to my report. I'm using the Swedish language package and biblatex. However, I am having some problems with the reference list:

(1) I would like the references to be written like this:

Author1lastname, author1first name, Author2lastname, author2firstname, Author3lastname, author3firstname (year)...

However, the second and third authors names show up firstname-lastname (please see picture).

(2) I would like my references to be sorted by author last name. However, the list starts with an author whose last name starts with the letter W :( If I add some more references, they get sorted by author last name, so I think the problem might have to do with the Swedish language package? How can I solve this problem, so that the W comes after V?enter image description here

Example tex file:

\documentclass[a4paper,11pt,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[swedish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{algorithmic}
\usepackage[style=authoryear,backend=biber,maxbibnames=99]{biblatex}
\addbibresource{reference.bib}

\begin{document}

\title{My title}
\author{My name}

\maketitle

\section{I have multiple sections}

I write references like this (\cite{key1}). This shows up first in the referencelist (\cite{key2}).

\newpage

\printbibliography

\end{document}

Example bib file:

@inproceedings{key1,
    author = {Author1lastname, Author1firstname and Author2lastname, Author2firstname and Author3lastname, Author3firstname},
    title = {Title},
    booktitle = {Booktitle},
    series = {Series},
    year = {Year},
    isbn = {ISBN},
    location = {Location},
    pages = {Pages},
    numpages = {Numpages},
    url = {URL},
    doi = {DOI},
    publisher = {Publisher},
}

@inproceedings{key2,
    author = {WAuthor1lastname, Author1firstname and Author2lastname, Author2firstname and Author3lastname, Author3firstname},
    title = {Title},
    booktitle = {Booktitle},
    series = {Series},
    year = {Year},
    isbn = {ISBN},
    location = {Location},
    pages = {Pages},
    numpages = {Numpages},
    url = {URL},
    doi = {DOI},
    publisher = {Publisher},
}

I'm new to LaTex and would be very thankful for help :)

dina98
  • 11
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. In particular, in your case it should be a minimal working example with bibliography (MWEB). – gusbrs Nov 03 '17 at 13:41
  • Does this answer help you understand what is going on and fix it? https://tex.stackexchange.com/a/361366/105447 – gusbrs Nov 03 '17 at 14:57
  • 1
    Yes, I tried using sortkey as one of the answers at that page suggests, it worked perfectly! Thank you so much for the help :) – dina98 Nov 03 '17 at 15:26
  • I managed to solve the other problem as well, using this answer: https://tex.stackexchange.com/a/376723/147294 – dina98 Nov 03 '17 at 15:48
  • 1
    Glad to know it helped. As for the order of the author names, please use the current biblatex terminology for it , as in \DeclareNameAlias{sortname}{family-given}, which is updated in the answer mentioned in the one you linked. (last-first still works, but might not do so in the future, as the uptodate form is family-given). – gusbrs Nov 03 '17 at 17:27
  • By the way, you mentioned you used the sortkey as in egreg's answer. I could reproduce your issue and make it work using sortlocale=sv-SE_reform as in moewe's answer, which is clearly a better alternative, as you don't have to go about your whole bib file adding sortkeys for every relevant entry. – gusbrs Nov 03 '17 at 17:41
  • Oh I did not see the answer to the first question in the link at first, sorry :) I have now updated my code with the family-given form. The sortlocale=sv-SE_reform gave me an error ("_ must be inside math mode") but it still works when compiling, so I will use that one instead. Thank you for all help @gusbrs ! :) – dina98 Nov 03 '17 at 18:25
  • You must use it as an option of biblatex, as \usepackage[style=authoryear,maxbibnames=99,sortlocale=sv-SE_reform]{biblatex} (I've ommited backend=biber for it is already the default in current versions, thus unnecessary). – gusbrs Nov 03 '17 at 18:57

0 Answers0