Ding Ming (QFL PD PI) wrote:
Dear LYX

I am a user of LYX. Now I am writing my thesis using LYX. But I come to a 
problem. How can do make a global citation?

A general lyx file of my thesis contains six sub-lyx files. I would like to make citations in a 
sub-file. But I need to generate "Bib Tex Generated Bibliography" for each sub one.  The 
point is that I don't want "Bibliography" appears in every chapter of my thesis, but  
last one. So could you please tell me how I can manage it?

A few possibilities.

One: You may be able to put the bibliography in a comment in the subfiles. LyX will see it, but it won't get exported to LaTeX. Downside: You can't compile the subfiles on their own.

Two: If LyX knows about the master-child relationship, then it will let you insert citations based upon the bibliography in the master document. To let LyX know about this, though, you have to open the child documents from the master document, using the "Edit" button in the Include dialog, which you get by clicking on the Include inset. This is a bit of a pain, but it does work.

Three: Just before the bibliography inset in each child file, put this in ERT:
\ifx\MAINBIB\undefined
And then just after it, put this, again in ERT:
\fi
Now, in the master file, put this in ERT:
\newcommand\MAINBIB{biblio}
The \ifx line is checking to see whether \MAINBIB is defined. (NOTE: Don't define \undefined!!) It is if we're compiling the master, and then the bibliography will be ignored. This trick is the same one I describe here: http://wiki.lyx.org/Tips/ChildMathMacros, but put to a different use.

Richard

Reply via email to