This question is related to a question I asked earlier here. I wanted to cite references in order of appearance without Bibtex and the answer did exactly that. However, consider I have the following bibliography:
\begin{thebibliography}{C}
\bibitem{ref1}{AAAA}
\bibitem{ref2}{BBBB}
\bibitem{ref3}{CCCC}
\bibitem{ref4}{DDDD}
\bibitem{ref5}{EEEE}
\end{thebibliography}
The code \cite{ref2} and \cite{ref3, ref4, ref5} will give [1] and [2,3,4] and what I want is [1] and [2-4] instead. How can I alter the code given in the previous answer? Note that using \usepackage{cite} will output [1] and [4-6] which is not in the order of appearance.
![The citations read "[1] and [2–4]"](../../images/e66f88e24c85c7075135e33fdbaf856b.webp)