LaTeX/BibTex 不按出现顺序排列引用

LaTeX/BibTex 不按出现顺序排列引用

我在使用 LaTex/Bibtex 按显示顺序显示我的引文时遇到了问题。我知道这方面有很多问题,我也读过一些,但发布的解决方案似乎对我没什么用。我使用的是 MacTeX 和 TeXmaker。

我正在写一篇大型文档,比如一篇论文。各章被拆分到单独的 Tex 文件中,并使用 \include 命令将其包含进去。

我有一个由 Mendeley(我用来存储参考文献和生成 BibTex 文件的程序)维护的大型 .bib 文件。

我正在使用包,cite(主要用于做[1-3,6,9]之类的引用)

我有一份看上去非常标准的文档。

\documentclass[11pt,a4paper]{report}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\newcommand{\doubleSignature}[3][Alex Mason]{%
\parbox{\textwidth}{
\centering #3 \today\\
\vspace{2cm}

\parbox{7cm}{
  \centering
  \rule{6cm}{1pt}\\
   #1 
}
\hfill
\parbox{7cm}{
  \centering
  \rule{6cm}{1pt}\\
  #2
}
}
}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
%\usepackage[sorting=none]{biblatex}
%\bibliography{Alex} % Where journals.bib and phd-references.bi
\usepackage[pdftex]{graphicx}
\usepackage{enumerate}
\usepackage{nomencl}
\usepackage{wasysym}
\usepackage{booktabs}
\usepackage{cite}
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
\graphicspath{{./Diagrams/}}
\usepackage[labelfont={sf,bf}, margin=1cm]{caption}
\usepackage{subcaption}
\renewcommand{\figurename}{Fig.}
\renewcommand{\tablename}{Tab.}
\renewcommand{\bibname}{References}
\author{NAME (MEng)}
\title{TITLE}
\date{\today}
\makenomenclature
%------------------------------------------------
\begin{document}
\maketitle
\pagenumbering{roman}
%-----------------------------------------------certificate of originality----------------      --------------------------------------------
\input{CertofOrigin}
\begin{abstract}
ABSTRACT
\end{abstract}
%-----------------------------------------------contents------------------------------------------------------------
\tableofcontents
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}
\chapter*{Acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}
ACKNOWLEDGEMENTS
\printnomenclature[1.5in]
\addcontentsline{toc}{chapter}{Nomenclature}
\pagebreak
\pagenumbering{arabic}
\include{2ndYearReport_CHAP1}
\include{2ndYearReport_CHAP2}
\include{2ndYearReport_CHAP3}
\bibliographystyle{unsrt}
\bibliography{Alex}
%\printbibliography
\end{document}

顶部的傻乎乎的部分(\newcommand{doubleSig.....)只是为了当我输入一个我制作的特殊页面时,其中包含一份原创性证书,其中有两个用于签名的框和我的大学徽标。

如您所见,我使用标准的 bibtex 方法来制作参考书目,即在文档末尾说明样式,然后说明要使用的 bib 文件。我试过 biblatex,但无法正常工作。它说它没有生成 bib 文件,但没有说明原因。

据我所知,一切都运行正常,直到我开始第二章并开始在其中添加引文。现在我的引文全都乱了,无法更正。我的第一个引文以 [9] 开头!!!

在调用 10、11 和 12 之后,[1] 出现在页面下方的图形标题中!

我尝试删除所有工作文件(bbl、aux、log 等),但什么也没发生。我得到了相同的结果。我记得我以前使用 MS Word 时也遇到过这个问题,这也是我改用 LaTex 的原因之一……但它似乎一直跟着我!

bibtex 在运行时会发出一些警告,指出一些参考文献缺少期刊名称或卷号。这是原因吗?

我的代码哪里错了?

答案1

当您的标题中有引文时,这个问题总是会出现,或者在文档分部标题中可能不太常见。默认情况下,LaTeX 使用图片列表、表格列表或目录中的引文作为“第一个”引文,因为它出现在正文之前。

解决此问题的选项包括:

  1. 添加notoccite打包到你的序言中。
  2. 命令\ignorecitefornumbering如下让 BibTeX 忽略图片标题中的引用编号其功能与 notoccite 大致相同。
  3. 修改有问题的标题,使其具有以下形式\caption[Caption without citation that appears in the List of Figures or Tables]{Caption with citation that appears with the figure or table itself}

如果由我决定,我会选择选项 1。有些编辑或论文委员会可能更喜欢选项 2。选项 1 的示例(包括natbib命令\citeauthor如下:

在此处输入图片描述

\documentclass{article}
\usepackage[numbers]{natbib}
\usepackage{notoccite}
% If you have \cite commands in \section-like commands, or in \caption, the
% citation will also appear in the table of contents, or list of whatever.
% If you are also using an unsrt-like bibliography style, these citations
% will come at the very start of the bibliography, which is confusing. This
% package suppresses the effect.

\begin{filecontents}{\jobname.bib}
@misc{foo,
 author = {Foo},
 title = {Title of Foo},
}
@misc{bar,
 author = {Bar},
 title = {Title of Bar},
}
@misc{baz,
 author = {Baz},
 title = {Title of Baz},
}
\end{filecontents}

\begin{document}
\listoffigures

%\chapter{Introduction}
\section{The Beginning}
Here we cite \citeauthor{foo} \cite{foo}.
Now we cite \citeauthor{bar} \cite{bar}.
Finally, we cite \citeauthor{baz} \cite{baz}.
\begin{figure}[htbp]
\centering
\framebox[0.5\textwidth]{Here's a figure.}
\caption{Figure from \cite{bar}, which should most definitely \textbf{not}
         be numbered [1] in the LoF}
\end{figure}
\bibliographystyle{unsrtnat}
\bibliography{\jobname}
\end{document}

答案2

选择书目Document»Settings»Bibliography样式Default (numerical)。然后转到Latex preamble部分并编写以下代码:

\bibliographystyle{unsrtnat}
\usepackage[numbers,sort&compress]{natbib}

这对我有用,对你也应该有用。

答案3

即使这个问题已经很老了,也许问这个问题的人已经不关心它了,我还是想根据我的经验添加答案!所以当我写这篇文章的时候,我遇到了同样的问题,即使解决方案看起来很简单,我也花了很长时间才弄清楚!我只需要将样式从 {plain} 更改为 {unsrt} 就够了!

\bibliographystyle{unsrt}

转到此链接中的参考书目样式

答案4

如果您的引用编号没有按顺序出现,请尝试更改编译器。 在我的情况下,它起作用了。 请记住,某些命令/包是特定于编译器的。

LaTeX 编译器选项

相关内容