我已经创建了一个 BibTeX 文件ref1.bib
并在我的 LaTeX 文件中调用它。
然而参考文献不是按引用顺序打印。它们是随机打印的。请提出修改意见,以按正确顺序打印参考文献。
我的代码如下:
\documentclass[12pt,a4paper,twosided]{report}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{ragged2e}
\usepackage{txfonts, helvet} %other fonts pxfonts, fourier, lomdern%
\usepackage{graphicx}
\graphicspath{{F:/Figures/}}
\usepackage[a4paper, left=1in, right=1in, top=1in, bottom=1in]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage{natbib} %for bibliography
\usepackage[T1]{fontenc}
\usepackage{enumitem}
\usepackage{multicol}%for multicolumn documents
\usepackage{multirow,rotating}
\usepackage{titlesec}
\titleformat{\chapter}
{\centering\normalfont\LARGE\bfseries}{\thechapter.}{1em}{}
\setcounter{secnumdepth}{2} %numbering of subsection upto 4th level
%body of the document
\begin{document}
\pagenumbering{gobble}
\input{titlepage_progress_report1_jan2018}
\clearpage
\pagenumbering{roman}
\tableofcontents
\listoftables
\listoffigures
\clearpage
\pagenumbering{arabic}
\chapter{Introduction}
\paragraph{} With the rapid development of multiple types of sensors in various fields, abundent data has become available for research. Same is true with imaging sensors used in the field of remote sensing. Thus, there is a need to gather information from various images and combine it into a single one so that additional information can be extracted out of it. Image fusion deals with same. Formally, Image fusion is the combination of two or more different images to form a new image by using a certain algorithm \cite{klein1993sensor,pohl1998review}. Information from different images is combined so that image becomes more meaningful and suitable for visual perception and computer processing.
Images obtained from different sensors certainly carry different information and if this information is combined, it is more informative than image obtained from single source. Image fusion is an optimal way of representing information from different images into a single one and this fused information can be used for planning and decision making. \subparagraph{} Various satellites observing earth, are capturing data in different parts of the electromagnetic spectrum and hence different remotely sensed data products like multispectral (MS), panchromatic(PAN), hyperspectral (HS) and synthetic aperture radar (SAR) imagery are available. These data products convey different information about earth area under observation. Information from these data products is useful for different applications like forecasting crop yield , mapping of forest cover, weather prediction, watershed development, monitoring urban sprawl mapping of various cities and disaster management etc. \cite{flusser2007image,ghassemian2016review,pandit2015image}.
\chapter{Literature Survey}
\chapter{Speckle Reduction in SAR Imagery}
\chapter{Conclusion}
\bibliographystyle{plain}
\bibliography{ref1}
\end{document}
答案1
因为您没有提供 bib 文件,所以很难测试您的代码。
我已经根据您的代码创建了一个最小化的代码,并使用如下示例 bib 文件:
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
DOI = "http://dx.doi.org/10.1002/andp.19053221004",
keywords = "physics",
}
@book{dirac,
title={The Principles of Quantum Mechanics},
author={Paul Adrien Maurice Dirac},
isbn={9780198520115},
series={International series of monographs on physics},
year={1981},
publisher={Clarendon Press},
keywords = {physics},
}
\end{filecontents*}
\documentclass[12pt,a4paper,twosided]{article} % report <===============
\usepackage[T1]{fontenc}
\usepackage{natbib} %for bibliography <=================================
\begin{document}
algorithm \cite{einstein}. text \cite{dirac}.
\bibliographystyle{unsrtnat} % plainnat unsrtnat abrvnat <==============
\bibliography{\jobname}
\end{document}
因为您正在打电话,natbib
所以您需要使用书目样式unsrtnat
。我将其更改report
为article
在同一个页面上包含引用和书目...
以下是最终的 pdf:
编辑:
如果不使用,natbib
您需要以下代码来获得所需的结果(请参阅unsrt
按引用顺序提供参考书目的样式):
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
DOI = "http://dx.doi.org/10.1002/andp.19053221004",
keywords = "physics",
}
@book{dirac,
title={The Principles of Quantum Mechanics},
author={Paul Adrien Maurice Dirac},
isbn={9780198520115},
series={International series of monographs on physics},
year={1981},
publisher={Clarendon Press},
keywords = {physics},
}
\end{filecontents*}
\documentclass[12pt,a4paper,twosided]{article} % report <===============
\usepackage[T1]{fontenc}
\begin{document}
algorithm \cite{einstein}. text \cite{dirac}.
\bibliographystyle{unsrt} % plain unsrt abrv <==============
\bibliography{\jobname}
\end{document}
结果如下:
或者natbib
您必须添加选项numbers
并natbib
使用样式unsrtnat
:
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
DOI = "http://dx.doi.org/10.1002/andp.19053221004",
keywords = "physics",
}
@book{dirac,
title={The Principles of Quantum Mechanics},
author={Paul Adrien Maurice Dirac},
isbn={9780198520115},
series={International series of monographs on physics},
year={1981},
publisher={Clarendon Press},
keywords = {physics},
}
\end{filecontents*}
\documentclass[12pt,a4paper,twosided]{article} % report <===============
\usepackage[T1]{fontenc}
\usepackage[numbers]{natbib} %for bibliography <=================================
\begin{document}
algorithm \cite{einstein}. text \cite{dirac}.
\bibliographystyle{unsrtnat} % plainnat unsrtnat abrvnat <==============
\bibliography{\jobname}
\end{document}
结果如下:
正如您所见,爱因斯坦被第一个引用,并且也在参考书目中首先显示......
答案2
你写了,
但参考文献并不是按照引用顺序打印的,而是随机打印的。
没有什么LaTeX 和 BibTeX 所做的排序是随机的。也就是说,plain
参考书目样式被编程为按作者姓氏的字母顺序对所有书目条目进行排序(如果出现并列,则按出版年份排序)。
如果您不想按字母顺序排列条目,而是按首次引用的顺序排列,则需要更改参考书目样式。我建议您替换\bibliographystyle{plain}
并\bibliographystyle{unsrt}
执行完整的重新编译循环:LaTeX、BibTeX 和 LaTeX 再执行两次。
plain
和书目样式unsrt
到现在已经有 30 多年历史了,因此无法识别诸如url
和 之类的字段doi
。如果您需要这些字段,我建议您加载natbib
包并使用plainnat
或unsrtnat
书目样式。