2

I need to do some pre-processing to a bib file that is generated by a reference manager before passing it to biblatex. So I have created a script to this and tried to automate the call to this script with latexmk.

Since add_cus_dep only handles extensions and not whole file names, I have tried something like this:

  • thesis.bibinput is my unprocessed source file
  • I want to generate thesis.bib

I have added the following fragment to latexmkrc:

add_cus_dep('bibinput', 'bib', 1, 'bibfix');
sub bibfix {
    system("bibfix -x bibfix_transform.py \"$_[0]\" thesis.bib");
}

However, when compiling the document, the custom step is not called and the bib file is not generated.

I am using biblatex with biber and latexmk correctly outputs that biber didn't find the input file:

Biber error: [244] Utils.pm:180> ERROR - Cannot find 'thesis.bib'!
Latexmk: Biber did't find bib file [thesis.bib]
Latexmk: Summary of warnings:
  Latex failed to resolve 36 citation(s)

How can I convince latexmk to generate my bib file?

  • Just wondering, is there supposed to be a space between - and x in the above? – daleif May 2 '17 at 16:57
  • oops, no. But the command should fail in this case and latexmk would have to raise the error. Even this didn't happen. – languitar May 2 '17 at 21:35
  • $_[0] is missing the extension, but that's not your problem I guess. Can you produce a minimal complete example? – Michaël Jan 15 '18 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.