# PDF-generating modes are: # 1: pdflatex, as specified by $pdflatex variable (still largely in use) # 2: postscript conversion, as specified by the $ps2pdf variable (useless) # 3: dvi conversion, as specified by the $dvipdf variable (useless) # 4: lualatex, as specified by the $lualatex variable (best) # 5: xelatex, as specified by the $xelatex variable (second best) $pdf_mode=4; $preview_mode=0; $out_dir="output"; $pdf_previewer = "SumatraPDF -reuse-instance -inverse-search -a %O %S"; @default_files=("*.tex"); # nonstopmode will print more infomations $lualatex="lualatex -shell-escape -synctex=1 -interaction=batchmode %O %S"; $success_cmd="internal mycopy %D"; sub mycopy { use File::Copy; use File::Basename; my $pdf = $_[0]; my $name = basename($pdf); my $relpdf = "pdf/".$name; copy($pdf, $name); copy($pdf, $relpdf); # replace extension ".pdf" with ".synctex.gz" $pdf =~ s{\.[^.]*(?:\.pdf)?$}{.synctex.gz}; copy($pdf, "."); } # Add custom dependency. # latexmk checks whether a file with ending as given in the 2nd # argument exists ('toextension'). If yes, check if file with # ending as in first argument ('fromextension') exists. If yes, # run subroutine as given in fourth argument. # Third argument is whether file MUST exist. If 0, no action taken.