2

I am new to the LateX world and currently I am writing my master thesis. The university requires the citation to look like that e.g. (Udell,2006) but in mine document the comma is missing- (Udell 2006). I tried to change to natbib to author-year but nothing happened. Can you please give me some advice? Thank you!

  • 1
    Welcome to TeX.SX! Can you please share a minimal example of what you're doing? – egreg Mar 05 '18 at 13:37
  • Well, I have loaded my bibliography, then in the Document-Settings I have changed to natbib and author-year. After that I insert citation to the text in order to generate the reference. In lyX i see it like that (Udell,2006) but when I convert the text in pdf it appeas without the comma- (Udell 2006) – Kristina Mar 05 '18 at 13:42
  • 2
    The example is still needed. – egreg Mar 05 '18 at 13:43
  • This is what i do.. i do not have a code written.. – Kristina Mar 05 '18 at 13:44
  • 1
    You must have written some code, as otherwise you wouldn't be in position to write about the output of the citation call-outs. Please tell us whether you use \citet, \citep, or some other command. Please also tell how the natbib package is loaded and whether your document features any \setcitestyle and/or \bibpunct directives. – Mico Mar 05 '18 at 13:48
  • 1
    Well, if you don't have any code written, how do you know the comma is missing in your document? Please take a look at MWE/ MWEB on how to build a minimal working example. – gusbrs Mar 05 '18 at 13:48
  • Welcome o TeX.SE. Please take a look at the answers already provided. They are written with an MWE included. This is the standard model for any question on this website. If one of the answers solved your problem, you are welcome to hit the 'accept answer' button, or to provide more information as to what you want to achieve. – thymaro Mar 05 '18 at 21:15

2 Answers2

3

For the biblatex case, this question was already answered here (by Marco Daniel). Here is his answer :

The space between the name and the year is controlled by the macro \nameyeardelim. So you have to redefine it:

\renewcommand*{\nameyeardelim}{\addcomma\space}

Here a small example:

\documentclass[]{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\renewcommand*{\nameyeardelim}{\addcomma\space}
\begin{document}
\cite{companion}
\end{document}
Mico
  • 506,678
1

Do you use bibtex (natbib) or biber (biblatex) ?

If you use bibtex and the agsm bibliography style, you need to add either \usepackage[comma]{natbib} or \usepackage[semicolon]{natbib}in your preamble, as is shown in the following code:

\documentclass[a4paper,11pt,twoside]{book}
\usepackage[semicolon]{natbib} %package for add comme or semicolon
\usepackage[utf8]{inputenc}

\begin{document}
\citep{huffman2017web}

\citet{huffman2017web}
\bibliographystyle{agsm} %bibliography apa harvard
\bibliography{library}
\end{document}

The .bib file is:

@article{huffman2017web,
  title  = {Web 2.0: beyond the concept practical ways to implement RSS, podcasts, and Wikis},
  author = {Huffman, Karen},
  journal= {Education Libraries},
  volume = {29},
  number = {1},
  pages  = {12--19},
  year={2017}
}

The output is:

Reference with comma

Bibliography

Mico
  • 506,678
VictorD
  • 31