-1

This is the section and the citation that doesn't work is EDEL.

\chapter{Literature Review}

\section{Humpback Whale Biomimicry}

... \cite{Edel1978} ... \cite{Li2020} ...

This is how the entry is defined in the bibliography file:

@article{Edel1978,
   author = {R. K. Edel and H. E. Winn},
   doi = {10.1007/BF00397155},
   issn = {0025-3162},
   issue = {3},
   journal = {Marine Biology},
   pages = {279-287},
   title = {Observations on underwater locomotion and flipper 
      movement of the humpback whale Megaptera novaeangliae},
   volume = {48},
   year = {1978},
}
Mico
  • 506,678
  • 3
    have you run bibtex, then latex twice? otherwise the warning is expected – David Carlisle Aug 04 '23 at 17:39
  • 2
    your example code does not help anyone help you the tex is just a fragment that can not be run and it just has \cite{Li2020} which is not in the supplied bib file – David Carlisle Aug 04 '23 at 17:45
  • Welcome to TeX.SE. Which bibliography style do you employ? – Mico Aug 04 '23 at 17:45
  • I have run it twice. I cannot post the entire file as it is my entire dissertation, I was just hoping it was a simple mistake that someone could spot easily. Feel free to just take the reference into your own file and try citing it. @DavidCarlisle – Katherine Keogh Aug 04 '23 at 17:49
  • I want to do APA 6 or 7 th edition @Mico – Katherine Keogh Aug 04 '23 at 17:49
  • 1
    don't post your thesis, just fix the code you posted here so it is an example of your problem. you need to run pdflatex, bibtex, pdflatex, pdflatex. so if you just ran pdflatex twice the warning is expected – David Carlisle Aug 04 '23 at 17:56
  • 3
    "Feel free to just take the reference into your own file and try citing it." If I make an example, it will work, you need to show an example that fails, so people can correct it. impossible to guess your error other than the common error of not running bibtex if you show no example – David Carlisle Aug 04 '23 at 18:00
  • It is not a warning, its an error, when I try to cite the reference I have posted, it just gives the error and show a ? in my pdf. it's my first time using latex I am not sure what you want from my example, I can remove the other in text citation but I dont think thats what you want, by the way that citation does work, and is from the same bibtex file. I am using overleaf so I have complied it several times. I am not sure what else you want. I have also tried complile from scratch – Katherine Keogh Aug 04 '23 at 18:04
  • 1
    You've "run it twice". But what have you run twice? You have to run LaTeX + bibtex + LaTeX + LaTeX. It is not enough to run LaTeX twice. See https://tex.stackexchange.com/questions/63852/question-mark-or-bold-citation-key-instead-of-citation-number – cabohah Aug 04 '23 at 18:16
  • 3
    I ask again have you run bibtex? as it says in your title it is a warning, if you get an error that is unrelated and you should show the exact error message – David Carlisle Aug 04 '23 at 18:16
  • I have no idea what you are asking @DavidCarlisle. I have overleaf, I see no run button, I see compile, is there something I am missing. I do not know how to "run" bibtex. I literally just got mendeley, made the biliography and then outputted a .bib file – Katherine Keogh Aug 04 '23 at 19:20
  • @DavidCarlisle, I found this on "running" latex and bibtex "As mentioned above, Overleaf handles all of these mulitple runs automatically, so you don’t have to worry about them. " – Katherine Keogh Aug 04 '23 at 19:31
  • 1
    You never mentioned overleaf until now!!!!!!! If overleaf failed to run bibtex then latex or bibtex failed, which means you have a possibly unrelated error anywhere in your document stopping overleaf running pdflatex and bibtex. As I said before if you got an error, show the exact error message, it is not related to any code you have shown – David Carlisle Aug 04 '23 at 19:50
  • I mentioned overleaf an hour ago in the large comment... Package natbib Warning: Citation `Edel1978' on page 4 undefined on input line 3.

    ‪./2-Literature Review.tex, 3‬ You have cited something which is not included in your bibliography. Make sure that the citation (\cite{...}) has a corresponding key in your bibliography, and that both are spelled the same way.

    – Katherine Keogh Aug 04 '23 at 19:53
  • This is the exact error comment, when I click learn more it says there is an error in the label part or its syntaxed wrong – Katherine Keogh Aug 04 '23 at 19:54
  • 4
    show the log file (from the overleaf raw log menu) and the bibex log (.blg) or if you are really stuck ask overleaf support as you can let them see your project – David Carlisle Aug 04 '23 at 20:10
  • Please add all relevant information to the question. Start with a minimal working example with bibliography, also add the .blg file and if there are warnings or error messages in the log file also show them. – cabohah Aug 05 '23 at 10:06
  • AFAIK sometimes, after an error occurred, overleaf stays in an inappropriate state of the cache. Cleaning the cache can help. But this is seldom. So without any essential information this is only coffee cup reading. – cabohah Aug 05 '23 at 10:10

2 Answers2

2

There is no error in the code shown, I show the terminal output at each stage (after making a usable example from your code fragment)


dd978.tex

\documentclass{book}
\usepackage{natbib}

\begin{document} \chapter{Literature Review}

\section{Humpback Whale Biomimicry}

... \cite{Edel1978} ...

\bibliographystyle{plainnat} \bibliography{xbib} \end{document}


xbib.bib

@article{Edel1978,
   author = {R. K. Edel and H. E. Winn},
   doi = {10.1007/BF00397155},
   issn = {0025-3162},
   issue = {3},
   journal = {Marine Biology},
   pages = {279-287},
   title = {Observations on underwater locomotion and flipper 
      movement of the humpback whale Megaptera novaeangliae},
   volume = {48},
   year = {1978},
}

pdflatex dd978

Package natbib Warning: Citation `Edel1978' on page 1 undefined on input line 9
.

