GeneralHarvard Referencing in Latex

LaTeX specific issues not fitting into one of the other forums of this category.
xirokx
Posts: 7
Joined: Fri Mar 11, 2016 7:52 pm

Harvard Referencing in Latex

Post by xirokx »

Hey there

So I am total newb to latex but am really enjoying working with it, its transformed the way I view creating word documents and want to create my first report using it.

At the end of my playtime where I created a document with images, table of contents, section headers and all sorts I started playing with the bibliography.

I want to use harvard referencing to ref a)book b)website c)journal but I am failing miserably I have tried so many different things here is where I am:

I am using \usepackage[round, authoryear]{natbib}

and further down my document beford \end{document} i am using

Code: Select all

\bibliographystyle{abbrvnat}
\bibliography{Library}
my .bib file contains just 1 website reference for test purposes

Code: Select all

@misc{label,
author = "BBC News",
title = "Apple customer goes to the top for iPhone battery answer",
year = "2016",
url = "http://www.bbc.co.uk/news/technology"}
Trouble is the reference does not show up correct in my "references" section at the end of my document

I would like

a book to show up as this in my latex document

Code: Select all

Goldman, A. (2015). Theory of Human Action. Princeton: Princeton University Press.
a journal to show up as this in my latex document

Code: Select all

Ennals, R. (2016). Artificial stupidity. AI & Soc.
a website to show up as this in my latex document

Code: Select all

BBC News. (2016). Apple customer goes to the top for iPhone battery answer - BBC News. [online] Available at: http://www.bbc.co.uk/news/technology-35782865 [Accessed 11 Mar. 2016].
please help me acheive this so I can use Latex forever

thank you

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Harvard Referencing in Latex

Post by Johannes_B »

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
xirokx
Posts: 7
Joined: Fri Mar 11, 2016 7:52 pm

Re: Harvard Referencing in Latex

Post by xirokx »

if I didnt do any of those things in the first place I would not be posting in a public forum asking for help.

I mean I wasnt born with the ability to use Latex in the last two days I have learnt quite a lot about it however now Im stuck so thought Id ask in a Latex forum as I am confident I am not the only person who has experienced this.

So I am now of places to research hoping someone can guide me
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Harvard Referencing in Latex

Post by Johannes_B »

Crossposts have to be marked in this forum, that's all.

You are a new users, so what you cannot know right now: What you are asking for is not a small problem solvable within 5 minutes even for an experienced user. ibliography management is complex.

I started to rewrite the bibliography section of the LaTeX wikibook. Please have a look: https://github.com/johannesbottcher/wik ... agement.mw and the other files in that directory. Attention: Almost everything but the beginning of the link above is from the old page and chaotic.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
xirokx
Posts: 7
Joined: Fri Mar 11, 2016 7:52 pm

Harvard Referencing in Latex

Post by xirokx »

What you are asking for is not a small problem solvable within 5 minutes
why on earth would someone create software like latex a professional document writing software that makes it so hard to create bibliographies hmmmm

I have spent hours trying to get my biblography to show up as per my example and am failing miserably.

If you are writing a wiki page on it can you not just put me out of my misery, once I have the template in place I will never need to touch it. Or do you prefer me to read 50 pages and suffer
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Harvard Referencing in Latex

Post by Johannes_B »

Creating a bibliography in LaTeX is easy. Creating a style is not. What happens if you don't have an author, but only an editor? How will this be treated, does the punctuation change?
What if you have a date of a reprint and the date of the original publication? Which one is printed? Both? In which order?

As i say, it is indeed complicated to write an own style. There is a reason for the biblatex manual to have so many pages.

You asked for natbib, which i don't know much about. The styles are written in reversed polish notation and even for experienced users hard to deal with. Luckily, makebst is available, which should lead you further. Many inexperienced users seem to get what they want. Personally, i have never used it.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
xirokx
Posts: 7
Joined: Fri Mar 11, 2016 7:52 pm

Re: Harvard Referencing in Latex

Post by xirokx »

thanks for your reply

I did not ask for assistance on natbib its just that until this point in my learning thats what I primarily found and worked(kind of) for books but not websites.

As a newbie I do not think creating a biblography in latex is so easy for instance here in the UK at universities we are asked to use Harvard referencing. Without getting into not all universities do ask for Harvard and all that if it is so easy why can I not do it? You said yourself in your earlier response that the question I ask will not take 5 mins to answer or to learn. This proves it is not easy.

