36

I have the following in .bib file:

@online{solarfarm, 
author = {Buckley, Alastair and nee Hall, Lisa Clark and {Colantuono, Giuseppe Everard}, Aldous}, 
file = {:Users/Desktop/Downloaded/85c4687c.html:html}, 
title = {{The Sheffield Solar Farm}}, 
Howpublished = {\url{http://www.sheffieldsolarfarm.group.shef.ac.uk/solar-panel-data}}, 
url = {\url{http://www.sheffieldsolarfarm.group.shef.ac.uk/solar-panel-data}}, 
urldate = {16/5/2013} 
}

but I can't get the date retrieved or date accessed to work, it never shows up in references.

MWE:

\documentclass[12pt,a4paper]{report}
\begin{document}
\renewcommand\bibname{References} 
\bibliographystyle{abbrv}    
\bibliography{library}  
\end{document}
Werner
  • 603,163
Razor
  • 2,691
  • The abbrv style doesn't know those fields. – egreg Apr 30 '13 at 20:24
  • Agree with @MarcoDaniel , note field is useful for date accessed. e.g. in harvard system simply enter [Date accessed: 2013]. – oLas Apr 30 '13 at 20:40
  • @oLas Where is Note field ? – Razor Apr 30 '13 at 20:44
  • @egreg I want to order them alphabetically though – Razor Apr 30 '13 at 20:44
  • 1
    see the link from @MarcoDaniel, I'm confident this will answer your question, if it does I'm sure an upvote would be appreciated over there! – oLas Apr 30 '13 at 20:52
  • @oLas Surely there's a simpler way than using terminal to edit each reference manually right ?! – Razor Apr 30 '13 at 20:59
  • Ok, so terminal is only used to get information on what fields are AVAILABLE for a particular bibliography style. I noticed that you wanted your references listed alphabetically, in that case I would suggest using the Harvard referencing system \bibliographystyle{agsm} which DOES have a note field. Then, simply add a note to each reference note = {[Date accessed: 2013]} to comply with Harvard standards. – oLas Apr 30 '13 at 21:30
  • @oLas Im using numeral in-text referencing, and want to order them alphabetically in references. Would I retain these using the method you provided ? – Razor Apr 30 '13 at 21:44

2 Answers2

22

Your question is not clear. Do you want to use package biblatex or not? Some of your comments make me think you mixed up BibTeX, biblatex and principles of building bib files.

The following MWE shows you the usage of biblatex with some package options to controll the layout of your bibliography. What you at last need you can read in the manual of package biblatex, try texdoc biblatex.

Please have a look on the comments in my MWE.

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{solarfarm, 
  author  = {Buckley, Alastair and nee Hall, Lisa Clark and {Colantuono, Giuseppe Everard}, Aldous}, 
  file    = {:Users/Desktop/Downloaded/85c4687c.html:html}, 
  title   = {{The Sheffield Solar Farm}}, 
  url     = {http://www.sheffieldsolarfarm.group.shef.ac.uk/solar-panel-data}, 
  urldate = {2013-05-16}, 
}
\end{filecontents}


\documentclass[12pt,a4paper]{article}
\usepackage[%
  backend=bibtex      % biber or bibtex
%,style=authoryear    % Alphabeticalsch
 ,style=numeric-comp  % numerical-compressed
 ,sorting=none        % no sorting
 ,sortcites=true      % some other example options ...
 ,block=none
 ,indexing=false
 ,citereset=none
 ,isbn=true
 ,url=true
 ,doi=true            % prints doi
 ,natbib=true         % if you need natbib functions
]{biblatex}
\addbibresource{\jobname.bib}  % better than \bibliography

\begin{document}
Text \cite{solarfarm} Text.
\printbibliography
\end{document}

The result will be: enter image description here

Mensch
  • 65,388
12

you say you want to make biblatex use the urldate field, but the most important thing seems to be missing from your example: \usepackage{biblatex}. ...if you really want to use biblatex: your MWE and your question (title, tags) provide conflicting information.

\documentclass[12pt,a4paper]{article}
\usepackage[sorting=nyt,firstinits=true]{biblatex}
\usepackage{filecontents}

\begin{filecontents}{testbib.bib}
@online{solarfarm,
author = {Buckley, Alastair and nee Hall, Lisa Clark and {Colantuono, Giuseppe Everard}, Aldous},
file = {:Users/Desktop/Downloaded/85c4687c.html:html},
title = {{The Sheffield Solar Farm}},
url = {http://www.sheffieldsolarfarm.group.shef.ac.uk/solar-panel-data},
urldate = {2013-05-16}
}
@online{solarfarm2,
author = {Auckley, Alastair and nee Hall, Lisa Clark and {Colantuono, Giuseppe Everard}, Aldous},
file = {:Users/Desktop/Downloaded/85c4687c.html:html},
title = {{The Sheffield Solar Farm}},
url = {http://www.sheffieldsolarfarm.group.shef.ac.uk/solar-panel-data},
urldate = {2013-05-16}
}
\end{filecontents}

\bibliography{testbib.bib}

\begin{document}
\cite{solarfarm}
\cite{solarfarm2}
\printbibliography
\end{document}

Biblatex will print the URL's date automatically, so if an urldate field is present, no further action is required. enter image description here

Nils L
  • 9,716
  • But I want to use the .bib file, not manually insert it there – Razor Apr 30 '13 at 20:40
  • sure, but you're the only one who actually has your bib file. We need to create it via filecontents, for testing and demonstration purposes. You may simply remove that section. In other words: that filecontents section has nothing to do with the problem your question relates to. It's all about properly loading the biblatex package. – Nils L Apr 30 '13 at 20:46
  • ...unless that biblatex in your question title is a mistake, i.e. you're not intending to use biblatex at all. – Nils L Apr 30 '13 at 20:54
  • I tried adding that package and I get an error saying that the .bbl file was not created by biblatex .. I'm using Mendeley to organise my references. Is that causing a problem ? – Razor Apr 30 '13 at 20:57
  • don't know much about Mendeley, but if that's the tool that creates your .bib files, that's not going to cause that problem. The .bbl file might be a leftover from the time before you inserted biblatex. You can safely delete it (it's a temporary file that's re-created as required), and thus give biblatex a chance to create a new one that it can work with. – Nils L Apr 30 '13 at 21:02
  • I did that and I got another error saying Package biblatex Error \bibliographystyle invalid - 1048 \bibliographystyle{abbrv} – Razor Apr 30 '13 at 21:12
  • @Razor: what Kurt said, plus: if you want to give biblatex a try, use, for example, the code example I gave you, without modifiying it; see if it works without any errors; and then start modifying it to suit your taste. If you simply take a line like \usepackage{biblatex} and insert it into your above example, things are not going to work (as you've noticed already). – Nils L May 01 '13 at 06:52