General ⇒ Harvard Referencing in Latex
Re: Harvard Referencing in Latex
its not as per my required output?
and the biblography does not show only the intext-citation.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Harvard Referencing in Latex
Harvard Referencing in Latex
Its nearly there but not quite
Take a look at both screen shots from which you can notice the differences:
required output: http://i.imgur.com/30PgvEZ.jpg
current output: http://i.imgur.com/wXrglSf.jpg
1) The in-text citation is incorrect as I need parenthesis around the author and date
2) For the biblography
- author surname should appear first followed by author initial for each reference
- otherwise the journal and book is 100% spot on
- for the website I need the word [online] in there and instead of using "visited" can we change it to accessed?
Can someone kindly help resolve these minor imperfections?
Please help
Code: Select all
\documentclass{article}
%\usepackage[style=authoryear,firstinits=true,urldate=long]{}%
\usepackage[backend=bibtex,style=authoryear,giveninits=true,urldate=long]{biblatex}
\bibliography{test}
\begin{document}
\section*{Section}
In this section we reference the book ~\cite{Goldman}, the journal ~\cite{Ennals}, and the website \cite{Kleinman}.
\printbibliography{}
\end{document}
Code: Select all
@book{Goldman,
author = {Alvin Goldman},
title = {Theory of Human Action},
publisher = {Princeton University Press},
year = 2016,
location = {Princeton},
}
@article{Ennals,
author = {Richard Ennals},
title = {Artificial stupidity},
journal = {AI \& Soc},
year = 2016,
}
@online{Kleinman,
author = {Zoe Kleinman},
organization = {BBC News},
title = {Apple custumer goes to the top for iPhone battery answer},
date = {2016-03-11},
urldate = {2016-03-11},
url = {http://www.bbc.co.uk/news/technology-35782865},
}
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Harvard Referencing in Latex
Note that as i am also not that familiar with style writing (and this is what you are asking for, it is not just generating a bibliography) it has taken me at least an hour to get the results that seem to e closer to what you want.
Code: Select all
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Goldman,
author = {Alvin Goldman},
title = {Theory of Human Action},
publisher = {Princeton University Press},
year = 2016,
location = {Princeton},
}
@article{Ennals,
author = {Richard Ennals},
title = {Artificial stupidity},
journal = {AI \& Soc},
year = 2016,
}
@online{Kleinman,
author = {Zoe Kleinman},
organization = {BBC News},
title = {Apple customer goes to the top for iPhone battery answer},
date = {2016},
urldate = {2016-03-11},
url = {http://www.bbc.co.uk/news/technology-35782865},
}
\end{filecontents}
\documentclass{article}
%\usepackage[style=authoryear,firstinits=true,urldate=long]{}%
\usepackage[%backend=bibtex,
style=apa,% requires backend biber
% giveninits=true,
autocite=inline,
]{biblatex}
\DeclareLanguageMapping{english}{english-apa}
%\bibliography{test}
\addbibresource{\jobname.bib}
\NewBibliographyString{available}
\DefineBibliographyStrings{english}{
available={Available at},
}
\renewbibmacro*{url+urldate}{%
\ifthenelse{\(\iffieldundef{url}\AND\iffieldundef{abstracturl}\AND\iffieldundef{abstractloc}\)\OR\NOT\iffieldundef{doi}}
{}
{\ifthenelse{\iffieldundef{abstracturl}\AND\iffieldundef{abstractloc}}
{}
{
\printtext{\bibcpstring{abstract}}\addspace}%
\printtext{%
\iffieldequalstr{entrytype}{online}
{\mkbibbrackets{online}\isdot\addspace}%true
{}%false
\bibstring{available}\addcolon}%
\setunit{\addspace}%
\iffieldundef{urlyear}
{}
{
\setunit*{\addcomma\addspace}}%
\setunit*{\addspace}%
\printfield{urldescription}%
\setunit*{\addcolon\addspace}%
\iffieldundef{url}{}{\printfield{url}\renewcommand*{\finentrypunct}{\relax}
\printtext[brackets]{Accessed~\printurldate}}%
\iffieldundef{abstractloc}{}{\printfield{abstractloc}\renewcommand*{\finentrypunct}{\relax}}
\iffieldundef{abstracturl}{}{\printfield{abstracturl}\renewcommand*{\finentrypunct}{\relax}}}}
\begin{document}
\section*{Section}
In this section we reference the book~\autocite{Goldman}, the journal~\autocite{Ennals}, and the website~\autocite{Kleinman}.
\printbibliography{}
\end{document}