
Como se pode obter uma citação como a do título quando algumas referências são consecutivas, por exemplo: o código
\cite{ref1,ref3-ref7}
não funciona. No entanto, vejo isso em muitos artigos.
Existe alguma maneira simples de fazer isso?
Digamos que estou usando o seguinte código simples
\documentclass{article}
\begin{document}
\cite{a, d,e,f,g,h}
\begin{thebibliography}{99}
\bibitem{a} Ref1
\bibitem{b} Ref2
\bibitem{d} Ref3
\bibitem{e} Ref4
\bibitem{f} Ref5
\bibitem{g} Ref6
\bibitem{h} Ref7
\end{thebibliography}
\end{document}
Então \cite{a, d,e,f,g,h}
dá [1,3,4,5,6,7].
Responder1
Por padrão, a ordem das entradas no arquivo bib não tem significado. Portanto,
\cite{ref1,ref3-ref7}
temsem chance algumade trabalho. Na verdade, o BibTeX emitirá um aviso de que não foi possível encontrar uma entrada com chave ref3-ref7
no arquivo bib.
O cite
pacote permite múltiplos argumentos em uma única \cite
instrução e realiza classificação e compactação (a menos que seja instruído a não fazê-lo). Se o cite
pacote estiver carregado, então
\cite{ref1,ref3,ref4,ref5,ref6,ref7}
de fato gerará
[1, 3--7]
desde que a ref2
entrada também seja citada em algum lugar do documento. (Obviamente, para que este exemplo simples funcione, devo assumir que ref1
through ref7
será classificado nessa ordem na bibliografia composta.)
\documentclass{article}
\begin{filecontents*}[overwrite]{mybib.bib}
@misc{a,author="A",title="Thoughts",year=3001}
@misc{b,author="B",title="Thoughts",year=3002}
@misc{c,author="C",title="Thoughts",year=3003}
@misc{d,author="D",title="Thoughts",year=3004}
@misc{e,author="E",title="Thoughts",year=3005}
@misc{f,author="F",title="Thoughts",year=3006}
@misc{g,author="G",title="Thoughts",year=3007}
\end{filecontents*}
\usepackage{cite}
\bibliographystyle{plain}
\begin{document}
\cite{b}
\cite{a,c,d,e,f,g}
\bibliography{mybib}
\end{document}