1

I need help :)

I am writing in Danish and need citations in the harvard style. I am using the following minimum setup:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[Danish,english]{babel}
\usepackage{natbib}
\usepackage{har2nat}
\bibliographystyle{agsm}
\usepackage[colorlinks, linkcolor = black, citecolor = black, filecolor = black, urlcolor = blue]{hyperref}
\renewcommand{\harvardurl}[1]{\textbf{URL:} \url{#1}}
\usepackage{breakcites}
\renewcommand*{\UrlFont}{\itshape}

\begin{document}
\selectlanguage{danish}
\bibliography{mybib}
\nocite{*}
\end{document}

with for example following bibiographic entry:

@TechReport{AgnSchu2009,
author={Agnello, Luca and Schuknecht, Ludger},
title={{Booms and busts in housing markets: Determinants and implications}},
year=2009,
month=Jul,
institution={European Central Bank},
type={Working Paper Series},
url={http://ideas.repec.org/p/ecb/ecbwps/20091071.html},
urldate={01.04.2014},
number={No. 1071},
}

In principle it works well, and I am happy with the style and the hyperlinks etc BUT the urldate field gets ignored. I would need a solution that works also for @article, @misc, @booklet, @incollection entries. Tried using the "note" field but then the date of last access ends in front of the URL (and not after it, where it belongs).

If you then also could help me with two more 'esthetic' problems: the URLs are set on a new line (I would like them to just continue on the last line of the literature entry) and (of course) URL linebreaks look funny (but I guess that i will have to change manually...)

Help is very much appreciated. I am no LaTeX expert - so please be patient :)

  • I did not try but I'm pretty sure urldate should be formatted like this: YYYY-MM-DD'. So in you're bibliographic entry: urldate={2014-04-01}`. – nadous Apr 1 '14 at 16:12
  • 1
    I do not think the urldate key is even supported by the agsm bibtex style. Probably better to write it in a note={...} instead. (I searched the agsm.bst file). Also unless your style actually supports languages, then it does not make any sense to specify danish just before the bibliography. It seems to be using \harvardand so you might be in luck here. – daleif Apr 1 '14 at 16:18
1

If changing to Biblatex is acceptable, then it has support for urldate.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,danish]{babel}
\usepackage[style=authoryear]{biblatex}
\addbibresource{mybib.bib}

\usepackage[colorlinks, linkcolor = black, citecolor = black,
            filecolor = black, urlcolor = blue]{hyperref}

\begin{document}
Foo \parencite{AgnSchu2009}.
% \nocite{*}

\printbibliography
\end{document}

and in the bib file change to

urldate={2014-04-01},

Now running first LaTeX, then biber, then LaTeX again, you will get enter image description here

Notes:

  • There are variants and lots of options for the authoryear style. I don't know which one(s) is most like the style you were using.
  • I removed your special formatting of urls, thinking you should see the default now before maybe doing something about it again.
  • The last language to babel is set to current language at the beginning of the document.
  • Thank you very much. I think I had tried something similar in the beginning but not used biber... Changed the settings in the editor and now it worked. I just put back the url into italics. Thank you again for your quick help! – user49040 Apr 1 '14 at 17:17
  • I would like to point out that the correct formatting of the date is really necessary for the urldate to show up. It took me four hours to figure that out :-) – Lukas Sep 26 '16 at 13:55
  • Then you should have received a warning from biber about "Invalid format ... of date field urldate"! – pst Sep 27 '16 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.