I have several subfiles and a main file as follows:
%subfile1
\documentclass[alpha-refs]{wiley-article}
\usepackage{standalone}
....
\begin{document}
some text
\bibliographystyle{plain}
\bibliography{mybib}
\end{document}
%subfile2
\documentclass[alpha-refs]{wiley-article}
\usepackage{standalone}
....
\begin{document}
some text
\bibliographystyle{plain}
\bibliography{mybib}
\end{document}
%main
\documentclass[alpha-refs]{wiley-article}
\usepackage[subpreambles=false]{standalone}
\usepackage{import}
....
\begin{document}
some text
\section{1}
\subimport{sections/}{subfile1}
\section{2}
\subimport{sections/}{subfile2}
\bibliographystyle{plain}
\bibliography{mybib}
\end{document}
when I compile the subfiles I get the references since I included the bibliography in subfiles, and when I compile the main file, I get the references for each sections as well.
I want to see the references in the subfiles, but I ignore them in each section in the main file, and only show the references at the end of the main file. using \ifstandalone ... \fi around the bibliography{} in subfiles does not work since it does not recognize the command \ifstandalone, and gives the following error:
This is BibTeX, Version 0.99d (TeX Live 2015)
The top-level auxiliary file: example.aux
The style file: rss.bst
I found no \bibdata command---while reading file subfile1.aux
Warning--I didn't find a database entry for "cite1"
Warning--I didn't find a database entry for "cite2"
Warning--I didn't find a database entry for "cite3"
(There was 1 error message)
Does anyone know what is the problem?
\ifstandalone– Mila Jul 14 '17 at 15:07