Is there a way to tell latexmk to run a certain command once it's done compiling everything? I haven't found anything in the documentation. Right now I'm using this latexmkrc:
$pdflatex = 'pdflatex -interaction=nonstopmode -file-line-error -synctex=1 %O %S'; $out_dir = 'build';
The reason I'm asking is because I'm using auctex in conjunction with latexmk, so I'd like the "View" command of auctex to open the pdf ; but for this, the pdf must be in the current directory, not in the build subdirectory. Besides, synctex only works when the synctex file is in the same directory. So I'd like to run something like
copy %D . & copy %Z%B.synctex.gz . at the end of the run.
I managed to do it on Linux: I added this line:
$pdflatex .= ' && cp %D %Z%B.synctex.gz .';
but the similar one on Windows fails:
$pdflatex .= ' && copy /y %D . && copy /y %Z%B.synctex.gz .';
This is not an issue with the syntax of the command: when I copy directly in the cmd prompt the command latexmk tells me it runs, it works. So there must be some weird issue.