I'm working on getting exceltex and latexmk communicating by adding custom dependencies to .latexmkrc.
As far as I understand, exceltex works by writing an entry for each \inctab/inccell command to an excltx file upon compilation, and the using the Perl script Spreadsheet::ParseExcel to extract information from the .xls file. The manual routine: latexmk, exceltex, latexmk, and it works. So I believe I need the following dependency relations:
excltexandxls: if thexlsfile is changed,exceltexis invoked.excltexandtex: if thetexfile with\inccell/\inctabcalls changes,exceltexis invoked.
As I have understood, latexmk doesn't handle multiple files in one dependency, so I first focused on getting #2 working. I have tried:
add_cus_dep('excltx', 'tex', 0, 'excel2tex');
sub excel2tex {
system("exceltex \"$_[0].tex\"") ;
}
which makes latexmk generate the following output:
For rule 'cusdep excltx tex test', running '&do_cusdep( )' ...
Latexmk: Possible misconfiguration or bug:
In trying to apply custom-dependency rule
to make 'test.tex' from 'test.excltx'
the function name is blank.
My intention is that the dependency will trigger exceltex file.tex. Why doesn't this happen? How can I change my dependency such that it will run exceltex?
Follow up:
Assuming the above dependency works (which it does after commenting out all other dependencies in .latexmkrc, running latexmk and uncommenting the pacified dependencies), how can I make latexmk run exceltex when the xls file is changed? I have tried with
add_cus_dep('tex', 'xls', 0, 'excel2tex');
and
add_cus_dep('excltx', 'xls', 0, 'excel2tex');
(and both, for good measure). It works if I force a complete recompilation. With a normal compilation, where the content of the tex document is untouched but the xls file is changed, latexmk refuses to notice a change in just the xls file.
&do_cusdep( )reported, whereas it should be&do_cusdep( excel2tex )given your custom dependency's definition. Here are some possibilities: (a) The code inlatexmkrcis not identical to the code in the question. (b) Something else in one of yourlatexmkrcfiles messes with the relevantlatexmkinternals. (c) Yourlatexmkis not a standard one. (d) A bug inlatexmk, although I cannot reproduce it. What happens if the custom dependency is the only thing in any of thelatexmkrcfiles? – John Collins Apr 10 '13 at 16:25gnuplotdependency and annomencldependency. Commenting out all dependencies and runninglatexmkmade theexcel2texdependency run. Afterwords I made sure that my other dependencies still work. Dafuq? – Holene Apr 12 '13 at 07:34latexmkdocumentation. Send a minimal example that shows the problem (completelatexmkrcfiles andtexfiles), and we can take it from there. – John Collins Apr 12 '13 at 14:05