How do I set up my config file to have latexmk default to making a pdf?

You need $pdf_mode = 1; to enable pdf mode. The manual says it is the same as the option:

...

Equivalent to the -pdf-, -pdf, -pdfdvi, -pdfps options.

As of 17 August 2016, latexmk follows the XDG Base Directory Specification and looks for its configuration file in $XDG_CONFIG_HOME/latexmk/latexmkrc (or $HOME/.config/latexmk/latexmkrc if the $XDG_CONFIG_HOME environment variable is empty or unset). It will also check $HOME/.latexmkrc for compatibility with older versions.


Here is my complete .latexmkrc file:

$recorder = 1;
$pdf_mode = 1;
$bibtex_use = 2;
$pdflatex = "pdflatex --shell-escape %O %S";
$pdf_previewer = "start open -a preview %O %S";

add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');

sub run_makeglossaries {
  if ( $silent ) {
    system "makeglossaries -q '$_[0]'";
  }
  else {
    system "makeglossaries '$_[0]'";
  };
}

push @generated_exts, 'glo', 'gls', 'glg';
push @generated_exts, 'acn', 'acr', 'alg';
$clean_ext .= ' %R.ist %R.xdy';

For more latexmk example_rcfiles and extra-scripts :

http://ctan.org/tex-archive/support/latexmk/example_rcfiles

http://ctan.org/tex-archive/support/latexmk/extra-scripts


On Windows, latexmk looks for the file .latexmkrc in the directory specified by the USERPROFILE environment variable. This usually is C:\Users\[user name]\

If you add:

$pdf_mode = 1;

to this file, latexmk will default to create a PDF file.

Tags:

Latexmk