1

LaTeX file:

\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{csquotes}% Recommended

\usepackage[style=authoryear-ibid,backend=biber]{biblatex}

\addbibresource{sample.bib}% Syntax for version >= 1.2

\title{A simple example showing how to create Harvard style referencing in LaTeX}
\author{WriteLaTeX}
\date{}

\begin{document}
\maketitle

\begin{abstract}
The following examples show how to produce Harvard style referencing using biblatex.
\end{abstract}

\section*{Citation examples}

\begin{enumerate}
\item A citation command in parentheses: \parencite{Smith:2012qr}.
\item A citation command for use in the flow of text: As \textcite{Smith:2013jd} said \dots
\item A citation command which automatically switches style depending on location and the option setting in the package declaration (see line 12 in the LaTeX source code). In this case, it produces a citation in parentheses: \autocite{Other:2014ab}.
\end{enumerate}

\printbibliography

\end{document}

.bib file:

@BOOK{Smith:2012qr,
    title = {{B}ook {T}itle},
    publisher = {Publisher},
    author = {Smith, J.~M. and Jones, A.~B.},
    year = {2012},
    edition = {7th},
}

@ARTICLE{Smith:2013jd,
    author = {Jones, A.~B. and Smith, J.~M.},
    title = {{A}rticle {T}itle},
    journal = {Journal title},
    year = {2013},
    volume = {13},
    pages = {123-456},
    number = {52},
    month = {March},
    publisher = {Publisher}
}

@BOOK{Other:2014ab,
    title = {{B}ook {T}itle},
    publisher = {Publisher},
    author = {Other, A.~N.},
    year = {2014},
    edition = {10th},
}

The result should be like this:

enter image description here

Why did I get a result like this?

enter image description here

Thanks!

  • 1
    Welcome to TeX.SE! You need to first run (PDF)LaTeX, then BibLaTeX (or Biber) and again (PDF)LaTeX in order to create a bibliography. Did you do that? An answer to your problem can probably be found here: https://tex.stackexchange.com/a/63875/47927 – Jasper Habicht Nov 28 '19 at 19:24
  • Thanks for the response, but it still didn't work.. – samba jariang Nov 28 '19 at 19:33
  • Because the babel package seems to make the colon (:) an active character, you cannot easily use this character in your bibliography keys. If you use keys without colon, or if you comment out \usepackage[english]{babel}, it should work. I suggest, you use keys without colon. See here: https://tex.stackexchange.com/a/408548/47927 – Jasper Habicht Nov 28 '19 at 19:40
  • Off topic: It should be month = {3} instead of month = {March}. – Jasper Habicht Nov 28 '19 at 19:42
  • still did not work... when i run bibtex, was writen "I couldn't open file name `sample.aux'
    Process exited normally"..
    – samba jariang Nov 28 '19 at 19:46
  • Voted for closing, because the given input is processed normally after changing month={March} into month=3 and removing all the useless ~ characters (but this is just cosmetic). – egreg Aug 16 '23 at 08:44

1 Answers1

0

I have did like this:

Latex file


\documentclass{article}
\usepackage{natbib}
\bibliographystyle{agsm}

\begin{document}

Try one.... \citep{sipser2006introduction}
Try two..... \citep{divincenzo2000physical}

\bibliography{sample}% without extension .bib
\end{document}

Bib file (sample.bib)


@book{sipser2006introduction,
  title={Introduction to the Theory of Computation},
  author={Sipser, Michael and others},
  volume={2},
  year={2006},
  publisher={Thomson Course Technology Boston}
}

@article{divincenzo2000physical,
  title={The physical implementation of quantum computation},
  author={DiVincenzo, David P},
  journal={Fortschritte der Physik: Progress of Physics},
  volume={48},
  number={9-11},
  pages={771--783},
  year={2000},
  publisher={Wiley Online Library}
}

i have got result like this..

enter image description here

If the latex can not open .aux file, press F6, and F11 alternately..

Thanks..))