[Tex/LaTex] Which bibliographystyle for lastchecked and URL attribute

bibliographiesbibtex

I noticed that lastchecked and URL are non-standard attributes for a bibTeX files, which is kind of strange nowadays, but that's a different matter.

I tried to use @misc{...} with itmalpha style, but my document doesn't show the two attributes. Which style can I use for it to display, which doesn't mess up my other references, which are articles and incollections (for now).

Best Answer

In most bibtex styles the information about url and the date when the web page has been accessed can be stored in the howpublished field (in free format).

A second alternative is to modify the itmalpha style to accommodate the two fields. The styles does not support url and lastchecked. Thus the first step is to insert these two fields in the ENTRY part of the style:

ENTRY
  { address
    ...
    lastchecked
    url
    ...
  }
  {}
  { label extra.label sort.label }

Then, we create a function to print the value of the fields. Thus we insert the following code in the file

FUNCTION {format.url.lastchecked}
{
  url empty$
    'skip$
    { "Available at: \url{" url * "}" * 
      lastchecked empty$
        'skip$
        { "Accessed on: "  lastchecked * }
      if$
    }
  if$
}

Finally, we have to use the function at the appropriate position (in the definition of misc). We can replace the definition of misc with

FUNCTION {misc}
{ output.bibitem
  author empty$                               % added by R.Bless
    { format.editors output.nonnull }          % added by R.Bless
    { format.authors "author" output.check }   % added by R.Bless
  if$
  title howpublished new.block.checkb
  format.title output
  howpublished new.block.checka
  howpublished output
  organization output
  institution output
  format.date output
  fin.entry
  format.url.lastchecked output
  new.block
  note output
  fin.entry
  empty.misc.check
}

Instead of editing the itmalpha.sty file, please make a copy, edit it, and rename it (e.g. myitmalpha.sty).

PS I have used \url{} to wrap the value of the bibtex url field, this requires to load an appropriate style, e.g., url or hyperref.