12

I usually love my .latexmkrc settings. However I am trying to play with Template Toolkit to build a LaTeX file, then compile it with latexmk (all of this inside a perl script) and thus I would like to use the default latexmk settings (i.e. no preview continuously etc).

I would like to keep my .latexmkrc for personal use, therefore I am looking for a way to tell latexmk to ignore my $HOME/.latexmkrc file (via the -r flag?). Is this possible?

Joel Berger
  • 1,831
  • 1
  • 12
  • 16

2 Answers2

10

A belated answer: A new version of latexmk does what was asked for. This is v. 4.27a at

http://www.phys.psu.edu/~collins/latexmk/versions.html

Just invoke latexmk with the option -norc, and it will omit reading all its standard initialization files (system, user, and current directory). The -r option still works, so you use a customized initialization file.

John Collins
  • 11,183
  • 3
  • 32
  • 33
2

This isn't possible using the -r <rcfile> option, because it doesn't override the loading of $HOME/.latexmkrc but this file is loaded in addition. Multiple -r options can be given and all of these config files are loaded in the given order.

One possibility to stop latexmk in your perl script to read $HOME/.latexmkrc is to temporary change the HOME variable and to change the current directory away from $HOME (because latexmk also looks for a .latexmkrc in the current directory.

Something like:

# Perl code:
$ENV{HOME} = '/dev/null';
chdir('/tmp');
system("latexmk ...");

If you need the correct HOME anywhere else after this lines simply save it away and restore it afterwards.

Martin Scharrer
  • 262,582