Re: Chapterbib: another \bibstyle command error

2016-12-30 Thread Jürgen Spitzmüller
Am Freitag, den 30.12.2016, 11:47 -0200 schrieb Rudi Gaelzer:
> > On the command line, you get the error as well, although you
> probably
> > haven't noticed it.
>  
> It's not quite like that. If I run bibtex for each child
> individually, the bbl's are generated without a hitch. The error
> comes when I bibtex'ed the main file.
> Your bibtexall script does not distinguish between the master and
> children aux's and processes them all, without issuing any message to
> the console. 

Right. The script can be extended to ignore the main file, though.
Could you try if the (untested) attached bibtexallx script works?

Jürgen#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-

# \author Juergen Spitzmueller

# This file is a wrapper on bibtex to let LyX
# process every aux file in the temp directory
# except for the master file's.
# This is needed if you use chapterbib with LyX.
# Place this file somewhere in your PATH , then
# open Tools->Preferences->LaTeX in LyX and change
# the "bibtex command" from "bibtex" to "bibtexallx".

import sys, os
for filename in os.listdir("."):
	if filename.endswith('.aux'):
		f = os.path.splitext(filename)[0]
if f == argv[0]:
continue
		os.popen('bibtex ' + f)


signature.asc
Description: This is a digitally signed message part


Re: Chapterbib: another \bibstyle command error

2016-12-30 Thread Rudi Gaelzer
On Thursday, December 29, 2016 5:22:17 PM BRST Jürgen Spitzmüller wrote:
> Yes, this is an error from bibtex's point of view: you are not supposed
> to enter more than one \bibliographystyle or \bibliography command, but
> this happens for each bibtex inset you insert.
> 
> BibTeX errors were not caught in previous versions of LyX.
> 
> On the command line, you get the error as well, although you probably
> haven't noticed it.

It's not quite like that.  If I run bibtex for each child individually, the 
bbl's are generated 
without a hitch.  The error comes when I bibtex'ed the main file.
Your bibtexall script does not distinguish between the master and children 
aux's and 
processes them all, without issuing any message to the console.  Where is the 
standard error output in this case?

> 
> Hitting the "Show output anyway" button should give you the PDF.

Indeed it does, at least for this small sample.

> 
> Working around the error would require a proper chapterbib support in
> LyX. The better way would probably to switch to biblatex, which
> provides the same (and more) functionality.

I never used biblatex, but I'll take a look and try to come up with an 
equivalent 
implementation.

Thanks.

> 
> HTH
> Jürgen

-- 
Rudi Gaelzer
Institute of Physics
Federal University of Rio Grande do Sul
BRAZIL
Registered Linux user # 153741