No file dd978.bbl.

Package natbib Warning: There were undefined citations.

bibtex dd978

This is BibTeX, Version 0.99d (TeX Live 2023)
The top-level auxiliary file: dd978.aux
The style file: plainnat.bst
Database file #1: xbib.bib

pdflatex dd978

Package natbib Warning: Citation `Edel1978' on page 1 undefined on input line 9
.

(./dd978.bbl [1{/usr/local/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdfte x.map}] [2])

Package natbib Warning: There were undefined citations.

[3] (./dd978.aux

Package natbib Warning: Citation(s) may have changed. (natbib) Rerun to get citations correct.

pdflatex dd978

Output written on dd978.pdf (3 pages, 57128 bytes).
Transcript written on dd978.log.

enter image description here

David Carlisle
  • 757,742
1

You say that you want to format the bibliographic entries according to APA6 or APA7 guidelines. I would therefore like to suggest that you not use the natbib citation management package.

To get formatting according to APA6 guidelines, do use the apacite citation management package (with option natbibapa if you wish to use \citet and \citep) and the apacite bibliography style. (To get formatting according to APA7 guidelines, you'll need to switch to biblatex/biber.)

And, be sure to run LaTeX, BibTeX, and LaTeX twice more in order to fully propagate any changes.

enter image description here

\documentclass{article} % or {book}

\begin{filecontents}[overwrite]{xbib.bib} @article{Edel1978, author = {R. K. Edel and H. E. Winn}, doi = {10.1007/BF00397155}, issn = {0025-3162}, issue = {3}, journal = {Marine Biology}, pages = {279--287}, title = {Observations on underwater locomotion and flipper movement of the humpback whale {Megaptera} novaeangliae}, volume = {48}, year = {1978}, } \end{filecontents}

\usepackage[natbibapa]{apacite} \bibliographystyle{apacite}

\usepackage{xurl} \usepackage[colorlinks,allcolors=blue]{hyperref} % optional \hyphenation{novae-angliae mega-ptera}

\begin{document}

\section{Humpback whale biomimicry}

\dots\ \citet{Edel1978} \dots

\bibliography{xbib} \end{document}

Mico
  • 506,678