[Tex/LaTex] Referencing Webpage using “apalike” and “natbib

apa-stylenatbib

I need to reference some websites in my paper using APA style, I am using natbib and apalike in my tex file.

Here is my bibtex record

@misc{cnn2011rahm,
    Author = {Editor CNN},
    Date-Added = {2013-11-21 09:15:03 +0000},
    Date-Modified = {2013-11-21 09:26:00 +0000},
    Howpublished = {http://edition.cnn.com/2011/POLITICS/01/27/emanuel.ballot/},
    Lastchecked = {Nov 01, 2013},
    Month = {January},
    Title = {Illinois Supreme Court keeps Emanuel on ballot},
    Url = {http://edition.cnn.com/2011/POLITICS/01/27/emanuel.ballot/},
    Urldate = {Jan 28, 2011},
    Year = {2011}}

But when it was render, it is showed this way

enter image description here

And the necessary information e.g. last accessed is not shown, may I know how do I fix this?

Best Answer

The apalike bibliography style has been around more or less unchanged since 1988. Back then, web pages didn't exist yet -- at least not as items that might be cited in bibliographies. The entry type @misc thus doesn't recognize, and hence blissfully ignores, fields named url, urldate, and lastchecked.

A workaround involves these steps:

  • rename the field Lastchecked to note,
  • modify the contents of the note field from Nov 01, 2013 to Last accessed on Nov 01, 2013, and (optionally)
  • encase the URL string in the howpublished field in a \url{...} wrapper.

Separately, you should also encase the contents of the author and title fields in pairs of curly braces. This prevents BibTeX from (a) misinterpreting the author as a person with first name Editor and last name CNN and (b) lowercasing the words Supreme, Court, and Emanuel in the title field.

Aside: If you need to cite a lot of web pages, you may be better off in the long run choosing a bibliography style which does know what to do with fields named url, urldate, and lastchecked.

Here's an MWE that implements these ideas. Note the changes I applied to the following fields: author, title, howpublished, and urldate (renamed to note).

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{rahm.bib}
@misc{cnn2011rahm,
    Author = {{Editor CNN}},
    Date-Added = {2013-11-21 09:15:03 +0000},
    Date-Modified = {2013-11-21 09:26:00 +0000},
    Howpublished = {\url{http://edition.cnn.com/2011/POLITICS/01/27/emanuel.ballot/}},
    note = {Last checked on Nov~01, 2013},
    Month = {January},
    Title = {Illinois {Supreme Court} keeps {Emanuel} on ballot},
    Url = {http://edition.cnn.com/2011/POLITICS/01/27/emanuel.ballot/},
    Urldate = {Jan 28, 2011},
    Year = {2011},
}
\end{filecontents}

\documentclass{article}
\usepackage{natbib}
\bibliographystyle{apalike}
\usepackage[hyphens]{url} % <-- new

\begin{document}
\noindent
\cite{cnn2011rahm} reports that \dots
\bibliography{rahm}
\end{document}
Related Question