Discussion:
[MiKTeX] (pdf)texify using biber instead of bibtex
Stefan Pinnow
2010-10-21 09:37:57 UTC
Permalink
Hello all,

has anybody an idea how to convince (pdf)texify to use biber instead of
bibtex?

Of course just (pdf)texifying the attached minimal fails. But it also fails,

after I ran biber and again using (pdf)texify.

If there is no good way of doing that so far I would write a feature
request,
if also others think that would be a nice feature to have.


Thanks for your comments and help in advance and
best regards
Stefan


% ----- minimal example -----
\begin{filecontents}{test_bib.bib}
@Book{companion,
author = {Goossens, Michel and Mittelbach, Frank and Samarin,
Alexander},
title = {The \LaTeX{} Companion},
edition = {1},
date = {1994},
}
\end{filecontents}
\documentclass{book}
\usepackage[
backend=biber,
]{biblatex}
\bibliography{test_bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
% ---------------------------
Ulrike Fischer
2010-10-21 10:11:44 UTC
Permalink
Post by Stefan Pinnow
Hello all,
has anybody an idea how to convince (pdf)texify to use biber instead of
bibtex?
Well you can set an environment variable as mentioned in the
documentation: "The values of the BIBTEX, LATEX (or PDFLATEX),
MAKEINDEX, MAKEINFO, TEX (or PDFTEX), and TEXINDEX environment
variables are used to run those commands, if they are set."

I can switch between bibtex and bibtex8 by using
set BIBTEX=bibtex8. But for some reason I get with biber always biber
could not be found. (I moved biber.exe in various folders in my path,
and biber itself if found fine.)

I:\Z-Test>set BIBTEX=biber

I:\Z-Test>texify test-utf8.tex
texify: biber could not be found.
--
Mit freundlichen Grüßen
Ulrike Fischer
Stefan Pinnow
2010-10-21 16:51:37 UTC
Permalink
Hello Ulrike,
Post by Ulrike Fischer
Post by Stefan Pinnow
has anybody an idea how to convince (pdf)texify to use biber instead
of bibtex?
Well you can set an environment variable as mentioned in the
documentation: "The values of the BIBTEX, LATEX (or PDFLATEX),
MAKEINDEX, MAKEINFO, TEX (or PDFTEX), and TEXINDEX environment
variables are used to run those commands, if they are set."
I can switch between bibtex and bibtex8 by using set BIBTEX=bibtex8.
But for some reason I get with biber always biber could not be found.
(I moved biber.exe in various folders in my path, and biber itself if
found fine.)
I:\Z-Test>set BIBTEX=biber
I:\Z-Test>texify test-utf8.tex
texify: biber could not be found.
When I am doing this I don't get such an error, regardless if I set BIBTEX
to bibtex or biber. The only message in the log I am getting is

% ---
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) minimal
(biblatex) and rerun LaTeX afterwards.
& ---


Nevertheless it would be nice, if either texify would notice from the log
that "biber" has to be executed (again) or the editor would look for the
combination

\usepackage[
...,
backend = biber,
...,
]{biblatex}

and then set the BIBTEX variable accordingly to biber.


Best regards
Stefan
Ulrike Fischer
2010-10-22 08:25:30 UTC
Permalink
Post by Stefan Pinnow
Post by Ulrike Fischer
Post by Stefan Pinnow
has anybody an idea how to convince (pdf)texify to use biber instead
of bibtex?
Well you can set an environment variable as mentioned in the
documentation: "The values of the BIBTEX, LATEX (or PDFLATEX),
MAKEINDEX, MAKEINFO, TEX (or PDFTEX), and TEXINDEX environment
variables are used to run those commands, if they are set."
I can switch between bibtex and bibtex8 by using set BIBTEX=bibtex8.
But for some reason I get with biber always biber could not be found.
When I am doing this I don't get such an error, regardless if I set BIBTEX
to bibtex or biber. The only message in the log I am getting is
% ---
(biblatex) minimal
(biblatex) and rerun LaTeX afterwards.
& ---
Well for me texify seems to find biber when I put it in the miktex/bin
folder but not when it is simply somewhere in the path. But texify
executed biber only without the "backend=biber" part in the biblatex options (which
naturally gives other errors). So texify simply doesn't realize that a
"bibtex" run is needed (biber doesn't write to the aux-file). I found
in the source of texify from miktex 2.8. the following list:

Run bibtex on current file:
- If its input (AUX) exists.
- If AUX contains both '\bibdata' and '\bibstyle'.
- If some citations are missing (LOG contains 'Citation') or the
LOG complains of a missing .bbl.

We run bibtex first, because I can see reasons for the indexes to
change after bibtex is run, but I see no reason for the converse.

Don't try to be too smart. Running bibtex only if the bbl file
exists and is older than the LaTeX file is wrong, since the
document might include files that have changed. Because there can
be several AUX (if there are \include's), but a single LOG, looking
for missing citations in LOG is easier, though we take the risk to
match false messages.

With this information the following worked for me:

1. Set the environment variable BIBTEX to full/path/to/biber.exe.

2. Run this document:

\documentclass{book}
\usepackage[
backend=biber,
]{biblatex}
\bibliography{test_bib}
\begin{document}
\makeatletter
\immediate\write\@mainaux{\noexpand\bibstyle{}}%
\immediate\write\@mainaux{\noexpand\bibdata{}}
\makeatother
%\nocite{*}
\cite{companion}
\printbibliography
\end{document}


I haven't tried to find out if it works with documents with includes.

Do you know why the windows firewall always pops up when biber is
called?
--
Mit freundlichen Grüßen
Ulrike Fischer
Ulrike Fischer
2010-10-22 10:11:22 UTC
Permalink
Post by Stefan Pinnow
has anybody an idea how to convince (pdf)texify to use biber instead
of bibtex?
Addition: the aux-file doesn't need to contain a \bibstyle and
\bibdate command. It is enough if there are commands which _starts_
with this strings. So the following works too (and looks a bit
cleaner):


\documentclass{book}
\usepackage[
backend=biber,
]{biblatex}
\bibliography{test_bib}
\makeatletter
\providecommand\***@faked{}
\providecommand\***@faked{}
\AtBeginDocument{%
\immediate\write\@mainaux{\noexpand\***@faked}%
\immediate\write\@mainaux{\noexpand\***@faked}}
\makeatother

\begin{document}

%\nocite{*}
\cite{companion}
\printbibliography
\end{document}
--
Mit freundlichen Grüßen
Ulrike Fischer
Stefan Pinnow
2010-10-22 15:00:19 UTC
Permalink
Hello Ulrike,
Post by Stefan Pinnow
has anybody an idea how to convince (pdf)texify to use biber
instead of bibtex?
Addition: the aux-file doesn't need to contain a \bibstyle and \bibdate
command. It is enough if there are commands which _starts_ with this
strings. So the following works too (and looks a bit
\documentclass{book}
\usepackage[
backend=biber,
]{biblatex}
\bibliography{test_bib}
\makeatother
\begin{document}
%\nocite{*}
\cite{companion}
\printbibliography
\end{document}
Your suggested way works perfect. Thank you very much for that.

I already had the biber.exe in the miktex\bin directory. When I remember
correctly this was suggested somewhere in the biber documentation.

Now the remaining question is, how to make the editor so clever to set the
BIBTEX variable somehow automatically. I'll ask on that mailing list. So
we'll see each other again there ;)


Best regards,
Stefan


PS: Does anybody know, if biber will be included in MiKTeX in the near
future?
(Otherwise it will be hard to convince beginners to use it.)

Loading...