On 10/22/2009 04:44 PM, Pete Crite wrote:
On 23/10/2009, at 7:22 AM, rgheck wrote:
On 10/22/2009 02:27 PM, Jan Piet Joris en Corneel wrote:
Dear list,
I'm using LyX and the Lyx port of André Miede's Classicthesis to
write a thesis.
I was wondering how to deal with child documents and bibtex. Basically
I want to do this.
1. Have one master document with several child documents (i.e. one for
each child documents.
2. Have one bibliography at the end of the thesis.
3. Have the ability to insert citations to that bibliography using the
Lyx function.
Points 1 and 2 cause no difficulties. The third point seems to cause
problems. It seems I first need to insert a bibliography to the
chapter to be able to cite from it. Seems logic but I don't want to
have that bibliography repeated at the end of each chapter, just one
at the end of the master document.
How do I make the bibliography 'invisible' at the end of a chapter in
the pdftex output , without losing the ability to insert citations? In
the lyx port files (available at
http://www.soundsorange.net/resources/classic-thesis-for-lyx/) they
didn't seem to have solved it too. If I look into e.g. Chapter01.lyx
and double click the first citation to Bringhurst, no list of
available sources shows up, because Chapter01.lyx doesn't know it has
to look into Bibliography.bib.
If anybody has some ideas on solving this, please show them up.
OK, first, if you open the master document first, and then open the
child document from the master (e.g., right click on the Include
inset, then select "Edit Included File"), then you should have no
problems. When you do it this way, LyX essentially treats the master
and children as if they were one huge file, and it picks up the
bibliography from the master.
In LyX 1.6, there is a way to make this easier. In each of your child
documents, set the "default master document" under
Document>Settings>Document Class, and set it to be the master in
which the children are included. Then, when you open the child
directly, LyX knows it should first open the master document, too.
The master will not actually appear to be open---i.e, it won't appear
in a window---but if you look under the View menu, you'll see it (as
well as all of its other children). Now the bibliography will work as
normal.
Richard
Should this solution work if I wish to view a PDF version of the child
document alone?
No, this will not allow you to view the child alone. That is its central
limitation.
If so, neither of these two solutions appear to work for me, either
alone or both at once. I still get "?" at each reference, if I do not
specifically have a bibliography in the child document. Also,
inter-document cross-references don't work, nor do environments
defined in the master's header.
All of this is expected when you view the child alone, since LyX then
treats it as a separate document. (I think there have been improvements
on some of this for 1.7, by the way, but I am not sure.)
If you want to be able to view the child alone, then what you want to do
is this. (I think this is on the wiki.) At the top of the master, put in
ERT:
\newcommand\MAINBIB{true}
Then in each child put:
[ERT]\ifx\undefined\MAINBIB[\ERT]
[Bibliography inset]
[ERT]\fi[\ERT]
where the ERT tags mark ERT. This has LaTeX ignore the bibliography, if
MAINBIB is defined. (Note that there isn't any \undefined command; we're
just supposing that it is undefined!)
Note that in this case too inter-document xrefs, etc, won't work if you
view the child alone. There isn't any way around that, except (a) to
introduce \includeonly support into LyX and (b) to figure out how that
can best be made to help in this kind of situation.
Richard