I have given examples of they style of referencing I would like to do, whether its creating manual references or recalling references from a database to be honest I do not care, I just want to make it work so I do not have to stop using Latex altogether. Yet I struggle. I have now spent hours and hours trying but have not found a solution yet. I am sure there are people who can help.

Thanks for linking to makebst unfortunately your link is dead, this goes from bad to worse it really does.

Seriously Latex can you not simplify the entire process.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Harvard Referencing in Latex

Post by Johannes_B »

The example that i plan to include in the wikibook, compilable by clicking on open in writelatex just above the code block.

Code: Select all

\begin{filecontents}{\jobname.bib}
@article{wombat2016,
	author   = {Walther Wombat and Klaus Koala},
	title    = {The true meaning of 42},
	journal  = {Journal of modern skepticism},
	date     = {2016},
	keywords = {trusted},
}
@book{lion2010,
	author       = {Laura Lion and  Gabrielle Giraffe and Carl Capybara},
	title        = {The dangers of asking the wrong question},
	publisher    = {publishing house},
	date         = {2010},
	keywords     = {trusted},
}
@online{wikibook,
	title        = {Generating Bibliographies with biblatex and biber},
	organization = {Wikibooks},
	date         = {2016},
	urldate      = {2016-03-07},
	url          = {https://en.wikibooks.org/wiki/LaTeX/Generating_Bibliographies_with_biblatex_and_biber},
	keywords     = {untrusted},
}
\end{filecontents}
\documentclass{article}
\usepackage[backend=biber,style=authoryear,autocite=inline]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
I doubt that there is any useful information here~\cite{wikibook}.

All we know is limited, apart from knowing the answer we all know. Or do we?~\cite{wombat2016}

Some people are too nosy. What can happen to them is described by Laura Lion~\autocite[9]{lion2010}.

Some people are too nosy. What can happen to them is described by \textcite[9]{lion2010}.

\printbibliography
\end{document}


Doing it manually as already described in Manually managing References.

Code: Select all

\documentclass{article}
\usepackage{url}
\newcommand{\bibTitle}[1]{``#1''}
\begin{document}
I doubt that there is any useful information here~\cite{wikibook}.

All we know is limited, apart from knowing the answer we all know. Or do we? Wombat and Koala have discovered some interesting things~\cite{wombat2016}.

Some people are too nosy. What can happen to them is described by Laura Lion~\cite[p.~9]{lion2010}.

\begin{thebibliography}{Wombat, 2016}
	\bibitem[Wikibook]{wikibook}
		\bibTitle{Manually Managing References}, 
		\url{https://en.wikibooks.org/wiki/LaTeX/Manually_Managing_References};
		2016
	\bibitem[Wombat, 2016]{wombat2016}
		Walther Wombat and Klaus Koala,
		\bibTitle{The true meaning of 42} in: Journal of modern skepticism;
		2016
	\bibitem{lion2010}
		Laura Lion, Gabrielle Giraffe and Carl Capybara,
		\bibTitle{The dangers of asking the wrong question}, publishing house;
		2010
\end{thebibliography}
\end{document}|
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
xirokx
Posts: 7
Joined: Fri Mar 11, 2016 7:52 pm

Harvard Referencing in Latex

Post by xirokx »

thanks for your reply but I found an easier way yet I its still not as I want:

Here is the output:
output.jpg
output.jpg (33.5 KiB) Viewed 42570 times
Here is my my latex file:

Code: Select all

\documentclass{article}

%\usepackage[style=authoryear,firstinits=true,urldate=long]{}%
\usepackage[round, authoryear,firstinits=true,urldate=long]{}
\usepackage[backend=bibtex]{biblatex}
\bibliography{test}

\begin{document}

\section*{Section}
In this section we reference the book \cite{Goldman}, the journal 
\cite{Ennals}, and the website \cite{BBC}.

\printbibliography{}

\end{document}
and here is my .bib file

Code: Select all

@book{Goldman,
  author = {Goldman Alvin.},
  title = {Theory of Human Action},
  publisher = {Princeton University Press},
  year = 2016,
  location = {Princeton},
  }

@article{Ennals,
  author = {Ennals Richard},
  title = {Artificial stupidity},
  journal = {AI \& Soc},
  year = 2016,
  }

@online{BBC,
  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},
  }
How can I:

1) remove the numbers from the intext citations and instead use (Ennals, 2016)

2) the biblography is still not quite right, I need the year to appear after the author name

please help

thank you - nearly there
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Harvard Referencing in Latex

Post by Johannes_B »

Click on Open in writelatex above the code i posted!
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply