0

I am struggling to get this to work properly

Here is my example.tex file:

\documentclass{article}

\usepackage[superscript,biblabel]{cite}

\begin{document}

Refering to second article\cite{art2} and then first article\cite{art1}

\bibliographystyle{unsrt} \bibliography{test} \end{document}

Here is my test.bib file:

@Article{art1,
  author =   {Author, A. N.},
  title =    {Title One},
  journal =  {Journal},
  year =     2000
}

@Article{art2, author = {Author, A. N.}, title = {Title Two}, journal = {Journal}, year = 2008 }

I am running TexMaker with the QuickBuild option of PdfLaTeX + View PDF to compile the pdf.

Here is the output: enter image description here

Log file says this:

LaTeX Warning: Citation `art2' on page 1 undefined on input line 7.
LaTeX Warning: Citation `art1' on page 1 undefined on input line 7.

Note: I followed exactly the instructions from here

  • I don't know what your editor's "quick build" does but for debugging do each stage separately, checking for errors: pdflatex, bibtex, pdflatex, pdflatex – David Carlisle Aug 23 '23 at 19:19
  • \begin{tabular} was a typo while copy-pasting. – Daniel Agafonov Aug 23 '23 at 19:21
  • 1
    searching this site suggests it is "quick" because it just runs latex once and does not run bibtex. so ? are expected until you run bibtex – David Carlisle Aug 23 '23 at 19:27
  • I modified the options for quick built do have this and still the same result – Daniel Agafonov Aug 23 '23 at 19:29
  • If you have ? you have not run bibtex, your posted document produces this after pdflatex, bibtex, pdflatex, pdflatex. – David Carlisle Aug 23 '23 at 22:48
  • @DavidCarlisle This is exactly what I am running as you can see from my last comment, I keep getting the same log warnings listed in the question – Daniel Agafonov Aug 24 '23 at 00:39
  • no, sorry showing some editor menu is not the same as showing you ran bibtex. the warnings and output you show are quite normal if bibtex has not run, and there are no errors in the code you have posted. If bibtex has run there will be a .blg file with a log which you could show, otherwise I can't help more – David Carlisle Aug 24 '23 at 07:44
  • Because of your answer, it seem, that https://tex.stackexchange.com/q/582514 is related and there should be a real duplicate too … – cabohah Aug 25 '23 at 08:11

1 Answers1

0

The problem was TexMaker itself; there was a problem with the logfile that led to the solution. The log file says this:

LaTeX Warning: Citation `art2' on page 1 undefined on input line 7.
LaTeX Warning: Citation `art1' on page 1 undefined on input line 7.

This means that the files were either incorrectly setup up or the file could not be found. TexMaker has a feature where it can put all the extra files it generates into a folder called "build." The problem is that bibtex does not know this, meaning it does not know where to source the citations.

Unchecking: "Use a 'build' subdirectory for output files" solved it