1

I need some help with BibLaTeX: I want to have the cite (what is inline with the other text) being (author, year) and I searched through the net but found no solution. I still want to use the \printbibliography at the end of my Document, and only change the inline citation.

Can anyone give me the code needed to perform the inline citation?

5
  • Can you give more information on what you have tried already. If you could include a MWE it would assist members give you an answer. Welcome to Tex.
    – gman
    Commented Apr 4, 2020 at 16:49
  • 2
    Using any authoryear style in with biblatex, you can use \parencite{ ... } for this style (Author, year) and \textcite{ ... } for Author (year).
    – Alan Munn
    Commented Apr 4, 2020 at 16:51
  • The following might be sufficient to get you going: The most basic biblatex example
    – Alan Munn
    Commented Apr 4, 2020 at 16:55
  • i just tried \parencite{} and it resulted in (Author year) but without the , inbetween Commented Apr 4, 2020 at 17:11
  • 2
    @Commentator2.0 Then you need to edit your question with a complete but minimal compilable document that shows exactly what you did. (Not a fragment of code.)
    – Alan Munn
    Commented Apr 4, 2020 at 17:48

1 Answer 1

1

I would like to suggest that you (a) add the options natbib=true and maxcitenames=1 (or maxcitenames=2, which seems to have the same effect) while loading biblatex and (b) use the \citep macro to generate parenthetic-style citation callouts with a comma between the author group and the year.

enter image description here

\documentclass{article}
\begin{filecontents}[overwrite]{test.bib}
@misc{a:3001, author = "Anne Author", title = "Thoughts", year = 3001}
@misc{ab:3002, author = "Anne Author and Brenda Buthor", 
  title = "Deep Thoughts", year = 2002}
@misc{abc:3003, author = "Anne Author and Brenda Buthor and Carla Cuthor",
  title = "Further Thoughts", year = 3003}
\end{filecontents}

\usepackage[style=authoryear,backend=biber,
            natbib=true,maxcitenames=1]{biblatex}
\addbibresource{test.bib}
\usepackage{geometry}

\begin{document}
\citep{a:3001}, \citep{ab:3002}, \citep{abc:3003}

\citep{a:3001,abc:3003}
\printbibliography
\end{document}

Addendum: As @moewe has noted in a comment, the same result may be achieved by (a) dropping the option natbib=true, (b) adding the directive

\DeclareDelimFormat{nameyeardelim}{\addcomma\space}

after loading biblatex and (c) using \parencite or \autocite to generate the citation call-outs.

3
  • Since the natbib option surely has nothing to do with the comma issue, it might be helpful to show the \parencite version too. I think of the natbib option as a kind of compatibility option for people switching over, rather than one that new users should be pointed to.
    – Alan Munn
    Commented Apr 4, 2020 at 18:32
  • 2
    @AlanMunn For historic reasons biblatex's natbib mode sets \DeclareDelimFormat{nameyeardelim}{\addcomma\space}, so it indeed makes the comma appear. But I agree, I think it would be better to leave the natbib option and \citep aside and just show \parencite (or better \autocite) and \DeclareDelimFormat.
    – moewe
    Commented Apr 4, 2020 at 18:36
  • @moewe - Many thanks for these very specific and detailed comments. I've posted an addendum to make your suggestions a part of the "official" answer.
    – Mico
    Commented Apr 4, 2020 at 19:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .