I'm using texStudio and natbib
i've tried running (after deleting aux and bbl files) pdflatex test && bibtex test && pdflatex test && pdflatex test
But i still get the following error and nothing in my biblio section:
Package natbib Warning: There were undefined citations.
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\renewcommand{\baselinestretch}{1.5}
\usepackage{pdfpages}
\usepackage{pdftexcmds}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{chngcntr}
\usepackage{natbib}
\usepackage{fullpage}
\begin{document}
\begin{sloppypar}
blah blah blah [\cite{1}] blah blah
\setstretch{1.0}{
\bibliographystyle{abbrvnat}
\bibliography{test}
\nocite{*}
}
\end{sloppypar}
\end{document}
bib file entry
@Article{1,
author = {names},
title = {title},
journal = {journal},
year = {2021},
OPTdoi = {doi.org},
}
The output is:
blah blah blah [?] blah blah
and the biblio page is completely empty
any help would be greatly appreciated. Thank you in advance

\setstretchis undefined. If I load a package that defines it (e.g.\usepackage{setspace}) the example compiles fine. You need to compile your file with BibTeX if you want to obtain citations. See https://tex.stackexchange.com/q/63852/35864. Did you make sure to run LaTeX, BibTeX, LaTeX, LaTeX (where "LaTeX" stands for your favourite flavour of LaTeX: pdfLaTeX, LuaLaTeX, XeLaTeX, ...)? If you run BibTeX it should produce a.blgfile and console output, what do they say? Istest.bibyour.bibfile? – moewe Aug 13 '21 at 12:43\renewcommand{\baselinestretch}{1.0}is recommended over\setstretch. I would remove\renewcommand{\baselinestretch}{1.5}, would load\usepackage[onehalfspacing]{setspace}and keep using\setstretch(https://tex.stackexchange.com/q/819/35864). (Well, actually, I would simply never use onehalfspacing, but some times you don't have a choice ...). ... – moewe Aug 13 '21 at 12:51test.tex. You first clean the.auxfile. Then you runpdflatex test && bibtex test && pdflatex test && pdflatex testwithout cleaning any.auxfiles in between? Do you get any errors or warnings on any of those runs? – moewe Aug 13 '21 at 12:52.blgfile: What does it say (Windows systems may classify.blgfiles as "performance monitor files" and hide the file extension, but they are simple text files you can inspect with every editor)? Did you enable a 'build directory' or moving of output files in your editor? If so, disable all those features, they confuse external tools like BibTeX. – moewe Aug 13 '21 at 13:07.blgfile if you ran BibTeX: Can you find it? It should be in the same folder as your main.texfile (test.tex). – moewe Aug 13 '21 at 13:10i have commas separating the authors names – leilaK Aug 13 '21 at 13:14
andin the.bibfile regardless of the desired output. Commas are only used to separate name parts of the same name. See https://tex.stackexchange.com/q/36396/35864 and https://tex.stackexchange.com/q/557/35864. – moewe Aug 13 '21 at 13:16