Calling biber --tool using arara: trouble with commented @ symbol within .tex file?

It breaks for me with and without the %@ as my test file contains other crap too.

Your first call to biber is wrong, you are passing to it two file arguments: biber --tool mwe.bib mwe and that means that it tries to process two source files. At first as wanted the bib-file:

 Looking for bibtex format file './mwe.bib'

But then is also tries to resolve the request for the mwe without extensions and finds the tex file:

INFO - Looking for bibtex format file 'mwe'
 ....
INFO - Found BibTeX data source './mwe.tex'

When trying to make sense of the tex file is fails at the @ but probably lots of other input can trigger errors here - a tex file simply isn't a bib-file.

I don't see in the arara documentation a way to run biber without the second file argument so probably you need a new arara rule.


I made a file bibertool.yaml

!config
# Arara, the cool TeX automation tool
# Copyright (c) 2018, Paulo Roberto Massa Cereda 
# All rights reserved.
#
# This rule is part of arara.
identifier: bibertool
name: BiberTool
authors:
- Marco Daniel
- Paulo Cereda
commands:
- name: The Biber reference management software
  command: >
    @{
        return getCommand('biber', options);
    }
arguments:
- identifier: options
  flag: >
    @{
        if (isList(parameters.options)) {
            return parameters.options;
        }
        else {
            throwError('I was expecting a list of options.');
        }
    }

by just changing the line

return getCommand('biber', options, getBasename(file));

and fixing the identifier from the original biber.yaml. Saving this file as ~/arara/rules/bibertool and running arara on

% arara: bibertool: { options: [ '--tool', '--validate-datamodel', '--configfile=mwe.conf', './mwe.bib' ] }
% arara: pdflatex: { draft : yes}
% arara: biber
% arara: pdflatex

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{./_bibertool.bib}

%@

\begin{document}

All I need to cite is Kress \textit{et al.}\supercite{Kress1988}

\printbibliography

\end{document}

produces the desired output, including the _bibertool.bib file

@article{Kress1988,
  author       = {Kress, Thomas H. and Leanna, Robert M.},
  date         = {1988},
  journaltitle = {Synthesis},
  pages        = {803--805},
  title        = {{Synthesis, Stability, and Reactions of 2,6-Dichlorophenyllithium}},
}

Tags:

Biber

Arara