[Tex/LaTex] How to tell bibtex to ignore the citations in the abstract when numbering the references

bibtexcitingieee-styleieeetran

I use the IEEEtran bibliography style for my article. By default, the first-cited reference cited in the document is numbered as [1], the second one as [2], and so on.

This seems to be IEEE's standard. However, there is a problem when I cite something in the abstract. Since the document starts with the abstract, that particular reference is numbered as [1] while it is the tenth reference cited in the text. I want to avoid this. That is, to start numbering the references in the order they appear in the main text, ignoring the abstract and then putting the corresponding number in the abstract (in my example, the reference in the abstract should appear as [10] rather than [1]).

I found a trick to do so, which is to first comment out the citation in the abstract, run the bibtex (so that it doesn't see it there and number it according to where it appears in the text), and then put it back. This works fine but I should always be careful to do these steps before rerunning the bibtex (e.g. when I add a reference, …).

I was wondering if there is a way to automatically tell bibtex to ignore the abstract for the numbering?


Here is a MWE:

\documentclass[conference]{IEEEtran}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
  @article{article1,
    author = {Author 1},
    title  = {Title 1},
    year   = 1993,
    month  = may,
    pages  = {10--15}
  }

  @inproceedings{article2,
    author = {Author 2},
    booktitle  = {Conference Title},
    title  = {Article 2},
    year   = 1975,
    month  = aug,
    pages  = {120--125}
  }

  @book{book1,
    author = {Autor 3},
    title = {Book Title},
    publishe = {Publisher},
    year = 2005
  }
}
\end{filecontents}




\usepackage{cite}

\hyphenation{op-tical net-works semi-conduc-tor}


\begin{document}
\title{MWE}
% make the title area
\maketitle

\begin{abstract}
  This article \cite{article2} is numbered as [1] while I would like it to be
  numbered (and referenced to) as [2].
\end{abstract}

In fact, \cite{article1} is the one that I want to be numbered as [1], then
\cite{article2} as [2] and finally \cite{book1} as [3] as they appear in this
order in the article body. 

\bibliographystyle{IEEEtran}
\bibliography{\jobname}
\end{document}

Best Answer

A possible trick is to wrap the citation in the abstract in a \IfFileExists{\jobname.bbl}{}{} test, and use the following workflow

rm <filename>.bbl 
pdflatex <filename>  
bibtex <filename> 
pdflatex <filename> 
pdflatex <filename>

You can use array to specify the workflow.

\documentclass[conference]{IEEEtran}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
  @article{article1,
    author = {Author 1},
    title  = {Title 1},
    year   = 1993,
    month  = may,
    pages  = {10--15}
  }

  @inproceedings{article2,
    author = {Author 2},
    booktitle  = {Conference Title},
    title  = {Article 2},
    year   = 1975,
    month  = aug,
    pages  = {120--125}
  }

  @book{book1,
    author = {Autor 3},
    title = {Book Title},
    publishe = {Publisher},
    year = 2005
  }
}
\end{filecontents}

\usepackage{cite}


\begin{document}
\title{MWE}

\maketitle

\begin{abstract}
  This article \IfFileExists{\jobname.bbl}{\cite{article2}}{*} is
  numbered as [1] while I would like it to be numbered (and 
  referenced to) as [2].
\end{abstract}

In fact, \cite{article1} is the one that I want to be numbered as [1], then
\cite{article2} as [2] and finally \cite{book1} as [3] as they appear in this
order in the article body. 

\bibliographystyle{IEEEtran}
\bibliography{\jobname}
\end{document}

After the first run you get:

enter image description here

After running bibtex and the second pdflatex run you have

enter image description here

and finally:

enter image description here

Related Question