I use the subfiles
package to divide the main document I'm working on into chapters, so that I don't have to compile the whole document everytime.
This means that I don't print the bibliography in any of the separate chapter files, I only print in the main file. When compiling the separate chapters, this results in a warning from hyperref
, complaining about the lack of bibliography, as already discussed here.
The solution posted there is to use the package option hyperref=false
when loading biblatex
. This solves the problem in the chapter files, but now I don't have links in the main file.
So my question is: is there a way to differentiate the main file from the others, so that I can use some code like:
\ifmaindocument{\usepackage[backend=biber]{biblatex}}
\ifsubdocument{\usepackage[backend=biber, hyperref=false]{biblatex}}
in the preamble?