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:
excltex
andxls
: if thexls
file is changed,exceltex
is invoked.excltex
andtex
: if thetex
file with\inccell
/\inctab
calls changes,exceltex
is 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 inlatexmkrc
is not identical to the code in the question. (b) Something else in one of yourlatexmkrc
files messes with the relevantlatexmk
internals. (c) Yourlatexmk
is 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 thelatexmkrc
files? – John Collins Apr 10 '13 at 16:25gnuplot
dependency and annomencl
dependency. Commenting out all dependencies and runninglatexmk
made theexcel2tex
dependency run. Afterwords I made sure that my other dependencies still work. Dafuq? – Holene Apr 12 '13 at 7:34latexmk
documentation. Send a minimal example that shows the problem (completelatexmkrc
files andtex
files), and we can take it from there. – John Collins Apr 12 '13 at 14:05