3

I am using latexmk to compile my LaTeX thesis. I keep the thesis on my Dropbox, and as the dozens-to-hundreds of .aux and associated files are created, Dropbox indexing induces a significant overhead.

I thus want to insert the following bash script before compilation starts to stop Dropbox:

#!/usr/bin/env bash
dropbox_pid="$echo $(pgrep Dropbox)"
kill -STOP $dropbox_pid

and correspondingly, to restart Dropbox at the end, I would like:

#!/usr/bin/env bash
dropbox_pid="$echo $(pgrep Dropbox)"
kill -CONT $dropbox_pid

How do I do this by editing the local latexmkrc?

arnab
  • 41
  • 5

2 Answers2

0

Not sure you will be able to send the SIGCONT signal from the latexmkrc ; isn't this file sourced before the compilation?

You could try to set a bash function such as:

compile () {
pkill -STOP Dropbox;
# compile_command "$@"
pkill -CONT Dropbox
}
damienfrancois
  • 52,978
  • 9
  • 96
  • 110
0

Setting the working directories ($aux_dir and $out_dir) to somewhere outside the Dropbox repository, you can avoid excessive Dropbox syncing.

The following is from my $HOME/.latexmk. It locates the working directory under ~/.tmp/tex/THE_NAME_OF_MY_WRITING_PROJECT and tries to create it if it is not present.

$aux_dir            = "$ENV{HOME}/.tmp/tex/" . basename(getcwd);
$out_dir            = $aux_dir;
mkpath($aux_dir);
ken
  • 333
  • 2
  • 11