[EMAIL PROTECTED] schrieb:
> To make it easier to insert citatiosn (if you still need to), you can
> insert a bibliography within each child document, but place it inside a
> *comment*. That way LaTeX won't see it, but LyX will know what
> .bib-files to scan for when showing you the available citations.

Hi,

Excellent suggestion. However, it still has the disadvantage that no bib references appear if one prints out a single chapter.

I am looking for some way to conditionally embed the bibliography into the child documents. If used (printed) "stand alone", a child should have a complete bibliography section. If embedded into the master, the bibliographies of the children should be ignored.

I have been trying to achieve something like that for a couple of hours, but failed - probably because of my lacking knowledge of fundamental LaTex concepts. Here is the idea:

1) Define a variable \master in the preamble of the master document before including the common preamble:

\def\master
\input{preamble.tex}

2) Define a new \ifnomaster in the common preamble that tests for \master being defined or not

% common preamble, input'ed into all children and the master
\newif\ifnomaster
\ifx\master\undefined
  \nomastertrue
\else
  \nomasterfalse
\fi

3) Use ERT boxes to conditionally include the bibliography at the end of each child:

??ERT[\ifnomaster]
[BibTeX Generated Bibliography]
ERT[\fi]

This fails so far, probably because my \newif and \def are erroneous.
(It is kind of funny: While there are many LaTeX books and online resources that explain how to do fancy things using the xyz package, I always struggle when I try to find a good documentation of such basic things.)

Please help :-)

Daniel




On Tue, 30 Jan 2007, Georg Baum wrote:

Am Dienstag, 30. Januar 2007 18:09 schrieb John Hughes:
I have just discovered the Insert->File->Child Document option in LyX,
which
is useful for inserting several chapter documents into one master
document.
However, if I use BibTeX references in my chapter documents, they don't
appear correctly in the master output. The best output I have managed so
far
inserts a bibliography at the end of each chapter but the individual
bibliographies include all the references from the entire document (i.e.
from all of the chapters). Is there a way of achieving either individual
bibliographies that only include the references cited in their own
chapters
or a single bibliography at the end of the master document?

AFAIK you need some extra packages for the first option, but the second one
is easy. Don't include any bibliography in child documents, only include
one in the master.


If you want to enter a new citation in a child you need to open the child
from the master doc, otherwise LyX will not know which .bib file is used.

To make it easier to insert citatiosn (if you still need to), you can insert a bibliography within each child document, but place it inside a *comment*. That way LaTeX won't see it, but LyX will know what .bib-files to scan for when showing you the available citations.

/C

Reply via email to