Firstly apologies if this is a silly mistake on my part.
I am writing my thesis and using subfiles for each chapter. I would like a reference section at the end of each chapter so I am therefore using chapterbib. I am also using the package achemso.
I'm having problems with compiling the subfiles in the main document. This could be the way that I am building the file, but it seems to work nicely for one subfile just not any more than that.
So I build each chapter (let's call it chapter1.tex) by:
Build (LuaLatex) Bibtex Build (LuaLatex) Build (LuaLatex)
Then the main document in the same way (let's call it thesis.tex)
Build (LuaLatex) Bibtex Build (LuaLatex) Build (LuaLatex)
The structure of my main document is something like:
\documentclass[11pt]{report}
\usepackage{achemso}
\usepackage[sectionbib]{chapterbib}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{subfiles}
\begin{document}
\subfile{../chapter1/chapter1.tex}
\subfile{../chapter2/chapter2.text}
\subfile{../chapter3/chapter3.text}
\subfile{../chapter4/chapter4.text}
\end{document}
And for my subfiles something like:
\documentclass[../Thesis/thesis.tex]{subfiles}
\begin{document}
main text
\bibliography{../library}
\end{document}
Any help would be greatly appreciated.
Just to clarify, I can build the main document (thesis.tex) with the subfiles, but no references are included. Trying to then build the main document with bibtex pulls up an error something like:
The style file: achemso.bst Illegal, another \bibdata command---line 793 of file
This does not happen with only one subfile.