[Tex/LaTex] How to set up the config file to have latexmk default to making a pdf


I can't see any situation where I would want to compile a dvi file. Therefore I'd like to have latexmk default to giving me a pdf via pdflatex, so I don't have to type -pdf every time. I've tried adding the following to my latexmkrc file without success:


$pdflatex = 'pdflatex --shell-escape %O %S';

and even


I'm on windows, so I can't just add it to my alias file. Is there a way to set up latexmk to make me a pdf unless I specify otherwise?

Best Answer

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.

Related Question