[Tex/LaTex] Referring to a website with bibtex

bibtexieeetranurls

I'm referring to a website using the ieeetr bibliography style. Therefore, I tried the following:

@online{testwebsite,
author={Foo},
title={{Test Website}},
url={http://test.com},
urldate={2016-02-01},
}

I receive the following error: Entry type for "…" isn't style-file defined and it shows only the reference as follows: [1] Foo, "Test Website.", while I would like to show the URL of the website with the url date.

Best Answer

There is no @online entry type in the ieeetr style, and ieeetr does neither support url nor urldate fields. You may use the @misc type with a note field, like

@misc{testwebsite,
    author={Foo},
    title={{Test Website}},
    note={\url{http://test.com}, accessed 2016-02-01},
}

Or, you can use the howpublished field for the url; see also Referring to a website in `bibtex`.

As Mico pointed out, ieeetr is outdated. You should prefer IEEEtran (or IEEEtranN for natbib support).

IEEEtran supports an electronic entry type (however, this is a non-standard field and should be avoided if you want to be compatible with other style files). urldate is also non-standard and should be avoided if you want to typeset it in a bibliography (imho — if you know what you are doing, that may be fine, of course).

If you use IEEEtran (or any other recent BibTeX style), you can use the url field for the actual URL and put the date in the note field, like this:

@misc{testwebsite,
    author={Foo},
    title={{Test Website}},
    url={http://test.com},
    note={accessed 2016-02-01},
}