0

I have a document of this form

....

\includeonly{main}

\begin{document} 

   \include{main}

   \include{supp}

   \bibliographystyle{plain}
   \bibliography{bibfile}

\end{document}

I need LaTeX to read supp.aux for cross-referencing, but do not want BibTex to read supp.aux. In other words, I do not want to list .bib entries used in supp.tex to be included in the current document. Is there a way to direct BibTex to only look at main.aux and not supp.aux?

2 Answers 2

4

If you compile your full document (no \includeonly) and ensure that all the cross references are OK, then you can reistate the \includeonly and LaTeX will load also the .aux files corresponding to the not included files.

5
  • I once had it working, but it is not working anymore. The issue is that when I run bibtex on the file with \includeonly, it apparently also looks at supp.aux and adds the corresponding bib entries to the references.
    – passerby51
    Jul 22, 2012 at 19:44
  • @passerby51 Why would you want that?
    – egreg
    Jul 22, 2012 at 19:45
  • the issue is that I don't want bibliography of supp.tex to appear in the final version. Your suggestion does not seem to work.
    – passerby51
    Jul 22, 2012 at 20:19
  • @passerby51 Remove the supp.aux file (or rename it) and rerun BibTeX. If I had to do this I would simply write two papers or use \input and comment the unwanted one.
    – egreg
    Jul 22, 2012 at 20:23
  • Thanks, writing two papers is not an option. I will try your suggestion which I think will work. What has worked for now is to remove all .aux, .bbl, .etc files, comment out \include{supp} and run latex a couple of times, run bibtex, uncomment \include{supp} and comment out \includeonly{main}, run latex a couple and then uncomment \includeonly{main}, and run latex. I guess yours might be a better approach of doing this same thing
    – passerby51
    Jul 22, 2012 at 20:39
1

I suggest doing like egreg recomends, but before second compilation try deleting generated bibliography file that has the same name as the main file of your project, but has an extension .bbl. This will force bibtex to regenerate it but will exclude supp file.

As I remember, this worked for me when I was writing my master thesis.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .