26 Jun 2012 23:42

## Re: Python wrapper bibtexall for biblatex

stefano franchi <stefano.franchi <at> gmail.com> writes:

>
> Hi Julien,
>
> I took a look at the log file you enclosed. It took some work, because
> the thesis did not compile at first (missing images in the chapters
> were one of the problems). In general, try to provide a minimal
> working example when asking for help, not the entire document with all
> the bells and whistles.
>
> The file now compiles on my laptop and the results, it seems to me,
> are what you wanted. I changed two things: (a) I switched from bibtex
> to biber as backend ( I could not get your thesis to work with bibtex,
> and in general biber works better with biblatex). (b) And I switched
> from refsection to refsegment in biblatex. Here is what you need to
> do:
>
> A. Switch from bibtex to biber.
> - be sure biber is installed on your system (it should. Try typing
> "biber" at a command prompt to verify. If not install it via MikTeX)
>  - Change the bibtexall script (with an editor): in line 17 (the last
> line), replace "bibtex" with "biber"
>  - Make sure bibtexall can be found by lyx (again try calling
> bibtexall from a command prompt, or ask for help from the Windows
> guys)
> - Check that in preferences>>Latex , i the section "Bibliography
> generation" you have selected "custom" and typed "bibtexall" (without
> quotes) in the following field
> - in Document>>Settings>>Bibliography>>Processor, select "biber" from
>     \usepackage[backend=biber,style=nature]{biblatex}
> - finally, get rid of spaces in path names (this may be unnecessary)
>
> B. Switch from refsection to refsegment (see biblatex manual, section
> 3.10.3 for a discussion of how they differ)
>
> - in your chapters, replace the commands \begin{refsection} and
> \end{refsection} with, respectively,  \begin{refsegment} and
> \end{refsegment}
>
> - at the end of your chapters, when you want the bibliography to
> appear, replace the simple \printbibliography command you have now
> with
>  \printbibliography[segment=n] where "n" is "1" for your first
> bibliography (currently, your chapter 2), "n" = "2" for your second
> bibliography (currently your chapter 3), etcetera. Again, see the
> manual, sec 3.10.3 for a discussion
>
> I am sending the pdf output in a private message to avoid jamming the
> list servers.
>
> Cheers,
>
> Stefano
>
> On Mon, Jun 25, 2012 at 11:20 PM, julien.babinot
> <julien.babinot <at> 9online.fr> wrote:
> > Le 25/06/2012 22:35, stefano franchi a écrit :
> >
> >> On Mon, Jun 25, 2012 at 10:02 PM, Julien Babinot
> >> <julien.babinot <at> 9online.fr> wrote:
> >>>
> >>> Hi Lyx users,
> >>>
> >>>  From this observation, could anyone tell me where i did a mistake? I
> >>> would say
> >>> that the problem is coming from the bibtexall command but i don't know
> >>> where?!
> >>
> >> Ju,ien,
> >>
> >> it's a bit difficult to diagnose the problem unless you provide more
> >> info. Look at the latex log (Document>>Latex Log), especially at the
> >> warnings. Is biblatex complaining it cannot find the appropriate
> >> files? Or is bibtex complaining about the same? Perhaps you can post
> >> the log or send it to me directly (if it is too long) alongside a copy
> >> of your lyx file?
> >>
> >> Cheers,
> >>
> >> Stefano
> >>
> >>
> >>
> >
> >
> > I send you the log file as well as my lyx folder. And now i realize that
> > perhaps i am "testing" on a bad file as i am using a quite complex template
> > for my thesis... But still it should work on the "real" file so...
> >
> > Cheers
> >
> > Julien
>

Hi again Stefano,

I did all the procedure but unfortunately it still have problems...
First, with the exact procedure that you gave me, my references are not
recognized and don't appear in my pdf file.
If i change from biber to bibtex8, then it is generating the same file as yours,
with first chapter with references numbered correctly (for ex. 1 to 20) and the
second with increasing numbers (for ex. 20 to 40, but it also uses numbers from
the first chapter if references are re-used). This behavior is because of the
refsegment environment, that create a global, without the need of additional aux
files (3.10.3 in biblatex doc).
As i want to have completely independent bibliographies for each chapter, i have
to use the refsection environment. In this case it is requiring all the aux
files of each chapter. And in this case, my bibliography is not working.

So my conclusion is that the bibtexall script is not working. The procedure is
not detailed enough for me in the wiki, and i don't find any clue on the forum,
could any windows-user (using Miktex) explain me how to generate and where to
place exactly this script?

Here is how i am proceeding:
- To build bibtexall.exe, i used this tutorial:
http://logix4u.net/component/content/article/27-tutorials/44-how-to-create-
windows-executable-exe-from-python-script
I copied the script and pasted into a bibtexall.txt file, then i renamed to .py
extension and used py2exe to build the executable script. The file was created
in a dist folder, with the exe and some other files.
I placed the dist folder in C:\Program Files\MiKTeX 2.9\miktex\bin folder (PATH
shown in Lyx)and then i ran texhash in cmd.

Thanks a lot

Julien



Gmane