[Tex/LaTex] Wrong style of citation using misc entry in bibtex

bibtex

I'm using BibTeX to cite the references in my LaTeX file. I have one entry (citing an url using the entrytype @misc). The default style is the author-year mode using the apalike style.

This is the entry \cite{url-1}.

The expected output is

This is the entry [url-1].

But, I get the output as

This is the entry [url-1, ].

The BibTeX entry does not have year field. This is

@misc{url-1,
key={url-1},
url={some website},
}

How do I eliminate the extra spacing for the year field. Even if I add an empty field for year like year={}, I still get the same format.

Best Answer

Since the apalike bibliography style is meant to generate authoryear-style citation callouts, the designer of the style file apparently didn't anticipate that there would be entries (of type @misc, say) that do not have a year field.

Here's a simple work-around: Load the natbib package, and use that package's instruction

\citeauthor{url-1}

instead of \cite{url-1}. As you can probably guess, \citeauthor outputs just the author(s), but not the year.

Related Question