Biber certainly does not create these files for you automatically. Your best bet is probably a different programming language like Python or Perl with a library that can read .bib
files (https://github.com/sciunto-org/python-bibtexparser, https://pypi.org/project/biblib/, https://metacpan.org/pod/Text::BibTeX, ...).
For example the following Perl script
#!/usr/bin/perl
use strict;
use warnings;
use Text::BibTeX;
my ($bibfilename) = @ARGV;
unless (defined $bibfilename) {
die "Please provide a file name";
}
if (-f $bibfilename) {
print "Processing ${bibfilename}...\n";
} else {
die "File ${bibfilename} not found";
}
my $bibfile = Text::BibTeX::File->new($bibfilename);
my $entry;
while ($entry = Text::BibTeX::Entry->new($bibfile))
{
next unless $entry->parse_ok;
next unless $entry->metatype eq BTE_REGULAR;
my $key = $entry->key;
my $file = "bibannotation-${key}.tex";
unless (-e $file) {
open TMPFILE, '>', $file and close TMPFILE
or die "File error with $file: $!";
}
}
when saved as bibannotations.pl
and run as
perl bibannotations.pl <mybibfile.bib>
will produce empty files of the form bibannotation-<entrykey>.tex
for all entries in the .bib
file <mybibfile.bib>
.
Technically, you don't even need a different programming language, you can have TeX sort this out. Just load all relevant .bib
files in the following file and compile it with LaTeX, Biber, LaTeX.
\documentclass{article}
\usepackage[style=authoryear, backend=biber]{biblatex}
\nocite{*}
\newwrite\filehandle
\AtDataInput{%
\IfFileExists{bibannotation-\thefield{entrykey}.tex}
{}
{\immediate\openout\filehandle=bibannotation-\thefield{entrykey}.tex
\immediate\closeout\filehandle}%
}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{appleby,
author = {Humphrey Appleby},
title = {On the Importance of the Civil Service},
date = {1980},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Lorem ipsum
\end{document}
I believe, however, that there is little point in creating these files automatically. After all, you'll have to provide the contents of those files manually anyway. At least for the purposes of the loadfiles
option discussed in How to embed a review in biblatex? biblatex
will just skip over non-existing files meaning that there is no point in having an empty file present.
biblatex
automatically skips over non-existing files, I don't really see a point in creating the files automatically.