0

When I use the apalike bibliography style, by specifying this command

\bibliographystyle{apalike}

and I write a @misc item like the one below:

@misc{someURL,
    title = {Title of some webpage},
    url = {https://someurl.org},
    note = "\url{https://someurl.org}"
}

then Bibtex complains with the following message:

Warning--to sort, need author or key in someURL

Since there is no specific author, I try to put a key like this:

@misc{someURL,
    key = {Webpage},
    title = {Title of some webpage},
    url = {https://someurl.org}
    note = "\url{https://someurl.org}\EatDot"
}

But then I get an output like this:

Redundant key example

Apart from the empty year after the comma (for which I posted a separate question), it is very frustrating that the key appears both inside the brackets and also before the title, since I only wanted it inside the brackets just to help Bibtex sort the reference with apalike.

Is there a way to specify that the key should only appear inside the square brackets (and not before the title), just for sorting purposes?

5
  • Could you please provide a MWE
    – Steradiant
    May 29, 2020 at 9:15
  • @Steradiant is the example I provided not a MWE ? what is it missing from that point of view? Btw, I improved it by adding the code to show how I select the apalike style, and I also figured out how to solve the problem, so I added an answer as well. May 29, 2020 at 9:37
  • 1
    For future reference: The code shown in the question so far is not an MWE. An MWE is generally a single block of code that shows a complete document starting with \documentclass{...} containing just enough preamble code and document contents in between \begin{document}...\end{document} to reproduce what you are seeing. Ideally an MWE should be self-contained without reference to external files we don't have and should be compilable as posted. (.bib files can be given separately, though there are ways to generate them in-line).
    – moewe
    May 29, 2020 at 13:25
  • Here is what an MWE in your case would have ideally looked like: gist.github.com/moewew/c45988c6d1368643a2dd849858247981. It doesn't have to look exactly like that of course, but the most important bits should be there (but not too much). Writing an MWE is an art of its own and it can take some time at first. Sometimes you will find the error yourself while you prepare the MWE, though, and in any case it makes it much more likely you get a good answer quickly, so it is definitely worth your while. See also tex.meta.stackexchange.com/q/6255/35864
    – moewe
    May 29, 2020 at 13:28
  • Thanks for this explanation @moewe May 29, 2020 at 14:00

1 Answer 1

1

Just found the solution... if you also import the apalike package in the preamble of your document, which is what the apalike BST file recommends, i.e. if you do this:

\usepackage{apalike}

then the redundancy disappears, as you can see below:

enter image description here

That is, the way bibliography items are reported changes accordingly, and the key Webpage is reported just once, for (alphabetic) sorting purposes, with no redundancies.

Note: The key is not in square brackets as I would have expected, but it is just because of the different style used by apalike.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .