To simplify your work you can also work with biblatex
. To complete the answer here an example:
\documentclass[12pt,a4paper]{article}
\usepackage[style=numeric,sortcites]{biblatex}
\addbibresource{biblatex-examples.bib}
\renewbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printfield{prefixnumber}%
\printfield{labelnumber}%
\ifbool{bbx:subentry}%
{\printfield{entrysetcount}}%
\ifnumequal{\value{citecount}}{\value{citetotal}-1}%
{\gdef\multicitedelim{\addspace\bibstring{and}\space}}%
{\gdef\multicitedelim{\addcomma\space}}%
}%
}
\begin{document}
\cite{companion,ctan,knuth:ct:a}
\cite{companion,ctan,knuth:ct:a}
\cite{companion,ctan}
\cite{knuth:ct:a}
\printbibliography
\end{document}
It need the compilation
pdflatex
biber
pdflatex
pdflatex
You can use the package cite
with a minor modification. Define a command citeduo
where the separator is and
instead of ,
.
\documentclass[12pt,a4paper]{report}
\usepackage{cite}
\newcommand*\citeduo[1]{%
\bgroup%
\def\citepunct{\ and\ }%
\cite{#1}%
\egroup%
}
\begin{document}
we have transform from $ A : f \rightarrow g $ \citeduo{Arcoya,Nassor}
\begin{thebibliography}{30}
\addcontentsline{toc}{chapter}{Bibliography}
\bibitem{Arcoya} D. Arcoya, \emph{An Introduction to Problems}, Springer, 2011.
\bibitem{Nassor} Nassor, \emph{On the Uniqueness}, pages 377-390, (1992).
\end{thebibliography}
\end{document}
However for all your previous projects I recommend biblatex
with an external bib-file
.
EDIT
Modified version to separat cite's:
\documentclass[12pt,a4paper]{report}
\usepackage[nocompress]{cite}
\usepackage{xparse}
\ExplSyntaxOn
\clist_new:N \mathcal_cite_clist
\NewDocumentCommand \mycite { m }
{
\group_begin:
\citeleft
\int_compare:nNnTF { \clist_count:n { #1 } } = { 1 }
{ \citen { #1 } }
{
\clist_set:No \mathcal_cite_clist { #1 }
\mathcal_output_cite:
}
\citeright
\group_end:
}
\cs_new:Npn \mathcal_output_cite:
{
\int_compare:nNnTF { \clist_count:N \mathcal_cite_clist } = { 2 }
{ \mathcal_output_duo_cite:n { \mathcal_cite_clist } }
{
\clist_gpop:NN \mathcal_cite_clist \l_tmpa_tl
\citen { \tl_use:N \l_tmpa_tl } \citepunct
\mathcal_output_cite:
}
}
\cs_new:Npn \mathcal_output_duo_cite:n #1
{
\group_begin:
\def\citepunct{\ and\ }
\citen{ #1 }
\group_end:
}
\ExplSyntaxOff
\newcommand*\citeduo[1]{%
\bgroup%
\def\citepunct{\ and\ }%
\citen{#1}%
\egroup%
}
\begin{document}
we have transform from $ A : f \rightarrow g $ \mycite{Arcoya,Nassor,temp}
\mycite{Arcoya,Nassor}
\mycite{Arcoya}
\begin{thebibliography}{30}
\addcontentsline{toc}{chapter}{Bibliography}
\bibitem{Arcoya} D. Arcoya, \emph{An Introduction to Problems}, Springer, 2011.
\bibitem{Nassor} Nassor, \emph{On the Uniqueness}, pages 377-390, (1992).
\bibitem{temp} temp
\end{thebibliography}
\end{document}