0

A question mark appears on one citation in my latex file instead of the number. the reference is the following, is there any problem with it?

@book{Chung2012non,
  title={Non-functional requirements in software engineering},
  author={Chung, Lawrence and Nixon, Brian A and Yu, Eric and Mylopoulos, John},
  volume={5},
  year={2012},
  publisher={Springer Science \& Business Media}
}

Update: I am using .bib file also called \bibliographystyle{unsrt} and \bibliography{ref}, I cite the reference by \cite{Chung2012non}, the citation appears like this [?]. The reference doesn't appear in the references list. Actually, I do all my citations and references by the same way all of them worked without problems.

moewe
  • 175,683
Eng.sh
  • 69
  • 1
  • 7
  • Assuming you employ the biblatex package, did you also run biber, followed by one more latex run? – Mico Jul 25 '22 at 00:37
  • @Mico Yes I am employing 'biblatex', I did not use 'biber'. Actually all my citations in the same file except the one I mentioned work without problems. – Eng.sh Jul 25 '22 at 01:21
  • Let me guess: you added the citation of the Chung2012non entry last and haven't re-run biber since. Do see if running biber, followed by one more latex run, makes a difference. – Mico Jul 25 '22 at 01:41
  • 2
    If you are getting a question mark instead of a citation (and not say the entry key in bold), then it is more likely that you use a BibTeX-based bibliography setup instead of biblatex. But this is speculation and it is hard to help you properly if we have to guess what you are doing. Please tell us which bibliography/citation packages you are loading, how you generate your bibliography and how you cite. This is best done by sharing the relevant code (and as little other code as possible) in a short example document (https://tex.meta.stackexchange.com/q/228/35864). – moewe Jul 25 '22 at 04:02
  • @moewe I have added an update – Eng.sh Jul 26 '22 at 14:40
  • Did you ensure your .bib file is called "ref.bib"? If not, your \bibliography{ref} should be updated to \bibliography{file_name_here} – Danyal Jul 26 '22 at 17:11
  • Your update confirms that you are using classical BibTeX and not biblatex, so I have retagged your question. It does not show a complete example document, so we can't test any code. It is possible that you did not run BibTeX as required (https://tex.stackexchange.com/q/63852/35864), but there is a number of other factors (errors reported by BibTeX) that could be relevant here. – moewe Jul 26 '22 at 18:50

1 Answers1

1

Based on your update you are using bibtex. Compile twice then run bibtex and then compile twice again.

a

Try this code.

\documentclass{article}

\begin{filecontents*}{ref.bib}

@book{Chung2012non, title={Non-functional requirements in software engineering}, author={Chung, Lawrence and Nixon, Brian A and Yu, Eric and Mylopoulos, John}, volume={5}, year={2012}, publisher={Springer Science & Business Media} }

\end{filecontents*}

\begin{document} Some text \cite{Chung2012non},

\bibliographystyle{unsrt}
\bibliography{ref}


\end{document}

If the file is named MAIN.tex, after running bibtex you should see in the console

Process started: bibtex.exe "MAIN"

bibtex: security risk: running with elevated privileges This is BibTeX, Version 0.99d (MiKTeX 22.3) The top-level auxiliary file: MAIN.aux The style file: unsrt.bst Database file #1: ref.bib Process exited normally

UPDATE To use biblatex on Overleaf load this code in a new project and recompile.

\documentclass{article}

\usepackage{biblatex}
\addbibresource{ref3.bib}

\begin{filecontents*}{ref3.bib}

@book{Chung2012non, title={Non-functional requirements in software engineering}, author={Chung, Lawrence and Nixon, Brian A and Yu, Eric and Mylopoulos, John}, volume={5}, year={2012}, publisher={Springer Science & Business Media} }

\end{filecontents*}

\begin{document} Some text \cite{Chung2012non}.

\printbibliography

\end{document}

Simon Dispa
  • 39,141
  • I am working on latex online (overleaf), how can I run bibtex?? – Eng.sh Jul 26 '22 at 20:01
  • @Eng.sh Try my code in Overleaf. Start a new blank project, copy and paste the code and recompile. They will do all the work for you. – Simon Dispa Jul 26 '22 at 20:10
  • Disp Your first and second code worked on an empty project put it still does not work in my project!? :( – Eng.sh Jul 26 '22 at 20:49