I am starting a new latex project on Overleaf and I am having an issue with handling my references. I get the error message "Citation XX on page XX undefined on input line XX" as well as the citations showing as [?] and I don't know what is wrong. I have read here and I think there might be an issue with running the commands
pdflatex main
bibtex main
pdflatex main
pdflatex main
but I do not know how to run it.
Any idea about what might be wrong? I can supply the source code if necessary.
But the general idea is that my main.tex refers to my xsources.bib as well as my subfile with the text containing the citations.
Edit: I will add a WME:
main.tex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{subfiles}
\begin{document}
\subfile{sections/omvarldsanalys}
\subfile{sections/ref}
\end{document}
sections/omvarldsanalys.tex
\documentclass[../main.tex]{subfiles}
\begin{document}
\cite{refauthor}
\cite{refauthor1}
\cite{refauthor2}
\end{document}
sections/ref.tex
\documentclass[../main.tex]{subfiles}
\begin{document}
\bibliographystyle{plain}
\bibliography{xsources}
\end{document}
sections/xsources.bib
@misc{refname,
author = {refauthor},
}
subfilesthese days? What's wrong with goo old\input/\include? It works for me if I say\bibliography{sections/xsources}(and change all citations insections/omvarldsanalys.textorefname, because the other keys aren't present). Would that be acceptable for you or do you want to be able to usesections/ref.texas standalone? – moewe Feb 04 '19 at 15:28\inputwould have the same underlying issue and would require\bibliography{sections/xsources}as well. Theimportpackage could help there, but I'd probably just try to accommodate the file structure and avoid all these extra packages. – moewe Feb 04 '19 at 15:39