The cite, natbib, and biblatex packages, at least, will all do this.
A minimal example which demonstrates the behaviour is:
\documentclass{article}
\begin{document}
hello \cite{article-full,book-full,mastersthesis-full}
\bibliographystyle{unsrt}
\bibliography{xampl}
\end{document}
If you have basic bibliography needs, adding \usepackage{cite} will produce the desired behaviour.
If you have more complex bibliography needs, nowadays I recommend biblatex as a first choice, although natbib has a long and distinguished history in this space and is possibly a better option if you want a more ‘stable’ solution.
For biblatex, you would now write this example as:
\documentclass{article}
\usepackage[style=numeric-comp]{biblatex}
\bibliography{xampl}
\begin{document}
hello \cite{article-full,book-full,mastersthesis-full}
\printbibliography
\end{document}
Noting that you need to process the bibliography using biber instead of bibtex. (You can use bibtex by adding backend=bibtex to the package options, but I'm not sure if that is currently recommended for new documents.)
If you are using natbib, a minimal example would be:
\documentclass{article}
\usepackage[numbers,sort&compress]{natbib}
\begin{document}
hello \citep{article-full,booklet-full,mastersthesis-full}
\bibliographystyle{unsrtnat}
\bibliography{xampl}
\end{document}
citepackage. That gives a minimal work solution to my problem. Thanks. – Willie Wong Oct 07 '10 at 15:50amsrefspackage can do it, but I didn't feel like retyping 92 citation entries.) – Willie Wong Oct 07 '10 at 15:52biblatexhasn't been tested withamsart, and i can't predict whether it will work; i'm inclined to think it may not be totally smooth sailing. – barbara beeton Dec 30 '11 at 21:32natbibdoes not like the{}directly in front of years. Apart from that, good update. It will be more helpful in the future. By the way, i started to rewrite parts of the wikibook -> https://en.wikibooks.org/wiki/LaTeX/Creating_a_Bibliography – Johannes_B Aug 27 '17 at 12:02Missing } inserted.andExtra }, or forgotten \endgroup., same for biber, both exporting bibtex and biblatex with Zotero. Am I doing something obviously wrong? – Trylks Mar 04 '21 at 11:34