I have a latexmkrc
file that looks like this:
$xelatex = 'xelatex -interaction=nonstopmode -synctex=1 %O %S; (sleep 10) && (test -f "%Z%R.synctex.gz") && (cp "%Z%R.synctex.gz" "%R.synctex.gz"); (test -f "%D") && (cp "%D" "%R.pdf")';
$pdflatex = 'pdflatex -interaction=nonstopmode -synctex=1 %O %S; (test -f "%Z%R.synctex.gz") && (cp "%Z%R.synctex.gz" "%R.synctex.gz"); (test -f "%D") && (cp "%D" "%R.pdf")';
$out_dir = '/tmp';
Latexmk automatically adds -no-pdf
since the %O
is specified. If this is the case, then it seems the commands after the xelatex command are run before the conversion of the extended dvi to pdf using xdvipdfmx
. My .pdf file is always corrupted in the local folder but if I open it in the /tmp folder it is fine. Is there a way to run these copy commands after the command for xdvipdfmx
when using the -no-pdf
.
Here is an image of what happens at the end. This is run after the copy commands above are already run. The pdf file copied is always corrupted.