On Fri, 2002-10-25 at 15:54, Max Bian wrote:
> 1. Put "\usepackage{bibunits}" in preamble of your master document and
> each subdocument you include. Make sure to use "include" option.
> Forget all other latex code.
>
> 2. At the begining of each included document, write in ERT
> "\begin{bibunit}[unsrt]". Replace unsrt with the style you like.
>
> 3. At the end of each included document, write in ERT:
>
> "\putbib[/path/to/bib/file without .bib]"
> "\addtocontentsline{toc}{section}{\numberline{}\bibname}" -- this makes
> the references appear as a section in chapter.
> "\end{bibunit}"
>
> Additionly, add this ERT for some good. :) -- It lets the
> "Insert/citation reference" work as expected.
>
> "{\renewcommand{\bibliography}[1]{}"
> <<< Insert the BibTexGeneratedReferences via Insert/LIST &TOC menu>>>
> "}"
>
> And the final step: Make a script (eg. name it mylatex) to wrap around
> "latex" command.
>
> ===================================
> #!/bin/bash
> /usr/bin/latex $1
> /usr/bin/latex $1
> for file in *.aux;
> do
> file=`echo $file |sed -e s/\.aux$//`;
> /usr/bin/bibtex $file;
> done;
> /usr/bin/latex $1
> =================================
> You must go to Edit/Preferences/Conversion/Converters/ and change the
> Latex->DVI converter to "mylatex $$i".
>
> After these simple steps, it should work!!
>
> Max
Thanks for the suggestions Max, but it doesn't work for me.
After I got rid of
\addtocontentsline... which gave me an error,
I still get the same result as using the other method: as many errors
as there are \cite's. This is one from the log file:
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.16 \bibcite{deGennes93}{1}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
Does it matter where I put the
{\renewcommand{\bibliography}...}
sequence?