I am new to latex. I have been trying to add citations in a document but its not working. I have used the package natbib and the command citet{DAVANZO201573}
in the 2nd line of the first paragraph. The bib file name is file1.bib
I get the following error:
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."
Below is the content in the .tex file
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}
The content in the bib file is:
@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."
}
Below is the output of the bibtex command:
I couldn't open file name `file1.aux'
This the .log file
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). ```
2
Answers
The solution was to take the figures out of folders and put them in the root in the same place where the .tex file is.
For me doing this work, in the following file:
I make sure that the filename is
and my citation filename is
Then the error of Package natbib Warning: There were undefined citations. was solved. Hope it helps!