如何告诉 bibtex 在编号参考文献时忽略摘要中的引用?

如何告诉 bibtex 在编号参考文献时忽略摘要中的引用?

我用IEEEtran我的文章的参考书目样式。默认情况下,文档中引用的第一个参考文献编号为 [1],第二个参考文献编号为 [2],依此类推。

这似乎是 IEEE 的标准。但是,当我在摘要中引用某些内容时,会出现问题。由于文档以摘要开头,因此该特定参考文献的编号为 [1],而它是摘要中引用的第十个参考文献文本。我想避免这种情况。也就是说,按照参考文献在正文中出现的顺序开始编号,忽略摘要然后在摘要中输入相应的编号(在我的例子中,摘要中的参考文献应该显示为[10]而不是[1])。

我发现了一个技巧,即首先注释掉摘要中的引文,运行 bibtex(这样它就不会在那里看到它并根据它在文本中出现的位置对其进行编号),然后将其放回原处。这很有效,但在重新运行 bibtex 之前,我应该始终小心地执行这些步骤(例如,当我添加参考文献时,...)。

我想知道是否有办法自动告诉 bibtex 忽略摘要的编号?


以下是 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}

答案1

一个可能的技巧是将引用包装在摘要中进行\IfFileExists{\jobname.bbl}{}{}测试,并使用以下工作流程

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

您可以使用array来指定工作流程。

\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}

第一次运行后您将获得:

在此处输入图片描述

跑步bibtex和第二次pdflatex跑步后,你

在此处输入图片描述

最后:

在此处输入图片描述

答案2

您应该插入指令\nocite{article1} 环境abstract。这样,[1]即使指令没有生成引用调用,它也会被编号\nocite

在此处输入图片描述

\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
\nocite{article1}  % dummy reference to "article1"
\begin{abstract}
This article \cite{article2} is numbered as [2], which is exactly what I want.
\end{abstract}

Happily, \cite{article1} is now numbered as~[1], then \cite{article2} as~[2], and finally \cite{book1} as~[3]. 

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

相关内容