As mentioned in the comments, you need a \bibliography command to generate the bibliography. In the subfile, use the command \ifSubfilesClassLoaded to make the generation conditional. The code below works when run locally.
With Overleaf, there is the problem that it cannot access the files in the parent folder when processing mini.tex, so bibtex fails with the error that ../bib.bib cannot be found. (I think this is because Overleaf copies the folder containing mini.tex and all subfolders, but not the parent folder, to some other place before running latex+bibtex.)
Here is the code that works locally:
% main.tex
\documentclass{book}
\bibliographystyle{apalike}
\usepackage{subfiles}
\begin{document}
A citation\cite{someone1981}
\subfile{content/mini}
\bibliography{bib}
\end{document}
% content/mini.tex
\documentclass[../main]{subfiles}
\begin{document}
\section{In Subfile}
This cite is in the subfile \cite{10.1007/978-3-031-20738-9_128}
\ifSubfilesClassLoaded{% <<<<<<<<<<<<<<<<<<<<<
\bibliography{../bib}% <<<<<<<<<<<<<<<<<<<<<
}{}% <<<<<<<<<<<<<<<<<<<<<
\end{document}
% bib.bib
@Book{someone1981,
author = {S.O.Meone},
title = {The title},
publisher = {Publisher},
year = {1981},
}
@InProceedings{10.1007/978-3-031-20738-9_128,
author="Zhang, Zhe
and Wang, Shenhang
and Meng, Gong",
editor="Xiong, Ning
and Li, Maozhen
and Li, Kenli
and Xiao, Zheng
and Liao, Longlong
and Wang, Lipo",
title="A Review on Pre-processing Methods for Fairness in Machine Learning",
booktitle="Advances in Natural Computation, Fuzzy Systems and Knowledge Discovery",
year="2023",
publisher="Springer International Publishing",
pages="1185--1191",
isbn="978-3-031-20738-9"
}
biblatex, is that the citation package you are using? Overleaf compiles the entire document without user input whereas local compilations require that you runbiber(orbibtex), are you just runningpdflatexon your document to compile it on your local system? You should runpdflatexthenbiberthenpdflatexthenpdflatexto compile it on your local system. Let us know how that goes and if it worked or not, if you don't know how to do that on your TeX local system let us know that too please :) – JamesT Jul 18 '23 at 18:10content/mini.texhas no contents that tell LaTeX to generate a bibliography, so the citations will not be resolved. Even if the preamble ofmain.texis brought in, there is no bibliography, since the main bit of the bibliography commands must be placed in the document body, which is not inherited. The easiest way to get a bibliography when compilingcontent/mini.texis probably with\ifSubfilesClassLoadedas suggested by @MS-SPO in their comment above. ... – moewe Jul 18 '23 at 19:06subfilesonly makes sense if you actually expect to have to compile one of the parts of your large project as a stand-alone file. If that is not the case, it might be easier to work with\includeand\includeonly. That also allows you to selectively compile just a part of your large project. – moewe Jul 18 '23 at 19:08