1

I want to display names in a Hardvard style used in my institution where references are displayed like:

Author, F. M., Author2 F. M., Author3 F. M. (2019) etc

However, my document shows it like this:

my document it shows like this

\usepackage[
backend=biber,
style=authoryear,
sorting=nyt,
citestyle=authoryear,
sortcites=true,
giveninits=true,
maxcitenames=2,
maxbibnames=99,
uniquename=init
]{biblatex}

Above is my \biblatex code. Does anyone have a suggestion where I've gone wrong?

Also I want all listings to include the author, not like the way it is displayed in the image below:

enter image description here

Edit:

Also I have defined two \cite-commands for my document:

\newcommand{\mcite}[1]{\textcolor{black}{\citeauthor{#1} (\citeyear{#1})}} \newcommand{\hcite}[1]{(\textcolor{black}{\citeauthor{#1}, \citeyear{#1}})}

Citing Author (Date) and (Author Date).

However, I would like these cite-commands to make clickable citations in the document (will not work with hyperref like \cite). Suggestions?

EDIT 2:

\documentclass[12pt,twoside]{report}
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm]{geometry}

\usepackage[utf8]{inputenc}


%colors
\usepackage{color}
\usepackage[dvipsnames]{xcolor}
\definecolor{mycolor}{RGB}{30,75,180} %Blue
\definecolor{mycolor2}{RGB}{40,75,90} %Greyblue


\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,
  style=authoryear, 
  maxcitenames=2,
  maxbibnames=99,
  giveninits=true,
  uniquename=init,
  dashed=false]{biblatex}

\DeclareNameAlias{sortname}{family-given}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}

\addbibresource{bibliography.bib}

\usepackage[colorlinks = true,
            linkcolor = black,
            urlcolor  = mycolor,
            citecolor = black,
            anchorcolor = mycolor]{hyperref}

\newcommand{\mcite}[1]{\textcolor{black}{\citeauthor{#1} (\citeyear{#1})}}
\newcommand{\hcite}[1]{(\textcolor{black}{\citeauthor{#1}, \citeyear{#1}})}

\begin{document}

\section{Introduction}
Text written by 

"Cite": \cite{RN1} 

"Citeyear": \citeyear{RN1} 

"Citeauthor": \citeauthor{RN1} 

"Mcite": \mcite{RN1} 

"Hicte": \hcite{RN1}


% Bibliography
    \phantomsection
    \addcontentsline{toc}{chapter}{References}%
    \printbibliography

\end{document}

Above you can see an example code of the one with the suggested solution, however I now get two errors:

"Undefined control sequence" for the:

\DeclareDelimAlias{finalnamedelim}{multinamedelim}

and "Latex error: Missing \begin{document}"

6
  • Can you please add a full example document that reproduces the output you get, a so-called MWE: tex.meta.stackexchange.com/q/228/35864 or MWEB: tex.meta.stackexchange.com/q/4407/35864. That makes it much easier to help you. You may also want to consider splitting your question up into several smaller ones. Ideally a question on this site is really only about one issue and not about several related issues. – moewe May 3 '19 at 15:59
  • What I can say already is that combining \citeauthor and \citeyear as done in \mcite and \hcite is usually ill-advised, since commands defined like this will have problems with multiple citations, don't properly support pre- and postnotes and can at worst mess up citation tracking features. The proper way to define new \...cite macros is most of the time via \DeclareCiteCommand. – moewe May 3 '19 at 16:00
  • If you get an error on \DeclareDelimAlias, your version of biblatex is outdated. (It must be more than a year old now. \DeclareDelimAlias was added in version 3.8 released on 2017-11-04.) – moewe May 9 '19 at 7:58
  • Forgot to mention that I am using Overleaf. How do I update my biblatex? – jonaskir May 9 '19 at 8:00
  • Ugh, Overleaf... You can't really update biblatex there and are stuck with their outdated version. I'll update the answer with a workaround shortly. – moewe May 9 '19 at 8:01
1

Leaving aside the issue of \mcite and \hcite, which you asked about in Making personally defined cite commands clickable as well, we only need a few little changes.

For the name format you'll need

\DeclareNameAlias{sortname}{family-given}

to get "Author, F. M.". See for example Guidelines for customizing biblatex styles or biblatex-dw first name first in bibliography.

You can get rid of the "and" with

\DeclareDelimAlias{finalnamedelim}{multinamedelim}

And you can repeat author names instead of dashes with the option

dashed=false,

see Get full name twice in Bibliography.

MWE

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber,
  style=authoryear, 
  maxcitenames=2,
  maxbibnames=99,
  giveninits=true,
  uniquename=init,
  dashed=false,]{biblatex}

\DeclareNameAlias{sortname}{family-given}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}

\addbibresource{biblatex-examples.bib}


\begin{document}
\cite{sigfridsson,companion,knuth:ct:a,knuth:ct:b}
\printbibliography
\end{document}

Before

Goossens, M., F. Mittelbach and A. Samarin//Knuth, D. E.//—//Sigfridsson, E. and U. Ryde

After

Goossens, M., Mittelbach, F., Samarin, A.//Knuth, D. E.//Knuth, D. E.//Sigfridsson, E., Ryde, U.


If you are using an outdated biblatex version that does not define \DeclareDelimFormat yet, replace \DeclareDelimAlias{finalnamedelim}{multinamedelim} with

\renewcommand{\finalnamedelim}{\multinamedelim}
1
  • I've edited my post with some new info. – jonaskir May 9 '19 at 7:46

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.