繁体   English   中英

引用在 latex 中使用 natbib package 不起作用

[英]Citation not working in latex using natbib package

我是 latex 的新手。 我一直在尝试在文档中添加引用,但它不起作用。 我在第一段的第二行使用了 package natbib和命令\citet{DAVANZO201573} 围兜文件名为file1.bib

我收到以下错误:

Package natbib Warning: Citation `DAVANZO201573' on page 1 undefined on input line 10.


Overfull \hbox (42.93008pt too wide) in paragraph at lines 10--17
\OT1/cmr/m/n/10.95 190829A. (https://fermi.gsfc.nasa.gov/science/mtgs/symposia/
2020/program/189/). 
[1] [2] (./intro.bbl

! LaTeX Error: Can be used only in preamble."

下面是.tex文件中的内容

\documentclass[11pt]{article}
\usepackage{placeins}
\usepackage{natbib}

\begin{document}

\section{Introduction}

Gamma ray bursts are one of the most energetic and mysterious phenomena in the universe with emissions peaking in the gamma rays detected at cosmological distances \citet{DAVANZO201573}. The duration varies from a few milli seconds to minutes detected from random locations in the sky. 


\newpage

\bibliographystyle{plainnat}

\bibliography{file1}

\end{document}

bib文件中的内容是:

@article{DAVANZO201573,
title = "Short gamma-ray bursts: A review",
journal = "Journal of High Energy Astrophysics",
volume = "7",
pages = "73 - 80",
year = "2015",
note = "Swift 10 Years of Discovery, a novel approach to Time Domain Astronomy",
issn = "2214-4048",
doi = "https://doi.org/10.1016/j.jheap.2015.07.002",
url = "http://www.sciencedirect.com/science/article/pii/S2214404815000415",
author = "P. D'Avanzo",
abstract = "Gamma-Ray Bursts (GRBs) are rapid, bright flashes of radiation peaking in the gamma-ray band occurring at an average rate of one event per day at cosmological distances. They are characterized by a collimated relativistic outflow pushing through the interstellar medium shining in gamma-rays powered by a central engine. This prompt phase is followed by a fading afterglow emission at longer wavelength, powered in part by the expanding outflow, and in part by continuous energy injection by the central engine. The observed evidences of supernovae associated to long GRBs (those with a duration of the gamma-ray emission >2 s) brought to a general consensus on indicating the core collapse of massive stars as the progenitor of these events. Following the most accredited model, short GRBs (the events with a duration of the gamma-ray emission ≤2 s) originate from the coalescence of compact binary systems (two neutron stars or neutron star-black hole systems). This paper presents a review of the observational properties of short GRBs and shows how the study of these properties can be used as a tool to unveil their elusive progenitors and provide information on the nature of the central engine powering the observed emission. The increasing evidence for compact object binary progenitors makes short GRBs one of the most promising sources of gravitational waves for the forthcoming Advanced LIGO/Virgo experiments."
}

下面是 bibtex 命令的 output

I couldn't open file name `file1.aux'

这个 .log 文件

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=latex 2020.5.29)  12 JUN 2020 16:02
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**intro.tex
(./intro.tex
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 84 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo
File: size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texlive/texmf-dist/tex/latex/placeins/placeins.sty
Package: placeins 2005/04/18  v 2.2
)
(/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip43
\bibsep=\skip44
LaTeX Info: Redefining \cite on input line 694.
\c@NAT@ctr=\count87
) (./intro.aux)
\openout1 = `intro.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.


Package natbib Warning: Citation `DAVANZO201573' on page 1 undefined on input l
ine 11.

LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <10.95> on input line 14.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <8> on input line 14.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <6> on input line 14.

Overfull \hbox (42.93008pt too wide) in paragraph at lines 11--18
\OT1/cmr/m/n/10.95 190829A. (https://fermi.gsfc.nasa.gov/science/mtgs/symposia/
2020/program/189/). 
[]

[1

] [2] (./intro.bbl

! LaTeX Error: Can be used only in preamble.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...                                              

l.1 \documentclass
                 [11pt]{article}
? 
! Emergency stop.
...                                              

l.1 \documentclass
                 [11pt]{article}
Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.


Here is how much of TeX's memory you used:
582 strings out of 492983
6874 string characters out of 6134922
63861 words of memory out of 5000000
4215 multiletter control sequences out of 15000+600000
7897 words of font info for 28 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
21i,4n,22p,1264b,109s stack positions out of 5000i,500n,10000p,200000b,80000s
Output written on intro.dvi (2 pages, 5488 bytes). ```



解决方案是将数字从文件夹中取出,并将它们放在根目录中与 .tex 文件相同的位置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM