texlive[48992] trunk: latexmk (25oct18)

commits+karl at tug.org commits+karl at tug.org
Thu Oct 25 23:35:08 CEST 2018


Revision: 48992
          http://tug.org/svn/texlive?view=revision&revision=48992
Author:   karl
Date:     2018-10-25 23:35:08 +0200 (Thu, 25 Oct 2018)
Log Message:
-----------
latexmk (25oct18)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
    trunk/Master/texmf-dist/doc/man/man1/latexmk.1
    trunk/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf
    trunk/Master/texmf-dist/doc/support/latexmk/CHANGES
    trunk/Master/texmf-dist/doc/support/latexmk/INSTALL
    trunk/Master/texmf-dist/doc/support/latexmk/README
    trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/README-latexmk-rcfiles
    trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/pythontex-latexmkrc
    trunk/Master/texmf-dist/doc/support/latexmk/latexmk.pdf
    trunk/Master/texmf-dist/doc/support/latexmk/latexmk.txt
    trunk/Master/texmf-dist/scripts/latexmk/latexmk.pl

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/exceltex1.sty

Modified: trunk/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl	2018-10-25 21:34:47 UTC (rev 48991)
+++ trunk/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl	2018-10-25 21:35:08 UTC (rev 48992)
@@ -121,8 +121,8 @@
 
 $my_name = 'latexmk';
 $My_name = 'Latexmk';
-$version_num = '4.59';
-$version_details = "$My_name, John Collins, 7 August 2018";
+$version_num = '4.61';
+$version_details = "$My_name, John Collins, 25 October 2018";
 
 use Config;
 use File::Basename;
@@ -222,7 +222,27 @@
 ##
 ## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
 ##
-##  7 Aug 2018 John Collins  V. 4.59
+## 25 Oct 2018 John Collins  Fix definition of clean up substitution for %R
+##                             so that something with intermediate %R works,
+##                             as in 'pythontex-files-%R/*'.
+## 24 Oct 2018 John Collins  V. 4.61
+## 16 Oct 2018 John Collins  Routines for setting all of $latex, etc.
+##                           Variables, options, substitutable parameters
+##                             for executing code in *latex before inputting
+##                             source file.
+## 10 Oct 2018 John Collins  Fix problem that if biber gets a remote file,
+##                              it would be deleted and latexmk would report
+##                              it as missing, incorrectly.
+##  8 Oct 2018 John Collins  Report count of warnings about missing characters
+##                             (typically unavailable Unicode characters).
+##                             Messages about this may appear only in the .log
+##                             file and are therefore easily missed by the user.
+##                           V. 4.60a
+## 21 Sep 2018 John Collins  Fix bug that --gg with --deps-file doesn't
+##                             create deps file.
+##  3 Sep 2018 John Collins  -pdfxelatex and -pdflualatex options
+##  3 Sep 2018 John Collins  V. 4.60
+##  7 Aug 2018 John Collins  V. 4.59  Released on CTAN
 ##  1 Aug 2018 John Collins  Correct sub rdb_find_source_file.
 ## 30 Jul 2018 John Collins  Change handling of warnings for a difference 
 ##                             between actual and expected output filenames
@@ -363,18 +383,18 @@
 ## "" means not determined. Obtain from first line of .log file.
 $tex_distribution = '';
 
-## Commands to invoke latex, pdflatex, etc
-$latex  = 'latex %O %S';
-$pdflatex = 'pdflatex %O %S';
-$lualatex = 'lualatex %O %S';
-# Note that xelatex is used to give xdv file, not pdf file, hence the -no-pdf option.
-# See also setting of $xelatex_default_switches, which overcomes user mal-configuration
-$xelatex = 'xelatex -no-pdf %O %S';
+&std_tex_cmds;
 
+# Possible code to execute by *latex before inputting source file.
+# Not used by default.
+$pre_tex_code = '';
+
 ## Default switches:
 $latex_default_switches = '';
 $pdflatex_default_switches = '';
 $lualatex_default_switches = '';
+    # Note that xelatex is used to give xdv file, not pdf file, hence 
+    # we need the -no-pdf option.
 $xelatex_default_switches = '-no-pdf';
 
 ## Switch(es) to make them silent:
@@ -1245,6 +1265,7 @@
 $reference_changed = 0;
 $mult_defined = 0;
 $bad_reference = 0;
+$bad_character = 0;
 $bad_citation = 0;
 @primary_warning_summary = ();
 
@@ -1701,6 +1722,7 @@
   elsif (/^-pdf-$/)  { $pdf_mode = 0; }
   elsif (/^-pdfdvi$/){ $pdf_mode = 3; }
   elsif (/^-pdflua$/){ $pdf_mode = 4; }
+  elsif (/^-pdfps$/) { $pdf_mode = 2; }
   elsif (/^-pdfxe$/) { $pdf_mode = 5; }
 #  elsif (/^-pdflatex$/) {
 #      $pdflatex = "pdflatex %O %S";
@@ -1710,7 +1732,15 @@
   elsif (/^-pdflatex=(.*)$/) {
       $pdflatex = $1;
   }
-  elsif (/^-pdfps$/) { $pdf_mode = 2; }
+  elsif (/^-pdflualatex=(.*)$/) {
+      $lualatex = $1;
+  }
+  elsif (/^-pdfxelatex=(.*)$/) {
+      $xelatex = $1;
+  }
+  elsif (/^-pretex=(.*)$/) {
+      $pre_tex_code = $1;
+  }
   elsif (/^-print=(.*)$/) {
       $value = $1;
       if ( $value =~ /^dvi$|^ps$|^pdf$|^auto$/ ) {
@@ -1761,10 +1791,16 @@
      exit;
   }
   elsif (/^-silent$/ || /^-quiet$/ ){ $silent = 1; }
+  elsif (/^-stdtexcmds$/) { &std_tex_cmds; }
   elsif (/^-time$/) { $show_time = 1;}
   elsif (/^-time-$/) { $show_time = 0;}
   elsif (/^-use-make$/)  { $use_make_for_missing_files = 1; }
   elsif (/^-use-make-$/)  { $use_make_for_missing_files = 0; }
+  elsif (/^-usepretex$/) { &alt_tex_cmds; }
+  elsif (/^-usepretex=(.*)$/) {
+      &alt_tex_cmds;
+      $pre_tex_code = $1;
+  }
   elsif (/^-v$/ || /^-version$/)   { 
       print "\n$version_details. Version $version_num\n";
       exit;
@@ -2180,14 +2216,31 @@
     $deps_file = '-';
 }
 
+# Since deps_file is global (common to all processed files), we must
+# delete it here when doing a clean up, and not in the FILE loop, where
+# per-file processing (including clean-up) is done
+if ( ($cleanup_mode > 0) &&  $dependents_list && ( $deps_file ne '-' ) ) {
+    unlink_or_move( $deps_file );
+}
+
 # In non-pvc mode, the dependency list is global to all processed TeX files,
-# so we open a single file here, and add items to it after processing each file
-# But in -pvc mode, the dependency list should be written after round of
-# processing the single TeX file (as if each round were a separate run of
-# latexmk).  There's undoubtedly some non-optimal structuring here!
-if ( $dependents_list && ! $preview_continuous_mode ) {
+#   so we open a single file here, and add items to it after processing
+#   each file.  But in -pvc mode, the dependency list should be written
+#   after round of processing the single TeX file (as if each round were
+#   a separate run of latexmk).
+# If we are cleaning up ($cleanup_mode != 0) AND NOT continuing to
+#   make files (--gg option and $go_mode == 2), deps_file should not be
+#   created.
+# I will use definedness of $deps_handle as flag for global deps file having
+#   been opened and therefore being available to be written to after
+#   compiling a file.
+$deps_handle = undef;
+if ( $dependents_list
+     && ! $preview_continuous_mode
+     && ( ($cleanup_mode == 0) || ($go_mode == 2) )
+   ) {
     $deps_handle = new FileHandle "> $deps_file";
-    if (! defined $deps_handle ) {
+    if (! $deps_handle ) {
         die "Cannot open '$deps_file' for output of dependency information\n";
     }
 }
@@ -2399,9 +2452,6 @@
         unlink_or_move( 'texput.log', "texput.aux", "missfont.log",
                 keys %index_bibtex_generated, 
                 keys %aux_files );
-        if ( $dependents_list && ( $deps_file ne '-' ) ) {
-            unlink_or_move( $deps_file );
-        }
         if ($cleanup_includes_generated) {
             unlink_or_move( keys %other_generated );
         }
@@ -2530,7 +2580,7 @@
       rdb_for_some( [keys %one_time], \&rdb_run1 );
     }
     if ($#primary_warning_summary > -1) {
-	# N.B. $mult_defined, $bad_reference, $bad_citation also available here.
+	# N.B. $mult_defined, $bad_reference, $bad_character, $bad_citation also available here.
         if ($warnings_as_errors) {
             $failure = 1;
 	    $failure_msg = "Warning(s) from latex (or c.) for '$filename'; treated as error";
@@ -2614,6 +2664,22 @@
 #############################################################
 #############################################################
 
+sub set_tex_cmds {
+    # Usage, e.g., set_tex_cmds( '%O %S' )
+    my $args = $_[0];
+    foreach my $cmd ('latex', 'lualatex', 'pdflatex', 'xelatex' ) {
+	${$cmd} = "$cmd $args";
+    }
+    # N.B. See setting of $latex_default_switches, ...,
+    # $xelatex_default_switches, etc, for any special options needed.
+}
+
+sub std_tex_cmds { set_tex_cmds( '%O %S' ); }
+
+sub alt_tex_cmds { set_tex_cmds( '%O %P' ); }
+
+#========================
+
 sub test_fix_texnames {
     my $illegal_char = 0;
     my $unbalanced_quote = 0;
@@ -3512,7 +3578,9 @@
     my $dir = fix_pattern( shift );
     my $root_fixed = fix_pattern( $root_filename );
     foreach (@_) { 
-        (my $name = /%R/ ? $_ : "%R.$_") =~ s/%R/${dir}${root_fixed}/;
+        my $name = /%R/ ? $_ : "%R.$_";
+	$name =~ s/%R/${root_fixed}/;
+	$name = $dir.$name;
         unlink_or_move( my_glob( "$name" ) );
     }
 } #END cleanup1
@@ -3697,9 +3765,13 @@
   "   -pdfdvi - generate pdf by dvipdf\n",
   "   -pdflatex=<program> - set program used for pdflatex.\n",
   "                      (replace '<program>' by the program name)\n",
+  "   -pdflualatex=<program> - set program used for lualatex.\n",
+  "                      (replace '<program>' by the program name)\n",
   "   -pdfps - generate pdf by ps2pdf\n",
   "   -pdflua - generate pdf by lualatex\n",
   "   -pdfxe - generate pdf by xelatex\n",
+  "   -pdfxelatex=<program> - set program used for xelatex.\n",
+  "                      (replace '<program>' by the program name)\n",
   "   -pdf-  - turn off pdf\n",
   "   -ps    - generate postscript\n",
   "   -ps-   - turn off postscript\n",
@@ -3706,6 +3778,8 @@
   "   -pF <filter> - Filter to apply to postscript file\n",
   "   -p     - print document after generating postscript.\n",
   "            (Can also .dvi or .pdf files -- see documentation)\n",
+  "   -pretex=<TeX code> - Sets TeX code to be executed before inputting source\n",
+  "                    file, if commands suitable configured\n",    
   "   -print=dvi     - when file is to be printed, print the dvi file\n",
   "   -print=ps      - when file is to be printed, print the ps file (default)\n",
   "   -print=pdf     - when file is to be printed, print the pdf file\n",
@@ -3730,10 +3804,14 @@
   "   -showextraoptions  - Show other allowed options that are simply passed\n",
   "               as is to latex and pdflatex\n",
   "   -silent   - silence progress messages from called programs\n",
+  "   -stdtexcmds - Sets standard commands for *latex\n",    
   "   -time     - show CPU time used\n",
   "   -time-    - don't show CPU time used\n",
   "   -use-make - use the make program to try to make missing files\n",
   "   -use-make- - don't use the make program to try to make missing files\n",
+  "   -usepretex - Sets commands for *latex to use extra code before inputting\n",
+  "                source file\n",    
+  "   -usepretex=<TeX code> - Equivalent to -pretex=<TeX code> -usepretex\n",
   "   -v        - display program version\n",
   "   -verbose  - display usual progress messages from called programs\n",
   "   -version      - display program version\n",
@@ -3841,6 +3919,7 @@
     my $not_found_count = 0;
     my $control_file_missing = 0;
     my $control_file_malformed = 0;
+    my %remote = ();                # List of extensions of remote files
     while (<$log_file>) {
         if (/> WARN /) { 
             print "Biber warning: $_"; 
@@ -3872,13 +3951,34 @@
                 }
             }
         }
+        elsif ( /> INFO - Data source '([^']*)' is a remote BibTeX data source - fetching/
+	    ){
+	    my $spec = $1;
+            my ( $base, $path, $ext ) = fileparseA( $spec );
+            $remote{$ext} = 1;
+	}
         elsif ( /> INFO - Found .* '([^']+)'\s*$/
                 || /> INFO - Found '([^']+)'\s*$/
                 || /> INFO - Reading '([^']+)'\s*$/
                 || /> INFO - Processing .* file '([^']+)' .*$/
-              ) {
-            if ( defined $Pbiber_source ) {
-                push @$Pbiber_source, $1;
+	    ) {
+	    my $file = $1;
+            my ( $base, $path, $ext ) = fileparseA( $file );
+	    if ($remote{$ext} && ( $base =~ /^biber_remote_data_source/ ) && 1) {
+		# Ignore the file, which appears to be a temporary local copy
+		# of a remote file. Treating the file as a source file will
+		# be misleading, since it will normally have been deleted by
+		# biber itself.
+	    }
+            elsif ( (defined $Pbiber_source) && (-e $file) ) {
+		# Note that biber log file gives full path to file. (No search is
+		# needed to find it.)  The file must have existed when biber was
+		# run.  If it doesn't exist now, a few moments later, it must
+		# have gotten deleted, probably by biber (e.g., because it is a
+		# copy of a remote file).
+		# So I have included a condition above that the file must
+		# exist to be included in the source-file list.
+                push @$Pbiber_source, $file;
             }
         }
         elsif ( /> INFO - WARNINGS: ([\d]+)\s*$/ ) {
@@ -4155,6 +4255,7 @@
     $reference_changed = 0;
     $mult_defined = 0;
     $bad_reference = 0;
+    $bad_character = 0;
     $bad_citation = 0;
 
     my $log_file = new FileHandle;
@@ -4342,6 +4443,12 @@
             push @warning_list, $1;
             $bad_citation++;
         }
+        elsif ( /^Missing character: There is no /
+  	        || /^! Package inputenc Error: Unicode character /
+	        || /^! Bad character code /
+	    ) {
+            $bad_character++;
+        } 
         elsif ( /^Document Class: / ) {
             # Class sign-on line
             next LINE;
@@ -5652,7 +5759,7 @@
     local $pwd_latex = undef;     # Cwd as reported in fls file by (pdf)latex
 
     # The following are also returned, but are global, to be used by caller
-    # $reference_changed, $bad_reference $bad_citation, $mult_defined
+    # $reference_changed, $bad_reference, $bad_character, $bad_citation, $mult_defined
 
     # Do I have my own eps-to-pdf conversion?
     my $epspdf_cusdep = 0;
@@ -6672,7 +6779,7 @@
     rdb_write( $fdb_name );
 
     if ($#primary_warning_summary > -1) {
-	# N.B. $mult_defined, $bad_reference, $bad_citation also available here.
+	# N.B. $mult_defined, $bad_reference, $bad_character, $bad_citation also available here.
         show_array( "$My_name: Summary of warnings from last run of (pdf)latex:", 
                     @primary_warning_summary );
     }
@@ -7302,16 +7409,25 @@
     my $q = $quote_filenames ? '"' : '';
 
     my %subst = ( 
+       '%B' => $q.$base.$q,
+       '%D' => $q.$dest.$q,
        '%O' => $options,
+       '%S' => $q.$source.$q,
        '%R' => $q.$root_filename.$q,
-       '%B' => $q.$base.$q,
+       '%S' => $q.$source.$q,
        '%T' => $q.$texfile_name.$q,
-       '%S' => $q.$source.$q,
-       '%D' => $q.$dest.$q,
        '%Y' => $q.$aux_dir1.$q,
        '%Z' => $q.$out_dir1.$q,
        '%%' => '%'         # To allow literal %B, %R, etc, by %%B.
-    );
+	);
+    if ($pre_tex_code) {
+	$subst{'%U'} = $q.$pre_tex_code.$q;
+	$subst{'%P'} = "$q$pre_tex_code\\input{$source}$q";
+    }
+    else {
+	$subst{'%U'} = '';
+	$subst{'%P'} = $subst{'%S'};
+    }
     if ( ($^O eq "MSWin32" ) && $MSWin_back_slash ) {
         foreach ( '%R', '%B', '%T', '%S', '%D', '%Y', '%Z' ) {
             $subst{$_} =~ s(/)(\\)g;
@@ -7451,6 +7567,11 @@
         push @primary_warning_summary,
              "Latex found $mult_defined multiply defined reference(s)";
     }
+    if ($bad_character) {
+        push @primary_warning_summary,
+	    "=====Latex reported missing or unavailable character(s).\n".
+	    "=====See log file for details.";
+    }
     if ($bad_citation) {
         push @primary_warning_summary,
              "Latex failed to resolve $bad_citation citation(s)";

Modified: trunk/Master/texmf-dist/doc/man/man1/latexmk.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/latexmk.1	2018-10-25 21:34:47 UTC (rev 48991)
+++ trunk/Master/texmf-dist/doc/man/man1/latexmk.1	2018-10-25 21:35:08 UTC (rev 48992)
@@ -1,4 +1,4 @@
-.TH LATEXMK 1 "7 August 2018" ""
+.TH LATEXMK 1 "25 October 2018" ""
 .SH NAME
 latexmk \- generate LaTeX document
 .SH SYNOPSIS
@@ -248,6 +248,9 @@
 search path as \fIbibtex\fR and \fIbiber\fR.  If this problem arises, use the
 \fB-bibtex\fR option when invoking \fIlatexmk\fR.)
 
+Note that this value does \fInot\fR work properly if the document uses
+\fIbiber\fR instead of \fIbibtex\fR.  (There's a long story why not.)
+
 .TP
 .B -bibtex-cond1
 The same as \fB-bibtex-cond1\fR except that .bbl files are only
@@ -351,6 +354,12 @@
 a GUI configured to invoke \fIlatexmk\fR with a full pathname for the
 source file.
 
+This option works by setting the \fB$do_cd\fR configuration variable
+to one; you can set that variable if you want to configure
+\fIlatexmk\fR to have the effect of the \fB-cd\fR option without
+specifying it on the command line.  See the documentation for that
+variable.
+
 .TP 
 .B -cd-
 Do NOT change to the directory containing the main source file before processing
@@ -363,6 +372,10 @@
 \fIlatexmk\fR with a full pathname for the source file.  See the
 \fB-cd\fR option.
 
+This option works by setting the \fB$do_cd\fR configuration variable
+to zero.  See the documentation for that variable for more
+information.
+
 .TP 
 .B -CF
 Remove the file containing the database of source file information,
@@ -732,7 +745,8 @@
 when the creation of the .xdv file by \fIxelatex\fR is fast.  So the
 use of the intermediate .xdv file can result in substantial gains in
 procesing time, since the .pdf file is produced once rather than on
-every run of \fIxelatex\fR.)
+every run of \fIxelatex\fR. See the documentation on the \fB-pdfxe\fR
+option for why an .xdv file is used.
 
 .TP
 .B -pdf-
@@ -756,7 +770,9 @@
      latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S"  foo.tex
 
 The specification of the contents of the string are the same as for
-the \fI$pdflatex\fR configuration variable.  Depending on your
+the \fI$pdflatex\fR configuration variable.  (The option
+\fB-pdflatex\fR in fact sets the variable \fI$pdflatex\fR.)
+Depending on your
 operating system and the command-line shell you are using, you may
 need to change the single quotes to double quotes (or something
 else). 
@@ -765,6 +781,52 @@
 for \fIpdflatex\fR) see the \fB-latex\fR option.
 
 .TP
+.B -pdflualatex="COMMAND"
+This sets the string specifying the command to run \fIlualatex\fR.  It
+behaves like the \fB-pdflatex\fR option, but sets the variable
+\fI$lualatex\fR.  
+
+.TP
+.B -pdfxelatex="COMMAND"
+This sets the string specifying the command to run \fIlualatex\fR.  It
+behaves like the \fB-pdflatex\fR option, but sets the variable
+\fI$xelatex\fR.
+
+\fIWarning\fR: It is important to ensure that the -no-pdf is used when
+\fIxelatex\fR is invoked; see the explanation for the variable
+\fI$xelatex\fR for why this is necessary.  If you provide %O in the
+command specification, this will be done automatically.
+
+An example of the use of the \fB-pdfxelatex\fR option:
+
+     latexmk -pdfxe -pdfxelatex="xelatex --shell-escape %O %S"  foo.tex
+
+
+.TP
+.B -pretex=CODE
+
+Given that CODE is some TeX code, this options sets that code to be
+executed before inputting source file.  This only works if the command
+for invoking the relevant \fI*latex\fR is suitably configured.  See
+the documentation of the variable \fI$pre_tex_cmd\fR, and the
+substitution strings %P and %U for more details.  This option works by
+setting the variable \fI$pre_tex_cmd\fR.
+
+See also the \fB-usepretex\fR option.
+
+An example:
+
+    latexmk -pretex='\\AtBeginDocument{Message\\par}' -usepretex foo.tex
+
+But this is better written
+
+    latexmk -usepretex='\\AtBeginDocument{Message\\par}' foo.tex
+
+If you already have a suitable command configured, you only need
+
+    latexmk -pretex='\\AtBeginDocument{Message\\par}' foo.tex
+
+.TP
 .B -print=dvi, -print=ps, -print=pdf, -print=auto,
 Define which kind of file is printed.  This option also ensures that
 the requisite file is made, and turns on printing.
@@ -970,8 +1032,8 @@
 .B -silent
 Run commands silently, i.e., with options that reduce the amount of
 diagnostics generated.  For example, with the default settings, the
-command "latex -interaction=batchmode" is used for \fI(pdf)latex\fR
-and friends.
+command "latex -interaction=batchmode" is used for \fIlatex\fR,
+and similarly for its friends.
 
 See also the \fB-logfilewarninglist\fR and \fB-logfilewarninglist-\fR
 options. 
@@ -989,6 +1051,16 @@
 and \fI$xelatex_silent_switch\fR
 
 .TP
+.B -stdtexcmds
+Sets the commands for \fIlatex\fR, etc, so that they are the standard
+ones. This is useful to override special configurations.
+
+The result is that \fI$latex = 'latex %O %S'\fR, and similarly for
+\fI$pdflatex\fR, \fI$lualatex\fR, and \fI$xelatex\fR.  (The option
+\fB-no-pdf\fR needed for \fI$xelatex\fR is provided automatically,
+given that %O appears in the definition.)
+
+.TP
 .B -time
 Show CPU time used.
 See also the configuration variable \fI$show_time\fR.
@@ -1022,6 +1094,25 @@
 Do not use the make program to try to make missing files.  (Default.)
 
 .TP
+.B -usepretex
+Sets the command lines for \fIlatex\fR, etc, so that they use the code
+that is defined by the variable \fI$pre_tex_code\fR or that is set by
+the option \fB-pretex=CODE\fR to execute the specified TeX code before
+the source file is read.  This option overrides any previous
+definition of the command lines.
+
+The result is that \fI$latex = 'latex %O %P'\fR, and similarly for
+\fI$pdflatex\fR, \fI$lualatex\fR, and \fI$xelatex\fR.  (The option
+\fB-no-pdf\fR needed for \fI$xelatex\fR is provided automatically,
+given that %O appears in the definition.)
+
+.TP
+.B -usepretex=CODE
+Equivalent to \fB-pretex=CODE -usepretex\fR.  Example
+
+  latexmk -usepretex='\\AtBeginDocument{Message\\par}' foo.tex
+
+.TP
 .B -v, -version
 Print version number of \fIlatexmk\fR.
 
@@ -1160,7 +1251,7 @@
 way of doing this automatically.)  Of course, if the file has a
 different name, change bar.baz to the name of your file.
 
-g. See also the section \fBADVANCED CONFIGURATION: Some extra resources\fR.
+g. See also the section "Advanced Configuration: Some extra resources".
 
 h. Look on tex.stackexchange, i.e., at
 http://tex.stackexchange.com/questions/tagged/latexmk  Someone may
@@ -1254,8 +1345,9 @@
 .SH HOW TO SET VARIABLES IN INITIALIZATION FILES
 .PP
 The important variables that can be configured are described in the
-section "List of configuration variables usable in initialization
-files".  Syntax for setting these variables is of the following forms:
+section  "List of configuration variables usable in initialization
+files".  Syntax for setting these variables is of the following
+forms:
 .PP
 	$bibtex = 'bibtex %O %B';
 .PP
@@ -1324,6 +1416,16 @@
 .TP
 .B %O
 options
+.B %P
+If the variable \fI$pre_tex_code\fR is non-empty, then %P is
+substituted by the contents of \fI$pre_tex_code\fR followed by
+\fI\\input{SOURCE}\fR, where SOURCE stands for the name of the source
+file.  Appropriate quoting is done.  This enables TeX code to be
+passed to one of the \fI*latex\fR engines to be executed before the
+source file is read.
+
+If the variable \fI$pre_tex_code\fR is the empty string, then %P is
+equivalent to %S.
 .TP
 .B %R
 root filename.  This is the base name for the main tex file.  
@@ -1334,6 +1436,10 @@
 .TP
 .B %T
 The name of the primary tex file.
+.B %U
+If the variable \fI$pre_tex_code\fR is non-empty, then its value is
+substituted for %U (appropriately quoted).  Otherwise it is replaced
+by a null string.
 .TP
 .B %Y
 Name of directory for auxiliary output files (see the configuration
@@ -1517,7 +1623,12 @@
 
 .SH LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES
 .PP
-Default values are indicated in brackets.
+Default values are indicated in brackets.  Note that for variables
+that are boolean in character, concerning whether \fIlatexmk\fR does
+or does not behave in a certain way, a non-zero value, normally 1,
+indicates true, i.e., the behavior occurs, while a zero value
+indicates a false value, i.e., the behavior does not occur.
+
 .TP
 .B $always_view_file_via_temporary [0]
 Whether .ps and .pdf files are initially to be made in a temporary
@@ -1693,7 +1804,12 @@
 update the bbl 
 files, without testing for the existence of the bib files;
 always delete .bbl files in a cleanup.
- 
+
+Note that the value 1.5 does \fInot\fR work properly if the document
+uses \fIbiber\fR instead of \fIbibtex\fR.  (There's a long story why
+not.)
+
+
 .TP
 .B $cleanup_includes_cusdep_generated [0]
 If nonzero, specifies that cleanup also deletes files that are
@@ -1729,12 +1845,21 @@
 deleted, by using the place holder %R, as in commands, and it is also
 possible to use wildcards.  Thus setting
 
-   $clean_ext = "out %R-blx.bib %R-figures*.log";
+  $clean_ext = "out %R-blx.bib %R-figures*.log pythontex-files-%R/*";
 
 in an initialization file will imply that when a clean-up operation is
 specified, not only is the standard set of files deleted, but also
-files of the form FOO.out, FOO-blx.bib, and %R-figures*.log, where FOO
-stands for the basename of the file being processed (as in FOO.tex).
+files of the form FOO.out, FOO-blx.bib, %R-figures*.log, and
+pythontex-files-FOO/*, where FOO stands for the basename of the file
+being processed (as in FOO.tex).
+
+The files to be deleted are relative to the directory specified by
+\fI$aux_dir\fR.  (Note that if \fI$out_dir\fR but not \fI$aux_dir\fR
+is set, then in its initialization, \fIlatexmk\fR sets \fI$aux_dir\fR
+equal to \fI$out_dir\fR.  A normal situation is therefore that \fI$aux_dir\fR
+equals \fI$out_dir\fR, which is the only case supported by
+TeXLive, unlike MiKTeX.)
+
 .TP
 .B $clean_full_ext [""]
 Extra extensions of files for \fIlatexmk\fR to remove when the \fB-C\fR
@@ -1743,6 +1868,9 @@
 
 More general patterns are allowed, as for \fI$clean_ext\fR.
 
+The files specified by \fI$clean_full_ext\fR to be deleted are
+relative to the directory specified by \fI$out_dir\fR.
+
 .TP
 .B $compiling_cmd [""], $failure_cmd [""], $warning_cmd [""], $success_cmd [""]
 
@@ -1793,7 +1921,7 @@
 More complicated situations can best be handled by defining a Perl
 subroutine to invoke the necessary commands, and using the "internal"
 keyword in the definitions to get the subroutine to be invoked.  (See
-the section Format of Command Specifications for how to do this.)
+the section "Format of Command Specifications" for how to do this.)
 
 Naturally, the above settings that invoke the \fIxdotool\fR program
 are only applicable when the X-Window system is used for the relevant
@@ -2172,11 +2300,17 @@
 Normally not needed with current previewers.
 .TP
 .B $latex ["latex %O %S"]
-The LaTeX processing program.  Note that as with other programs, you
+Specifies the command line for
+the LaTeX processing program.  Note that as with other programs, you
 can use this variable not just to change the name of the program used,
 but also specify options to the program.  E.g.,
 
-	$latex = "latex --src-specials";
+	$latex = "latex --src-specials %O %S";
+
+To do a coordinated setting of all of \fI$latex\fR, \fI$pdflatex\fR,
+\fI$lualatex\fR, and \fI$xelatex\fR, see the section "Advanced
+Configuration".
+
 .TP
 .B %latex_input_extensions
 This variable specifies the extensions tried by \fIlatexmk\fR when it finds
@@ -2255,8 +2389,14 @@
 contains a space which would otherwise be misinterpreted. 
 .TP
 .B $lualatex ["lualatex %O %S"]
-The LaTeX processing program that is to be used when the \fIlualatex\fR
+Specifies the command line for
+the LaTeX processing program that is to be used when the \fIlualatex\fR
 program is called for (e.g., by the option \fB-lualatex\fR.
+
+To do a coordinated setting of all of \fI$latex\fR, \fI$pdflatex\fR,
+\fI$lualatex\fR, and \fI$xelatex\fR, see the section "Advanced
+Configuration".
+
 .TP
 .B %lualatex_input_extensions
 This variable specifies the extensions tried by \fIlatexmk\fR when it finds
@@ -2373,7 +2513,8 @@
 In \fI$pdf_mode\fR=3, it is ensured that a .dvi file is also made.
 .TP
 .B $pdflatex ["pdflatex %O %S"]
-The LaTeX processing program in a version that makes a pdf file instead
+Specifies the command line for
+the LaTeX processing program in a version that makes a pdf file instead
 of a dvi file.
 
 An example use of this variable is to add certain options to the
@@ -2386,6 +2527,10 @@
 instead of \fIpdflatex\fR.  There are now separate configuration
 variables for the use of \fIlualatex\fR or \fIxelatex\fR.  See
 \fI$lualatex\fR and \fI$xelatex\fR.)
+
+To do a coordinated setting of all of \fI$latex\fR, \fI$pdflatex\fR,
+\fI$lualatex\fR, and \fI$xelatex\fR, see the section "Advanced
+Configuration".
 .TP
 .B %pdflatex_input_extensions
 This variable specifies the extensions tried by \fIlatexmk\fR when it finds
@@ -2493,6 +2638,23 @@
 If some other request is made for which a postscript file is needed,
 then $postscript_mode will be set to 1.
 .TP
+.B $pre_tex_code ['']
+
+Sets TeX code to be executed before inputting the source file.  This
+works if the relevant one of \fI$latex\fR, etc contains a suitable
+command line with a %P or %U substitution.  For example you could do
+
+     $latex = 'latex %O %P';
+     $pre_tex_code = '\AtBeginDocument{An initial message\par}';
+
+To set all of \fI$latex\fR, \fI$pdflatex\fR, \fI$lualatex\fR, and
+\fI$xelatex\fR you could use the subroutine \fIalt_tex_cmds\fR:
+
+     &alt_tex_cmds;
+     $pre_tex_code = '\AtBeginDocument{An initial message\par}';
+
+
+.TP
 .B $preview_continuous_mode [0]
 If nonzero, run a previewer to view the document, and
 continue running \fIlatexmk\fR to keep .dvi up-to-date.  Equivalent to
@@ -2789,17 +2951,24 @@
 .B $xdvipdfmx_silent_switch ["-q"]
 Switch(es) for the \fIxdvipdfmx\fR program when silent mode is on.
 .TP
-.B $xelatex ["xelatex -no-pdf %O %S"]
-The LaTeX processing program of in a version that makes a pdf file instead
-of a dvi file, when the \fIxelatex\fR program is called for.  See the
+.B $xelatex ["xelatex %O %S"]
+Specifies the command line for
+the LaTeX processing program of
+when the \fIxelatex\fR program is called for.  See the
 documentation of the \fB-xelatex\fR option for some special properties
 of \fIlatexmk\fR's use of \fIxelatex\fR.
 
-Note the use of the \fB-no-pdf\fR option to force \fIxelatex\fR to
-make an .xdv rather than .pdf file, with the .pdf file being created
-in a separate step.  See the documentation of the \fB-pdfxe\fR option
-for more details.
+\fINote about xelatex\fR: Now \fIlatexmk\fR uses \fIxelatex\fR to make
+an .xdv rather than .pdf file, with the .pdf file being created in a
+separate step.  This is enforced by the use of the \fB-no-pdf\fR
+option.  If %O is part of the command for invoking \fIxelatex\fR, then
+\fIlatexmk\fR will insert the \fB-no-pdf\fR option automatically,
+otherwise you must provide the option yourself
 
+To do a coordinated setting of all of \fI$latex\fR, \fI$pdflatex\fR,
+\fI$lualatex\fR, and \fI$xelatex\fR, see the section "Advanced
+Configuration".
+
 .TP
 .B %xelatex_input_extensions
 This variable specifies the extensions tried by \fIlatexmk\fR when it finds
@@ -3210,6 +3379,39 @@
 .PP
 
 
+.SS Coordinated Setting of Commands for *latex
+
+To set all of \fI$latex\fR, \fI$pdflatex\fR, \fI$lualatex\fR, and
+\fI$xelatex\fR to a common pattern, you can use one of the following
+subroutines, std_tex_cmds, alt_tex_cmds, and set_tex_cmds.
+
+They work as follows
+
+   &std_tex_cmds;
+
+This results in \fI$latex = 'latex %O %S'\fR, and similarly for
+\fI$pdflatex\fR, \fI$lualatex\fR, and \fI$xelatex\fR.  Note the
+ampersand in the invocation; this indicates to Perl that a subroutine
+is being called.
+
+   &alt_tex_cmds;
+
+This results in \fI$latex = 'latex %O %P'\fR, and similarly for
+\fI$pdflatex\fR, \fI$lualatex\fR, and \fI$xelatex\fR.  Note the
+ampersand in the invocation; this indicates to Perl that a subroutine
+is being called.
+
+  set_tex_cmds( CMD_SPEC );
+
+Here CMD_SPEC is the command line without the program name. This
+results in \fI$latex = 'CMD_SPEC'\fR, and similarly for
+\fI$pdflatex\fR, \fI$lualatex\fR, and \fI$xelatex\fR. An example would
+be 
+
+  set_tex_cmds( '--interaction=batchmode %O %S' );
+
+.PP
+
 .SS Advanced configuration: Using \fIlatexmk\fB with \fImake\fR
 
 This section is targeted only at advanced users who use the \fImake\fR
@@ -3373,7 +3575,7 @@
 harvested too easily.)
 .SH AUTHOR
 Current version, by John Collins (username jcc8 at node psu.edu).
-(Version 4.59).
+(Version 4.61).
 
 Released version can be obtained from CTAN:
 <http://www.ctan.org/pkg/latexmk/>, and from the

Modified: trunk/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexmk/CHANGES
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/CHANGES	2018-10-25 21:34:47 UTC (rev 48991)
+++ trunk/Master/texmf-dist/doc/support/latexmk/CHANGES	2018-10-25 21:35:08 UTC (rev 48992)
@@ -645,3 +645,28 @@
   Only give warning about differing expected and output filenames when
     the extensions differ.  All other cases gave only false positives.
   Do better to ensure xelatex gets its -no-pdf option.
+
+From v. 4.59 to 4.61
+  Add -pdfxelatex and -pdflualatex options to set commands for
+    xelatex and lualatex (in analogy with -pdflatex and -latex).
+  Correct bug that use of -gg option with -deps-file option 
+    did not create deps file.
+  After run of latex/pdflatex (etc), report count of warnings about missing
+    characters (typically unavailable Unicode characters). Messages about
+    this may appear only in the .log file and are therefore easily missed
+    by the user.
+  Fix problem that if biber gets a remote file, latexmk would report it
+    incorrectly as a missing file.
+  Provide routines for setting all of $latex, etc, with a common pattern.
+  Variables, options, placeholders for executing code in *latex before
+    inputting source file.  The new variable is $pre_tex_code, the
+    options are -pretex, -usepretex, and the new placeholders are %P
+    and %U.
+  Improved definitions provided for the configuration of latexmk to
+    use pythontex; see the file pythontex-latexmkrc in the directory
+    example_rcfiles.
+  Correction to use of specifications in $clean_ext and
+    $clean_full_ext so that %R can appear in the interior of a string
+    as in 'pythontex-files-%R/*'. 
+  Updates of documentation.
+

Modified: trunk/Master/texmf-dist/doc/support/latexmk/INSTALL
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/INSTALL	2018-10-25 21:34:47 UTC (rev 48991)
+++ trunk/Master/texmf-dist/doc/support/latexmk/INSTALL	2018-10-25 21:35:08 UTC (rev 48992)
@@ -1,6 +1,6 @@
             INSTALLING latexmk
             ==================
-      (Version 4.59, 7 August 2018)
+      (Version 4.61, 25 October 2018)
 
             John Collins
             Physics Department

Modified: trunk/Master/texmf-dist/doc/support/latexmk/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/README	2018-10-25 21:34:47 UTC (rev 48991)
+++ trunk/Master/texmf-dist/doc/support/latexmk/README	2018-10-25 21:35:08 UTC (rev 48992)
@@ -1,4 +1,4 @@
-Latexmk, version 4.59, 7 Aug 2018
+Latexmk, version 4.61, 25 Oct 2018
 ----------------------------------
 
 Latexmk completely automates the process of generating a LaTeX
@@ -85,13 +85,9 @@
 7) Latexmk is archived on the CTAN tex archive --- see
    http://www.ctan.org/pkg/latexmk  
 
-8) [If for some reason you need to find the obsolete version 2, it can
-   also be found on CTAN, e.g., at
-   http://mirror.ctan.org/obsolete/support/latexmk/] 
-
 John Collins
 ---------------------------- "latexmk -h" ----------------------------
-Latexmk 4.59: Automatic LaTeX document generation routine
+Latexmk 4.61: Automatic LaTeX document generation routine
 
 Usage: latexmk [latexmk_options] [filename ...]
 
@@ -165,9 +161,13 @@
    -pdfdvi - generate pdf by dvipdf
    -pdflatex=<program> - set program used for pdflatex.
                       (replace '<program>' by the program name)
+   -pdflualatex=<program> - set program used for lualatex.
+                      (replace '<program>' by the program name)
    -pdfps - generate pdf by ps2pdf
    -pdflua - generate pdf by lualatex
    -pdfxe - generate pdf by xelatex
+   -pdfxelatex=<program> - set program used for xelatex.
+                      (replace '<program>' by the program name)
    -pdf-  - turn off pdf
    -ps    - generate postscript
    -ps-   - turn off postscript
@@ -174,6 +174,8 @@
    -pF <filter> - Filter to apply to postscript file
    -p     - print document after generating postscript.
             (Can also .dvi or .pdf files -- see documentation)
+   -pretex=<TeX code> - Sets TeX code to be executed before inputting source
+                    file, if commands suitable configured
    -print=dvi     - when file is to be printed, print the dvi file
    -print=ps      - when file is to be printed, print the ps file (default)
    -print=pdf     - when file is to be printed, print the pdf file
@@ -198,10 +200,14 @@
    -showextraoptions  - Show other allowed options that are simply passed
                as is to latex and pdflatex
    -silent   - silence progress messages from called programs
+   -stdtexcmds - Sets standard commands for *latex
    -time     - show CPU time used
    -time-    - don't show CPU time used
    -use-make - use the make program to try to make missing files
    -use-make- - don't use the make program to try to make missing files
+   -usepretex - Sets commands for *latex to use extra code before inputting
+                source file
+   -usepretex=<TeX code> - Equivalent to -pretex=<TeX code> -usepretex
    -v        - display program version
    -verbose  - display usual progress messages from called programs
    -version      - display program version

Modified: trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/README-latexmk-rcfiles
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/README-latexmk-rcfiles	2018-10-25 21:34:47 UTC (rev 48991)
+++ trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/README-latexmk-rcfiles	2018-10-25 21:35:08 UTC (rev 48992)
@@ -49,9 +49,18 @@
 
 6. Further assistance for latexmk can be provided when style files
    provide suitable messages about missing files.  See the
-   exceltex1.sty and pythontex1.sty files for examples of what is
-   needed.  These files are modifications of exceltex.sty and
-   pythontex.sty that provide the necessary assistance.  (The versions
-   were the ones current on 30 April 2013.)
+   exceltex1.sty file for an example of what is needed.  This file is
+   a modification of exceltex.sty and pythontex.sty that provide the
+   necessary assistance.  (The version on which the modification is
+   based is the one current on 30 April 2013.)  The necessary support
+   is in pythontex, in v. 0.16.
 
+7. Another technique, exemplified in pythontex-latexmkrc, is to append
+   lines to the .log file to simulate messages about missing files.
+   This provokes latexmk into deducing that the files are intended
+   source files.  If one of the other rules then can make that file,
+   correct dependency information is obtained.
 
+
+
+

Added: trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/exceltex1.sty
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/exceltex1.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/exceltex1.sty	2018-10-25 21:35:08 UTC (rev 48992)
@@ -0,0 +1,74 @@
+%% THIS IS A MODIFICATION BY JOHN COLLINS 30 Apr 2013 OF V. 0.5.1 OF
+%% exceltex.sty TO HELP latexmk.
+%% The modification consists of changing the calls to the
+%% \InputIfFileExists macro to a call to a new macro that provides a
+%% warning message when the file to be read does not exist.
+
+% get data from excel files into LaTeX
+%
+% (c) 2004-2006 by Hans-Peter Doerr <doerr at cip.physik.uni-freiburg.de>
+% 2013 John Collins <collins at phys.psu.edu>
+%
+% exceltex is free software. you can redistribute or modify it under
+% the terms of the GNU GENERAL PUBLIC LICENSE Version 2. See COPYING for
+% details.
+%
+\def\exceltexVersion{0.5.1JCC}
+%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{exceltex1}[2013/04/30 v.\exceltexVersion]
+\DeclareOption{cellrefs}{\def\cellrefs{1}}
+\ProcessOptions
+%
+\typeout{This is exceltex  v\exceltexVersion}
+% ulem needs option normalem for not breaking \em and \emph
+\RequirePackage[normalem]{ulem}
+\RequirePackage{color}
+%\RequirePackage{eurosym}
+%
+
+%% JCC's addition:
+\providecommand\InputFileOrMessage[3]{%
+   \InputIfFileExists{#1}%
+                     {#2}%
+                     {#3\PackageWarning{exceltex1}{File `#1' not found.}}%
+}
+%%
+
+\newcounter{exceltexCounterC}\setcounter{exceltexCounterC}{0}
+\newcounter{exceltexCounterT}\setcounter{exceltexCounterT}{0}
+%
+\immediate\openout 10=\jobname.excltx
+%
+%
+% write index header
+\ifx\cellrefs\undefined
+%
+\else
+\immediate\write 10{;cellrefs}
+\fi
+\immediate\write 10{;created by exceltex v. \exceltexVersion}
+%
+\newcommand{\inccell}[1]{%
+  \stepcounter{exceltexCounterC}%
+  \ifx\cellrefs\undefined%
+  \immediate\write 10{c:\theexceltexCounterC:#1}%
+  \InputFileOrMessage{\jobname-excltx/c-\theexceltexCounterC}{}{}%
+  \else
+  \immediate\write 10{c:#1}%
+  \InputFileOrMessage{\jobname-excltx/c-#1}{}{}%
+  \fi
+}%
+%
+%
+\newcommand{\inctab}[1]{%
+  \stepcounter{exceltexCounterT}%
+  \ifx\cellrefs\undefined%
+  \immediate\write 10{t:\theexceltexCounterT:#1}%
+  \InputFileOrMessage{\jobname-excltx/t-\theexceltexCounterT}{}{\\}%
+  \else
+  \immediate\write 10{t:#1}%
+  \InputFileOrMessage{\jobname-excltx/t-#1}{}{\\}%
+  \fi
+}%
+\endinput


Property changes on: trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/exceltex1.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/pythontex-latexmkrc
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/pythontex-latexmkrc	2018-10-25 21:34:47 UTC (rev 48991)
+++ trunk/Master/texmf-dist/doc/support/latexmk/example_rcfiles/pythontex-latexmkrc	2018-10-25 21:35:08 UTC (rev 48992)
@@ -1,66 +1,67 @@
-# This shows how to use the pythontex package with latexmk
-# This **present** version (1 April 2018) it only works when
-#   the operating system and the file system support symbolic
-#   links (e.g., linux, OS-X and other unix implementations with their
-#   usual file systems).  It is **not** tested on MS-Windows, but
-#   **may** work on recent versions.
-# In the future, a version of latexmk may provide better support
-#   without the restrictions.
+# Support for pythontex in v. 0.16 or higher.
+#
+# What these definitions provide/do:
+# 1. Variable specifying command string for invoking pythontex
+# 2. Definition of commands for latex, pdflatex, etc to call a
+#    subroutine latex_python that implements the necessary
+#    functionality, as follows:
+#    a. The latex, pdflatex program, etc is run.
+#    b. It is determined whether a file $root.pytxcode was generated
+#       during the run.  Here $root is the root name of the primary
+#       document file.  The $root.pytxcode, if present, is created in
+#       the output directory (or more exactly, the aux directory, if
+#       different from the  output directory.  It is a symptom of the
+#       use of pythontex. 
+#    c. If the file is present, a rule for running pythontex is set
+#       up, if it has not already been created.
+#    d. The source file for the rule is $root.pytxcode and the
+#       destination file is named $root.pytxmcr, which is always
+#       created in a subdirectory named pythontex-files-$root of the
+#       aux or output directory.  The file $root.pytxmcr is always
+#       created when pythontex is run, and is read when a document
+#       using pythontex is compiled (by latex, or pdflatex, etc)
+#    e. If that rule is being created for the first time, a message is
+#       appended to the .log file of the latex run about the
+#       $root.pytxmcr filename (with the appropriate prefix
+#       directory). This ensures that at the next stage of the
+#       processing, when latexmk examines the run's .log file, it
+#       creates appropriate dependency information and links the
+#       pythontex rule into the network of dependencies.
+# 3. Settings for the files generated by the pythontex package and the
+#    pythontex program so that the files are deleted in a clean-up
+#    operation.
 
-# This version also has a restriction that on initial runs pythontex
-#   is not invoked.  Later runs after a modification of the source
-#   file in the invoked python code do trigger the invocation of
-#   pythontex. The planned future enhancements of latexmk should
-#   remedy this.
-
-# This latexmkrc is an example of a style of configuration that may be
-#    useful for other packages.
-
-# This version has a fudge on the latex and pdflatex commands that
-#    allows the pythontex custom dependency to work even when $out_dir
-#    is used to set the output directory.  Without the fudge (done by
-#    trickery with symbolic links) the custom dependency for using
-#    pythontex will not be detected.
-
+$clean_ext .= " pythontex-files-%R/*";
 push @generated_exts, 'pytxcode';
-add_cus_dep('pytxcode', 'tex', 0, 'pythontex');
 
-$latex = 'internal mylatex %R %Z latex %O %S';
-$pdflatex = 'internal mylatex %R %Z pdflatex %O %S';
-$lualatex = 'internal mylatex %R %Z lualatex %O %S';
-$xelatex = 'internal mylatex %R %Z xelatex -no-pdf %O %S';
+$pythontex = 'pythontex %O %S';
 
-sub pythontex {
-    # This subroutine is a fudge, because it from latexmk's point of
-    # view, it makes the main .tex file depend on the .pytxcode file.
-    # But it doesn't actually make the .tex file, but is used for its
-    # side effects in creating other files.  The dependence is a way
-    # of triggering the rule to be run whenever the .pytxcode file
-    # changes, and to do this before running latex/pdflatex again.
-    return system("pythontex.py \"$_[0]\"") ;
+foreach my $cmd ('latex', 'lualatex', 'pdflatex', 'xelatex' ) {
+	${$cmd} = "internal latex_python %R %Y $cmd %O %S";
 }
 
-sub mylatex {
+sub latex_python {
+   # Run *latex, then set pythontex rule if needed.
+   # Arguments: Root name, directory for aux files (with terminator),
+   #            latex program to run, arguments for latex.
+
    my $root = shift;
    my $dir_string = shift;
-   my $code = "$root.pytxcode";
-   my $result = "pythontex-files-$root";
-   if ($dir_string) {
-      warn "mylatex: Making symlinks to fool cus_dep creation\n";
-      unlink $code;
-      if (-l $result) {
-          unlink $result;
-      }
-      elsif (-d $result) {
-         unlink glob "$result/*";
-         rmdir $result;
-      }
-      symlink $dir_string.$code, $code;
-      if ( ! -e $dir_string.$result ) { mkdir $dir_string.$result; }
-      symlink $dir_string.$result, $result;
+   my $pytx_code = "$dir_string$root.pytxcode";
+   my $result_dir = $dir_string."pythontex-files-$root";
+   my $pytx_out_file = "$result_dir/$root.pytxmcr";
+   my $pytx_rule_name = "pythontex $root";
+   my $ret = system @_;
+   if ( test_gen_file( $pytx_code ) ) {
+       print "=== Pythontex being used\n";
+       if (! rdb_rule_exists( $pytx_rule_name ) ) {
+           print "=== Creating rule '$pytx_rule_name'\n";
+	   rdb_create_rule( $pytx_rule_name, 'external', $pythontex, '', 1,
+	                    $pytx_code, $pytx_out_file, $root, 1 );
+           system "echo No file \"$pytx_out_file\". >> \"$dir_string$root.log\"";
+       }
    }
-   else {
-      foreach ($code, $result) { if (-l) { unlink; } }
-   }
-   return system @_;
+   return $ret;
 }
+
+

Modified: trunk/Master/texmf-dist/doc/support/latexmk/latexmk.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexmk/latexmk.txt
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexmk/latexmk.txt	2018-10-25 21:34:47 UTC (rev 48991)
+++ trunk/Master/texmf-dist/doc/support/latexmk/latexmk.txt	2018-10-25 21:35:08 UTC (rev 48992)
@@ -61,7 +61,7 @@
 
 
 
-                                 7 August 2018                               1
+                                25 October 2018                              1
 
 
 
@@ -127,7 +127,7 @@
 
 
 
-                                 7 August 2018                               2
+                                25 October 2018                              2
 
 
 
@@ -193,7 +193,7 @@
 
 
 
-                                 7 August 2018                               3
+                                25 October 2018                              3
 
 
 
@@ -259,7 +259,7 @@
 
 
 
-                                 7 August 2018                               4
+                                25 October 2018                              4
 
 
 
@@ -285,47 +285,47 @@
               same search path as bibtex and biber.  If this  problem  arises,
               use the -bibtex option when invoking latexmk.)
 
+              Note that this value does not work properly if the document uses
+              biber instead of bibtex.  (There's a long story why not.)
 
+
        -bibtex-cond1
-              The  same  as  -bibtex-cond1  except  that  .bbl  files are only
+              The same as  -bibtex-cond1  except  that  .bbl  files  are  only
               treated as precious if one or more bibfiles fails to exist.
 
-              Thus if all the bib files exist, bibtex or biber is run to  gen-
+              Thus  if all the bib files exist, bibtex or biber is run to gen-
               erate .bbl files as needed, and then it is appropriate to delete
               the bbl files in a cleanup operation since they can be re-gener-
               ated.
 
-              This  property can also be configured by setting the $bibtex_use
+              This property can also be configured by setting the  $bibtex_use
               variable to 1.5 in a configuration file.
 
 
        -bm <message>
-              A banner message to print diagonally across each page when  con-
-              verting  the dvi file to postscript.  The message must be a sin-
+              A  banner message to print diagonally across each page when con-
+              verting the dvi file to postscript.  The message must be a  sin-
               gle argument on the command line so be careful with quoting spa-
               ces and such.
 
-              Note  that  if  the  -bm  option is specified, the -ps option is
+              Note that if the -bm option is  specified,  the  -ps  option  is
               assumed.
 
 
        -bi <intensity>
-              How dark to print the banner message.  A decimal number  between
+              How  dark to print the banner message.  A decimal number between
               0 and 1.  0 is black and 1 is white.  The default is 0.95, which
               is OK unless your toner cartridge is getting low.
 
 
        -bs <scale>
-              A decimal number that specifies how  large  the  banner  message
-              will  be printed.  Experimentation is necessary to get the right
-              scale for your message, as a rule of thumb the scale  should  be
-              about  equal  to 1100 divided by the number of characters in the
-              message.  The default is 220.0 which is just right for 5 charac-
-              ter messages.
+              A  decimal  number  that  specifies how large the banner message
+              will be printed.  Experimentation is necessary to get the  right
+              scale  for  your message, as a rule of thumb the scale should be
 
 
 
-                                 7 August 2018                               5
+                                25 October 2018                              5
 
 
 
@@ -334,6 +334,11 @@
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              about equal to 1100 divided by the number of characters  in  the
+              message.  The default is 220.0 which is just right for 5 charac-
+              ter messages.
+
+
        -commands
               List the commands used by latexmk for processing files, and then
               exit.
@@ -341,131 +346,140 @@
 
        -c     Clean up (remove) all regeneratable files generated by latex and
               bibtex or biber except dvi, postscript and pdf.  These files are
-              a combination of log files, aux files, latexmk's  database  file
-              of  source file information, and those with extensions specified
-              in the @generated_exts  configuration  variable.   In  addition,
-              files  specified  by  the  $clean_ext configuration variable are
+              a  combination  of log files, aux files, latexmk's database file
+              of source file information, and those with extensions  specified
+              in  the  @generated_exts  configuration  variable.  In addition,
+              files specified by the  $clean_ext  configuration  variable  are
               removed.
 
-              This cleanup is instead of a regular make.  See the  -gg  option
+              This  cleanup  is instead of a regular make.  See the -gg option
               if you want to do a cleanup then a make.
 
-              Treatment  of  .bbl files:  If $bibtex_use is set to 0 or 1, bbl
-              files are always treated as non-regeneratable.   If  $bibtex_use
+              Treatment of .bbl files:  If $bibtex_use is set to 0 or  1,  bbl
+              files  are  always treated as non-regeneratable.  If $bibtex_use
               is set to 1.5, bbl files are counted as non-regeneratable condi-
-              tionally: If the bib file exists, then bbl files are  regenerat-
-              able,  and are deleted in a clean up.  But if $bibtex_use is 1.5
-              and a bib file doesn't exist, then the bbl files are treated  as
+              tionally:  If the bib file exists, then bbl files are regenerat-
+              able, and are deleted in a clean up.  But if $bibtex_use is  1.5
+              and  a bib file doesn't exist, then the bbl files are treated as
               non-regeneratable and hence are not deleted.
 
-              In  contrast,  if  $bibtex_use is set to 2, bbl files are always
+              In contrast, if $bibtex_use is set to 2, bbl  files  are  always
               treated as regeneratable, and are deleted in a cleanup.
 
-              Treatment  of  files   generated   by   custom   dependencies:If
-              $cleanup_includes_cusdep_generated   is  nonzero,  regeneratable
-              files are considered as  including  those  generated  by  custom
-              dependencies  and  are  also deleted.  Otherwise these files are
+              Treatment   of   files   generated   by  custom  dependencies:If
+              $cleanup_includes_cusdep_generated  is  nonzero,   regeneratable
+              files  are  considered  as  including  those generated by custom
+              dependencies and are also deleted.  Otherwise  these  files  are
               not deleted.
 
 
        -C     Clean up (remove) all regeneratable files generated by latex and
-              bibtex  or  biber.   This  is the same as the -c option with the
-              addition of dvi, postscript and pdf files, and  those  specified
+              bibtex or biber.  This is the same as the  -c  option  with  the
+              addition  of  dvi, postscript and pdf files, and those specified
               in the $clean_full_ext configuration variable.
 
-              This  cleanup  is instead of a regular make.  See the -gg option
+              This cleanup is instead of a regular make.  See the  -gg  option
               if you want to do a cleanup than a make.
 
-              See the -c option for the specification of whether or  not  .bbl
+              See  the  -c option for the specification of whether or not .bbl
               files are treated as non-regeneratable or regeneratable.
 
-              If  $cleanup_includes_cusdep_generated is nonzero, regeneratable
-              files are considered as  including  those  generated  by  custom
-              dependencies  and  are  also deleted.  Otherwise these files are
+              If $cleanup_includes_cusdep_generated is nonzero,  regeneratable
+              files  are  considered  as  including  those generated by custom
+              dependencies and are also deleted.  Otherwise  these  files  are
               not deleted.
 
 
-       -CA    (Obsolete).  Now equivalent to the -C option.  See  that  option
-              for details.
 
+                                25 October 2018                              6
 
 
 
-                                 7 August 2018                               6
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+       -CA    (Obsolete).   Now  equivalent to the -C option.  See that option
+              for details.
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
-
-       -cd    Change  to  the directory containing the main source file before
-              processing it.  Then all the generated files (.aux, .log,  .dvi,
+       -cd    Change to the directory containing the main source  file  before
+              processing  it.  Then all the generated files (.aux, .log, .dvi,
               .pdf, etc) will be relative to the source file.
 
-              This  option is particularly useful when latexmk is invoked from
-              a GUI configured to invoke latexmk with a full pathname for  the
+              This option is particularly useful when latexmk is invoked  from
+              a  GUI configured to invoke latexmk with a full pathname for the
               source file.
 
+              This option works by setting the $do_cd  configuration  variable
+              to  one;  you  can  set  that  variable if you want to configure
+              latexmk to have the effect of the -cd option without  specifying
+              it  on  the  command line.  See the documentation for that vari-
+              able.
 
-       -cd-   Do  NOT  change to the directory containing the main source file
+
+       -cd-   Do NOT change to the directory containing the main  source  file
               before processing it.  Then all the generated files (.aux, .log,
-              .dvi,  .pdf,  etc)  will  be  relative  to the current directory
+              .dvi, .pdf, etc) will  be  relative  to  the  current  directory
               rather than the source file.
 
-              This is the default behavior and corresponds to the behavior  of
-              the  latex  and pdflatex programs.  However, it is not desirable
-              behavior when latexmk is invoked by a GUI configured  to  invoke
-              latexmk  with  a full pathname for the source file.  See the -cd
+              This  is the default behavior and corresponds to the behavior of
+              the latex and pdflatex programs.  However, it is  not  desirable
+              behavior  when  latexmk is invoked by a GUI configured to invoke
+              latexmk with a full pathname for the source file.  See  the  -cd
               option.
 
+              This  option  works by setting the $do_cd configuration variable
+              to zero.  See the  documentation  for  that  variable  for  more
+              information.
 
-       -CF    Remove the file containing the database of source file  informa-
+
+       -CF    Remove  the file containing the database of source file informa-
               tion, before doing the other actions requested.
 
 
-       -d     Set  draft  mode.  This prints the banner message "DRAFT" across
-              your page when converting the dvi file to postscript.  Size  and
+       -d     Set draft mode.  This prints the banner message  "DRAFT"  across
+              your  page when converting the dvi file to postscript.  Size and
               intensity can be modified with the -bs and -bi options.  The -bm
-              option will override this option as this is really just a  short
+              option  will override this option as this is really just a short
               way of specifying:
 
                    latexmk -bm DRAFT
 
-              Note  that  if  the  -d  option  is specified, the -ps option is
+              Note that if the -d option  is  specified,  the  -ps  option  is
               assumed.
 
 
        -deps  Show a list of dependent files after processing.  This is in the
-              form  of a dependency list of the form used by the make program,
+              form of a dependency list of the form used by the make  program,
               and it is therefore suitable for use in a Makefile.  It gives an
-              overall view of the files without listing intermediate files, as
-              well as latexmk can determine them.
 
-              By default the list of dependent files is sent to stdout  (i.e.,
-              normally  to  the screen unless you've redirected latexmk's out-
-              put). But you can set the filename where the list is sent by the
-              -deps-out= option.
 
-              See  the section "USING latexmk WITH make" for an example of how
-              to use a dependency list with make.
 
-              Users familiar with GNU automake and  gcc  will  find  that  the
-              -deps  option  is very similar in its purpose and results to the
-              -M option to gcc.  (In fact, latexmk also has options  -M,  -MF,
+                                25 October 2018                              7
 
 
 
-                                 7 August 2018                               7
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              overall view of the files without listing intermediate files, as
+              well as latexmk can determine them.
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+              By  default the list of dependent files is sent to stdout (i.e.,
+              normally to the screen unless you've redirected  latexmk's  out-
+              put). But you can set the filename where the list is sent by the
+              -deps-out= option.
 
+              See the section "USING latexmk WITH make" for an example of  how
+              to use a dependency list with make.
 
+              Users  familiar  with  GNU  automake  and gcc will find that the
+              -deps option is very similar in its purpose and results  to  the
+              -M  option  to gcc.  (In fact, latexmk also has options -M, -MF,
               and -MP options that behave like those of gcc.)
 
 
@@ -473,7 +487,7 @@
               Equivalent to -deps.
 
 
-       -deps- Do  not  show a list of dependent files after processing.  (This
+       -deps- Do not show a list of dependent files after  processing.   (This
               is the default.)
 
 
@@ -482,18 +496,18 @@
 
 
        -deps-out=FILENAME
-              Set the filename to which the list of dependent files  is  writ-
-              ten.   If  the  FILENAME argument is omitted or set to "-", then
+              Set  the  filename to which the list of dependent files is writ-
+              ten.  If the FILENAME argument is omitted or set  to  "-",  then
               the output is sent to stdout.
 
-              Use of this option also turns on  the  output  of  the  list  of
+              Use  of  this  option  also  turns  on the output of the list of
               dependent files after processing.
 
 
-       -dF    Dvi  file  filtering.   The  argument to this option is a filter
-              which will generate a  filtered  dvi  file  with  the  extension
-              ".dviF".   All  extra processing (e.g. conversion to postscript,
-              preview, printing) will then be performed on this  filtered  dvi
+       -dF    Dvi file filtering.  The argument to this  option  is  a  filter
+              which  will  generate  a  filtered  dvi  file with the extension
+              ".dviF".  All extra processing (e.g. conversion  to  postscript,
+              preview,  printing)  will then be performed on this filtered dvi
               file.
 
               Example usage: To use dviselect to select only the even pages of
@@ -503,64 +517,62 @@
 
 
        -diagnostics
-              Print detailed diagnostics during a  run.   This  may  help  for
+              Print  detailed  diagnostics  during  a  run.  This may help for
               debugging problems or to understand latexmk's behavior in diffi-
               cult situations.
 
 
-       -dvi   Generate dvi version of document.
 
+                                25 October 2018                              8
 
-       -dvi-  Turn off generation of dvi version of document.  (This  may  get
-              overridden,  if  some other file is made (e.g., a .ps file) that
-              is generated from the dvi file, or if no generated file  at  all
-              is requested.)
 
 
-       -e <code>
-              Execute  the  specified  initialization  code before processing.
-              The code is Perl code of the same form as is used  in  latexmk's
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
-                                 7 August 2018                               8
 
+       -dvi   Generate dvi version of document.
 
 
+       -dvi-  Turn  off  generation of dvi version of document.  (This may get
+              overridden, if some other file is made (e.g., a .ps  file)  that
+              is  generated  from the dvi file, or if no generated file at all
+              is requested.)
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
-              initialization  files.  For more details, see the information on
-              the -r option, and the section about  "Configuration/initializa-
-              tion  (RC)  files".  The code is typically a sequence of assign-
+       -e <code>
+              Execute the specified  initialization  code  before  processing.
+              The  code  is Perl code of the same form as is used in latexmk's
+              initialization files.  For more details, see the information  on
+              the  -r option, and the section about "Configuration/initializa-
+              tion (RC) files".  The code is typically a sequence  of  assign-
               ment statements separated by semicolons.
 
-              The code is executed when the -e option  is  encountered  during
-              latexmk's  parsing of its command line.  See the -r option for a
-              way of executing initialization code  from  a  file.   An  error
-              results  in  latexmk stopping.  Multiple instances of the -r and
-              -e options can be used, and they are executed in the order  they
+              The  code  is  executed when the -e option is encountered during
+              latexmk's parsing of its command line.  See the -r option for  a
+              way  of  executing  initialization  code  from a file.  An error
+              results in latexmk stopping.  Multiple instances of the  -r  and
+              -e  options can be used, and they are executed in the order they
               appear on the command line.
 
               Some care is needed to deal with proper quoting of special char-
-              acters in the code on the command line.   For  example,  suppose
-              you  want  to  set  the  latex  command to use its -shell-escape
+              acters  in  the  code on the command line.  For example, suppose
+              you want to set the  latex  command  to  use  its  -shell-escape
               option, then under UNIX/Linux you could use the line
 
                    latexmk -e '$latex=q/latex %O -shell-escape %S/' file.tex
 
-              Note that the single  quotes  block  normal  UNIX/Linux  command
-              shells  from  treating  the characters inside the quotes as spe-
-              cial.  (In this example, the q/.../ construct is  a  Perl  idiom
-              equivalent  to  using  single quotes.  This avoids the complica-
-              tions of getting a quote  character  inside  an  already  quoted
-              string  in  a  way that is independent of both the shell and the
+              Note  that  the  single  quotes  block normal UNIX/Linux command
+              shells from treating the characters inside the  quotes  as  spe-
+              cial.   (In  this  example, the q/.../ construct is a Perl idiom
+              equivalent to using single quotes.  This  avoids  the  complica-
+              tions  of  getting  a  quote  character inside an already quoted
+              string in a way that is independent of both the  shell  and  the
               operating-system.)
 
-              The above command line  will  NOT  work  under  MS-Windows  with
-              cmd.exe  or  command.com  or 4nt.exe.  For MS-Windows with these
+              The  above  command  line  will  NOT  work under MS-Windows with
+              cmd.exe or command.com or 4nt.exe.  For  MS-Windows  with  these
               command shells you could use
 
                    latexmk -e "$latex=q/latex %O -shell-escape %S/" file.tex
@@ -569,49 +581,49 @@
 
                    latexmk -e "$latex='latex %O -shell-escape %S'" file.tex
 
-              The last two examples will  NOT  work  with  UNIX/Linux  command
+              The  last  two  examples  will  NOT work with UNIX/Linux command
               shells.
 
-              (Note:  the above examples show are to show how to use the -e to
-              specify initialization code to be executed.  But the  particular
-              effect can be achieved also by the use of the -latex option with
-              less problems in dealing with quoting.)
+              (Note: the above examples show are to show how to use the -e  to
+              specify  initialization code to be executed.  But the particular
 
 
-       -f     Force latexmk to continue document  processing  despite  errors.
-              Normally, when latexmk detects that LaTeX or another program has
-              found an error which will not be resolved by further processing,
-              no further processing is carried out.
 
-              Note:  "Further  processing" means the running of other programs
-              or the rerunning of latex (etc) that would be done if no  errors
-              had  occurred.   If instead, or additionally, you want the latex
+                                25 October 2018                              9
 
 
 
-                                 7 August 2018                               9
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              effect can be achieved also by the use of the -latex option with
+              less problems in dealing with quoting.)
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
+       -f     Force  latexmk  to  continue document processing despite errors.
+              Normally, when latexmk detects that LaTeX or another program has
+              found an error which will not be resolved by further processing,
+              no further processing is carried out.
 
-              (etc) program not to pause for user input after  an  error,  you
-              should  arrange this by an option that is passed to the program,
+              Note: "Further processing" means the running of  other  programs
+              or  the rerunning of latex (etc) that would be done if no errors
+              had occurred.  If instead, or additionally, you want  the  latex
+              (etc)  program  not  to pause for user input after an error, you
+              should arrange this by an option that is passed to the  program,
               e.g., by latexmk's option -interaction=nonstopmode.
 
 
        -f-    Turn off the forced processing-past-errors such as is set by the
-              -f  option.   This could be used to override a setting in a con-
+              -f option.  This could be used to override a setting in  a  con-
               figuration file.
 
 
-       -g     Force latexmk to process document fully, even  under  situations
-              where  latexmk  would  normally  decide  that  no changes in the
-              source files have occurred since the previous run.  This  option
-              is  useful,  for example, if you change some options and wish to
+       -g     Force  latexmk  to process document fully, even under situations
+              where latexmk would normally  decide  that  no  changes  in  the
+              source  files have occurred since the previous run.  This option
+              is useful, for example, if you change some options and  wish  to
               reprocess the files.
 
 
@@ -627,46 +639,45 @@
 
 
        -jobname=STRING
-              Set  the  basename  of output files(s) to STRING, instead of the
+              Set the basename of output files(s) to STRING,  instead  of  the
               default, which is the basename of the specified TeX file.
 
-              This is like the same option for current implementations of  the
-              latex,  pdflatex,  etc,  and the passing of this option to these
+              This  is like the same option for current implementations of the
+              latex, pdflatex, etc, and the passing of this  option  to  these
               programs is part of latexmk's implementation of -jobname.
 
 
        -l     Run in landscape mode, using the landscape mode for the preview-
-              ers  and  the  dvi to postscript converters.  This option is not
-              normally needed  nowadays,  since  current  previewers  normally
+              ers and the dvi to postscript converters.  This  option  is  not
+              normally  needed  nowadays,  since  current  previewers normally
               determine this information automatically.
 
 
-       -l-    Turn off -l.
 
 
-       -latex="COMMAND"
-              This sets the string specifying the command to run latex, and is
-              typically used to add desired options.  Since  the  string  nor-
-              mally contains spaces, it should be quoted, e.g.,
+                                25 October 2018                             10
 
-                   latexmk -latex="latex --shell-escape %O %S"  foo.tex
 
-              The  specification of the contents of the string are the same as
 
 
 
-                                 7 August 2018                              10
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+       -l-    Turn off -l.
 
 
+       -latex="COMMAND"
+              This sets the string specifying the command to run latex, and is
+              typically  used  to  add desired options.  Since the string nor-
+              mally contains spaces, it should be quoted, e.g.,
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+                   latexmk -latex="latex --shell-escape %O %S"  foo.tex
 
-
-              for the $latex configuration variable.  Depending on your  oper-
-              ating  system  and the command-line shell you are using, you may
-              need to change the single quotes to double quotes (or  something
+              The specification of the contents of the string are the same  as
+              for  the $latex configuration variable.  Depending on your oper-
+              ating system and the command-line shell you are using,  you  may
+              need  to change the single quotes to double quotes (or something
               else).
 
               To set the command for running pdflatex (rather than the command
@@ -675,7 +686,7 @@
 
        -logfilewarninglist
               -logfilewarnings After a run of (pdf)latex, give a list of warn-
-              ings  about  undefined  citations  and references (unless silent
+              ings about undefined citations  and  references  (unless  silent
               mode is on).
 
               See also the $silence_logfile_warnings configuration variable.
@@ -682,7 +693,7 @@
 
 
        -logfilewarninglist-
-              -logfilewarnings- After a run of (pdf)latex, do not give a  list
+              -logfilewarnings-  After a run of (pdf)latex, do not give a list
               of warnings about undefined citations and references.  (Default)
 
               See also the $silence_logfile_warnings configuration variable.
@@ -689,8 +700,8 @@
 
 
        -lualatex
-              Use  lualatex.   That  is,  use  lualatex  to process the source
-              file(s) to pdf.  The generation of dvi and postscript  files  is
+              Use lualatex.  That is,  use  lualatex  to  process  the  source
+              file(s)  to  pdf.  The generation of dvi and postscript files is
               turned off.
 
               This option is equivalent to using the following set of options
@@ -697,52 +708,52 @@
 
                    -pdflua -dvi- -ps-
 
-              (Note:  Note  that  the method of implementation of this option,
-              but not its intended effect, differ from some  earlier  versions
+              (Note: Note that the method of implementation  of  this  option,
+              but  not  its intended effect, differ from some earlier versions
               of latexmk.)
 
 
-       -M     Show  list of dependent files after processing.  This is equiva-
+       -M     Show list of dependent files after processing.  This is  equiva-
               lent to the -deps option.
 
 
-       -MF file
-              If a list of dependents is made, the -MF specifies the  file  to
-              write it to.
 
 
-       -MP    If a list of dependents is made, include a phony target for each
-              source file.  If you use the dependents list in a Makefile,  the
-              dummy  rules  work  around  errors the program make gives if you
-              remove header files without updating the Makefile to match.
 
 
+                                25 October 2018                             11
 
 
 
 
-                                 7 August 2018                              11
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+       -MF file
+              If  a  list of dependents is made, the -MF specifies the file to
+              write it to.
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+       -MP    If a list of dependents is made, include a phony target for each
+              source  file.  If you use the dependents list in a Makefile, the
+              dummy rules work around errors the program  make  gives  if  you
+              remove header files without updating the Makefile to match.
 
 
        -new-viewer
-              When in continuous-preview mode, always start a  new  viewer  to
-              view  the generated file.  By default, latexmk will, in continu-
-              ous-preview mode, test for a previously  running  previewer  for
+              When  in  continuous-preview  mode, always start a new viewer to
+              view the generated file.  By default, latexmk will, in  continu-
+              ous-preview  mode,  test  for a previously running previewer for
               the same file and not start a new one if a previous previewer is
               running.  However, its test sometimes fails (notably if there is
-              an  already-running previewer that is viewing a file of the same
-              name as the current file, but in a different  directory).   This
+              an already-running previewer that is viewing a file of the  same
+              name  as  the current file, but in a different directory).  This
               option turns off the default behavior.
 
 
        -new-viewer-
-              The  inverse  of the -new-viewer option.  It puts latexmk in its
+              The inverse of the -new-viewer option.  It puts latexmk  in  its
               normal behavior that in preview-continuous mode it checks for an
               already-running previewer.
 
@@ -753,55 +764,55 @@
 
        -norc  Turn off the automatic reading of initialization (rc) files.
 
-              N.B.  Normally the initialization files are read and obeyed, and
-              then command line options are  obeyed  in  the  order  they  are
-              encountered.   But  -norc  is  an  exception to this rule: it is
+              N.B. Normally the initialization files are read and obeyed,  and
+              then  command  line  options  are  obeyed  in the order they are
+              encountered.  But -norc is an exception  to  this  rule:  it  is
               acted on first, no matter where it occurs on the command line.
 
 
        -outdir=FOO or -output-directory=FOO
 
-              Sets the directory for the output  files  of  (pdf)latex.   This
-              achieves   its   effect   by  the  -output-directory  option  of
+              Sets  the  directory  for  the output files of (pdf)latex.  This
+              achieves  its  effect  by  the   -output-directory   option   of
               (pdf)latex, which currently (Dec. 2011 and later) is implemented
-              on  the common versions of (pdf)latex, i.e., MiKTeX and TeXLive.
+              on the common versions of (pdf)latex, i.e., MiKTeX and  TeXLive.
               It may not be present in other versions.
 
-              See also the -auxdir/-aux-directory options, and  the  $aux_dir,
-              $out_dir,  and $search_path_separator configuration variables of
-              latexmk.  In particular, see the documentation of  $out_dir  for
+              See  also  the -auxdir/-aux-directory options, and the $aux_dir,
+              $out_dir, and $search_path_separator configuration variables  of
+              latexmk.   In  particular, see the documentation of $out_dir for
               some complications on what directory names are suitable.
 
-              If  you also use the -cd option, and the specified output direc-
-              tory is a relative path, then the path is  interpreted  relative
-              to the document directory.
+              If you also  use  the  -cd  option,  and  the  specified  output
 
 
-       -p     Print  out  the  document.  By default the file to be printed is
-              the first in the list postscript, pdf, dvi that is  being  made.
-              But you can use the -print=... option to change the type of file
-              to be printed, and you can configure this in a start up file (by
-              setting the $print_type variable).
 
-              However,  printing  is  enabled by default only under UNIX/Linux
+                                25 October 2018                             12
 
 
 
-                                 7 August 2018                              12
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              directory is a relative path, then the path is interpreted rela-
+              tive to the document directory.
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
+       -p     Print out the document.  By default the file to  be  printed  is
+              the  first  in the list postscript, pdf, dvi that is being made.
+              But you can use the -print=... option to change the type of file
+              to be printed, and you can configure this in a start up file (by
+              setting the $print_type variable).
 
+              However, printing is enabled by default  only  under  UNIX/Linux
               systems, where the default is to use the lpr command and only on
               postscript files.  In general, the correct behavior for printing
-              very much depends on your  system's  software.   In  particular,
-              under  MS-Windows  you  must have suitable program(s) available,
+              very  much  depends  on  your system's software.  In particular,
+              under MS-Windows you must have  suitable  program(s)  available,
               and you must have configured the print commands used by latexmk.
-              This  can  be  non-trivial.   See the documentation on the $lpr,
+              This can be non-trivial.  See the  documentation  on  the  $lpr,
               $lpr_dvi, and $lpr_pdf configuration variables to see how to set
               the commands for printing.
 
@@ -809,15 +820,15 @@
               turns them off.
 
 
-       -pdf   Generate pdf version of document using pdflatex.  (If  you  wish
+       -pdf   Generate  pdf  version of document using pdflatex.  (If you wish
               to use lualatex or xelatex, you can use whichever of the options
-              -pdflua, -pdfxe, -lualatex or -xelatex applies.)   To  configure
-              latexmk  to  have  such  behavior by default, see the section on
+              -pdflua,  -pdfxe,  -lualatex or -xelatex applies.)  To configure
+              latexmk to have such behavior by default,  see  the  section  on
               "Configuration/initialization (rc) files".
 
 
        -pdfdvi
-              Generate pdf version of document from the dvi file,  by  default
+              Generate  pdf  version of document from the dvi file, by default
               using dvipdf.
 
 
@@ -825,43 +836,44 @@
               Generate pdf version of document using lualatex.
 
 
-       -pdfps Generate  pdf  version of document from the .ps file, by default
+       -pdfps Generate pdf version of document from the .ps file,  by  default
               using ps2pdf.
 
 
-       -pdfxe Generate pdf version of document using xelatex.   Note  that  to
-              optimize  processing  time,  latexmk uses xelatex to generate an
-              .xdv file rather than a pdf file directly.  Only after  possibly
-              multiple  runs  to  generate  a  fully up-to-date .xdv file does
+       -pdfxe Generate  pdf  version  of document using xelatex.  Note that to
+              optimize processing time, latexmk uses xelatex  to  generate  an
+              .xdv  file rather than a pdf file directly.  Only after possibly
+              multiple runs to generate a  fully  up-to-date  .xdv  file  does
               latexmk then call xdvipdfmx to generate the final .pdf file.
 
-              (Note: When the document includes large  graphics  files,  espe-
-              cially  .png  files,  the last step can be quite time consuming,
-              even when the creation of the .xdv file by xelatex is fast.   So
-              the  use of the intermediate .xdv file can result in substantial
-              gains in procesing time, since the .pdf file  is  produced  once
-              rather than on every run of xelatex.)
+              (Note:  When  the  document includes large graphics files, espe-
+              cially .png files, the last step can be  quite  time  consuming,
+              even  when the creation of the .xdv file by xelatex is fast.  So
+              the use of the intermediate .xdv file can result in  substantial
 
 
-       -pdf-  Turn  off  generation  of pdf version of document.  (This can be
-              used to override a setting in a configuration file.  It may  get
-              overridden if some other option requires the generation of a pdf
-              file.)
 
-              If after all options have  been  processed,  pdf  generation  is
-              still  turned  off, then generation of a dvi file will be turned
+                                25 October 2018                             13
 
 
 
-                                 7 August 2018                              13
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              gains  in  procesing  time, since the .pdf file is produced once
+              rather than on every run of xelatex. See  the  documentation  on
+              the -pdfxe option for why an .xdv file is used.
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
+       -pdf-  Turn  off  generation  of pdf version of document.  (This can be
+              used to override a setting in a configuration file.  It may  get
+              overridden if some other option requires the generation of a pdf
+              file.)
 
+              If after all options have  been  processed,  pdf  generation  is
+              still  turned  off, then generation of a dvi file will be turned
               on, and then the program used to compiled  a  document  will  be
               latex  (or, more precisely, whatever program is configured to be
               used in the $latex configuration variable).
@@ -876,22 +888,83 @@
               foo.tex
 
               The  specification of the contents of the string are the same as
-              for the $pdflatex configuration  variable.   Depending  on  your
-              operating  system  and the command-line shell you are using, you
-              may need to change the single quotes to double quotes (or  some-
-              thing else).
+              for the $pdflatex configuration variable.  (The option -pdflatex
+              in fact sets the variable $pdflatex.)  Depending on your operat-
+              ing system and the command-line shell you  are  using,  you  may
+              need  to change the single quotes to double quotes (or something
+              else).
 
-              To  set  the  command for running latex (rather than the command
+              To set the command for running latex (rather  than  the  command
               for pdflatex) see the -latex option.
 
 
+       -pdflualatex="COMMAND"
+              This sets the string specifying the command to run lualatex.  It
+              behaves like the -pdflatex option, but sets the variable $luala-
+              tex.
+
+
+       -pdfxelatex="COMMAND"
+              This sets the string specifying the command to run lualatex.  It
+              behaves like the -pdflatex option, but sets the variable  $xela-
+              tex.
+
+              Warning: It is important to ensure that the -no-pdf is used when
+              xelatex is invoked; see the explanation for the variable  $xela-
+              tex for why this is necessary.  If you provide %O in the command
+              specification, this will be done automatically.
+
+              An example of the use of the -pdfxelatex option:
+
+
+
+
+                                25 October 2018                             14
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
+                   latexmk -pdfxe -pdfxelatex="xelatex --shell-escape  %O  %S"
+              foo.tex
+
+
+
+       -pretex=CODE
+
+              Given that CODE is some TeX code, this options sets that code to
+              be executed before inputting source file.  This  only  works  if
+              the command for invoking the relevant *latex is suitably config-
+              ured.  See the documentation of the variable  $pre_tex_cmd,  and
+              the  substitution  strings  %P  and  %U  for more details.  This
+              option works by setting the variable $pre_tex_cmd.
+
+              See also the -usepretex option.
+
+              An example:
+
+                  latexmk  -pretex='\AtBeginDocument{Message\par}'  -usepretex
+              foo.tex
+
+              But this is better written
+
+                  latexmk -usepretex='\AtBeginDocument{Message\par}' foo.tex
+
+              If you already have a suitable command configured, you only need
+
+                  latexmk -pretex='\AtBeginDocument{Message\par}' foo.tex
+
+
        -print=dvi, -print=ps, -print=pdf, -print=auto,
-              Define which kind of file is printed.  This option also  ensures
+              Define  which kind of file is printed.  This option also ensures
               that the requisite file is made, and turns on printing.
 
               The (default) case -print=auto determines the kind of print file
-              automatically from the set of files that  is  being  made.   The
-              first  in  the list postscript, pdf, dvi that is among the files
+              automatically  from  the  set  of files that is being made.  The
+              first in the list postscript, pdf, dvi that is among  the  files
               to be made is the one used for print out.
 
 
@@ -899,45 +972,46 @@
 
 
        -ps-   Turn off generation of postscript version of document.  This can
-              be  used to override a setting in a configuration file.  (It may
-              get overridden by some other option that requires  a  postscript
+              be used to override a setting in a configuration file.  (It  may
+              get  overridden  by some other option that requires a postscript
               file, for example a request for printing.)
 
 
-       -pF    Postscript  file  filtering.   The  argument to this option is a
-              filter which will generate a filtered postscript file  with  the
+       -pF    Postscript file filtering.  The argument to  this  option  is  a
+              filter  which  will generate a filtered postscript file with the
               extension ".psF".  All extra processing (e.g. preview, printing)
               will then be performed on this filtered postscript file.
 
-              Example of usage: Use psnup to print two pages on the one page:
 
-                   latexmk -ps -pF 'psnup -2' foo.tex
 
-              or
 
-                   latexmk -ps -pF "psnup -2" foo.tex
+                                25 October 2018                             15
 
 
 
-                                 7 August 2018                              14
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              Example of usage: Use psnup to print two pages on the one page:
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+                   latexmk -ps -pF 'psnup -2' foo.tex
 
+              or
 
+                   latexmk -ps -pF "psnup -2" foo.tex
+
               Whether to use single or double quotes round the "psnup -2" will
-              depend  on  your  command interpreter, as used by the particular
+              depend on your command interpreter, as used  by  the  particular
               version of perl and the operating system on your computer.
 
 
-       -pv    Run file previewer.  If the -view  option  is  used,  this  will
-              select  the  kind  of  file to be previewed (.dvi, .ps or .pdf).
-              Otherwise the viewer views the "highest" kind of file  selected,
-              by  the -dvi, -ps, -pdf, -pdfps options, in the order .dvi, .ps,
-              .pdf (low to high).  If no file type has been selected, the  dvi
+       -pv    Run  file  previewer.   If  the  -view option is used, this will
+              select the kind of file to be previewed  (.dvi,  .ps  or  .pdf).
+              Otherwise  the viewer views the "highest" kind of file selected,
+              by the -dvi, -ps, -pdf, -pdfps options, in the order .dvi,  .ps,
+              .pdf  (low to high).  If no file type has been selected, the dvi
               previewer will be used.  This option is incompatible with the -p
               and -pvc options, so it turns them off.
 
@@ -945,56 +1019,56 @@
        -pv-   Turn off -pv.
 
 
-       -pvc   Run a file previewer  and  continually  update  the  .dvi,  .ps,
+       -pvc   Run  a  file  previewer  and  continually  update the .dvi, .ps,
               and/or .pdf files whenever changes are made to source files (see
-              the Description above).  Which of these files is  generated  and
-              which  is  viewed  is  governed by the other options, and is the
-              same as for the -pv option.  The preview-continuous option  -pvc
-              can  only work with one file.  So in this case you will normally
-              only specify one filename on  the  command  line.   It  is  also
-              incompatible  with  the  -p  and  -pv options, so it turns these
+              the  Description  above).  Which of these files is generated and
+              which is viewed is governed by the other  options,  and  is  the
+              same  as for the -pv option.  The preview-continuous option -pvc
+              can only work with one file.  So in this case you will  normally
+              only  specify  one  filename  on  the  command line.  It is also
+              incompatible with the -p and -pv  options,  so  it  turns  these
               options off.
 
-              The -pvc option also turns off force mode (-f), as  is  normally
-              best  for  continuous  preview  mode.   If you really want force
+              The  -pvc  option also turns off force mode (-f), as is normally
+              best for continuous preview mode.   If  you  really  want  force
               mode, use the options in the order -pvc -f.
 
               With a good previewer the display will be automatically updated.
-              (Under  some but not all versions of UNIX/Linux "gv -watch" does
-              this for postscript files; this can be set  by  a  configuration
-              variable.   This  would  also  work  for pdf files except for an
-              apparent bug in gv that causes an error when the  newly  updated
-              pdf  file  is  read.)   Many other previewers will need a manual
+              (Under some but not all versions of UNIX/Linux "gv -watch"  does
+              this  for  postscript  files; this can be set by a configuration
+              variable.  This would also work for  pdf  files  except  for  an
+              apparent  bug  in gv that causes an error when the newly updated
+              pdf file is read.)  Many other previewers  will  need  a  manual
               update.
 
               Important note: the acroread program on MS-Windows locks the pdf
-              file,  and  prevents  new versions being written, so it is a bad
-              idea to use acroread to view  pdf  files  in  preview-continuous
-              mode.   It  is  better to use a different viewer: SumatraPDF and
+              file, and prevents new versions being written, so it  is  a  bad
+              idea  to  use  acroread  to view pdf files in preview-continuous
+              mode.  It is better to use a different  viewer:  SumatraPDF  and
               gsview are good possibilities.
 
-              There are some other methods for arranging  an  update,  notably
-              useful  for  many versions of xdvi and xpdf.  These are best set
-              in latexmk's configuration; see below.
+              There  are  some  other methods for arranging an update, notably
 
-              Note that if latexmk  dies  or  is  stopped  by  the  user,  the
-              "forked" previewer will continue to run.  Successive invocations
-              with the -pvc option will not fork new previewers,  but  latexmk
-              will  normally  use the existing previewer.  (At least this will
-              happen when latexmk is running under an operating  system  where
 
 
+                                25 October 2018                             16
 
-                                 7 August 2018                              15
 
 
 
 
-
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-              it  knows how to determine whether an existing previewer is run-
+              useful for many versions of xdvi and xpdf.  These are  best  set
+              in latexmk's configuration; see below.
+
+              Note  that  if  latexmk  dies  or  is  stopped  by the user, the
+              "forked" previewer will continue to run.  Successive invocations
+              with  the  -pvc option will not fork new previewers, but latexmk
+              will normally use the existing previewer.  (At least  this  will
+              happen  when  latexmk is running under an operating system where
+              it knows how to determine whether an existing previewer is  run-
               ning.)
 
 
@@ -1002,9 +1076,9 @@
 
 
        -pvctimeout
-              Do timeout in pvc mode after period of inactivity, which  is  30
-              min.  by  default.   Inactivity  means a period when latexmk has
-              detected no file changes and hence has  not  taken  any  actions
+              Do  timeout  in pvc mode after period of inactivity, which is 30
+              min. by default.  Inactivity means a  period  when  latexmk  has
+              detected  no  file  changes  and hence has not taken any actions
               like compiling the document.
 
 
@@ -1020,48 +1094,48 @@
 
 
        -r <rcfile>
-              Read  the  specified initialization file ("RC file") before pro-
+              Read the specified initialization file ("RC file")  before  pro-
               cessing.
 
               Be careful about the ordering: (1) Standard initialization files
-              --  see  the section below on "Configuration/initialization (RC)
-              files" -- are read first.  (2) Then the options on  the  command
-              line  are acted on in the order they are given.  Therefore if an
-              initialization file is specified by the -r option,  it  is  read
-              during  this second step.  Thus an initialization file specified
+              -- see the section below on  "Configuration/initialization  (RC)
+              files"  --  are read first.  (2) Then the options on the command
+              line are acted on in the order they are given.  Therefore if  an
+              initialization  file  is  specified by the -r option, it is read
+              during this second step.  Thus an initialization file  specified
               with the -r option can override both the standard initialization
               files and previously specified options.  But all of these can be
               overridden by later options.
 
               The contents of the RC file just comprise a piece of code in the
-              Perl  programming  language  (typically a sequence of assignment
+              Perl programming language (typically a  sequence  of  assignment
               statements); they are executed when the -r option is encountered
               during latexmk's parsing of its command line.  See the -e option
-              for a way of giving initialization code  directly  on  latexmk's
-              command  line.   An error results in latexmk stopping.  Multiple
-              instances of the -r and -e options can be  used,  and  they  are
-              executed in the order they appear on the command line.
+              for  a  way  of giving initialization code directly on latexmk's
+              command line.  An error results in latexmk  stopping.   Multiple
+              instances  of  the  -r  and -e options can be used, and they are
 
 
-       -recorder
-              Give  the  -recorder  option with latex and pdflatex.  In (most)
-              modern versions of these programs, this results  in  a  file  of
-              extension  .fls  containing  a list of the files that these pro-
-              grams have read and written.  Latexmk will then use this file to
 
+                                25 October 2018                             17
 
 
-                                 7 August 2018                              16
 
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+              executed in the order they appear on the command line.
 
 
-              improve  its detection of source files and generated files after
-              a run of latex or pdflatex.  This  is  the  default  setting  of
+       -recorder
+              Give the -recorder option with latex and  pdflatex.   In  (most)
+              modern  versions  of  these  programs, this results in a file of
+              extension .fls containing a list of the files  that  these  pro-
+              grams have read and written.  Latexmk will then use this file to
+              improve its detection of source files and generated files  after
+              a  run  of  latex  or  pdflatex.  This is the default setting of
               latexmk, unless overridden in an initialization file.
 
               For further information, see the documentation for the $recorder
@@ -1076,122 +1150,150 @@
 
 
        -rules-
-              Do not show a list of latexmk's  rules  and  dependencies  after
+              Do  not  show  a  list of latexmk's rules and dependencies after
               processing.  (This is the default.)
 
 
        -showextraoptions
-              Show  the  list of extra latex and pdflatex options that latexmk
-              recognizes, but that it simply passes through  to  the  programs
-              latex,  pdflatex,  etc   when  they  are run.  These options are
-              (currently) a combination of those allowed by  the  TeXLive  and
-              MiKTeX  implementations.   (If  a  particular option is given to
-              latexmk but is not handled by the particular  implementation  of
+              Show the list of extra latex and pdflatex options  that  latexmk
+              recognizes,  but  that  it simply passes through to the programs
+              latex, pdflatex, etc  when they  are  run.   These  options  are
+              (currently)  a  combination  of those allowed by the TeXLive and
+              MiKTeX implementations.  (If a particular  option  is  given  to
+              latexmk  but  is not handled by the particular implementation of
               latex or pdflatex that is being used, that program will probably
-              give an error message.)  These options are  very  numerous,  but
+              give  an  error  message.)  These options are very numerous, but
               are not listed in this documentation because they have no effect
               on latexmk's actions.
 
-              There are a  few  options  (-includedirectory=dir,  -initialize,
-              -ini)  that  are  not  recognized, either because they don't fit
+              There  are  a  few  options (-includedirectory=dir, -initialize,
+              -ini) that are not recognized, either  because  they  don't  fit
               with latexmk's intended operations, or because they need special
-              processing  by  latexmk  that  isn't  implemented (at least, not
+              processing by latexmk that  isn't  implemented  (at  least,  not
               yet).
 
-              There are also options that  are  accepted  by  latex  etc,  but
+              There  are  also  options  that  are  accepted by latex etc, but
               instead trigger actions by latexmk: -help, -version.
 
               Finally, there are certain options for latex and pdflatex (e.g.,
-              -recorder) that trigger special actions or behavior  by  latexmk
-              itself  as well as being passed in some form to the called latex
-              and pdflatex program, or that affect  other  programs  as  well.
-              These  options  do  have  entries  in this documentation.  These
-              options are: -jobname=STRING, -aux-directory=dir, -output-direc-
-              tory=DIR, -quiet, and -recorder.
+              -recorder)  that  trigger special actions or behavior by latexmk
+              itself as well as being passed in some form to the called  latex
+              and  pdflatex  program,  or  that affect other programs as well.
+              These options do have  entries  in  this  documentation.   These
 
 
-       -silent
-              Run commands silently, i.e., with options that reduce the amount
-              of diagnostics generated.  For example, with  the  default  set-
-              tings,  the  command  "latex -interaction=batchmode" is used for
 
+                                25 October 2018                             18
 
 
-                                 7 August 2018                              17
 
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+              options are: -jobname=STRING, -aux-directory=dir, -output-direc-
+              tory=DIR, -quiet, and -recorder.
 
 
-              (pdf)latex and friends.
+       -silent
+              Run commands silently, i.e., with options that reduce the amount
+              of  diagnostics  generated.   For example, with the default set-
+              tings, the command "latex -interaction=batchmode"  is  used  for
+              latex, and similarly for its friends.
 
-              See  also  the  -logfilewarninglist   and   -logfilewarninglist-
+              See   also   the  -logfilewarninglist  and  -logfilewarninglist-
               options.
 
-              Also  reduce  the  number of informational messages that latexmk
+              Also reduce the number of informational  messages  that  latexmk
               itself generates.
 
-              To change the options used to make the  commands  run  silently,
+              To  change  the  options used to make the commands run silently,
               you need to configure latexmk with changed values of its config-
-              uration   variables,   the    relevant    ones    being    $bib-
-              tex_silent_switch,  $biber_silent_switch, $dvipdf_silent_switch,
-              $dvips_silent_switch,       $latex_silent_switch,        $luala-
-              tex_silent_switch        $makeindex_silent_switch,       $pdfla-
+              uration    variables,    the    relevant    ones   being   $bib-
+              tex_silent_switch, $biber_silent_switch,  $dvipdf_silent_switch,
+              $dvips_silent_switch,        $latex_silent_switch,       $luala-
+              tex_silent_switch       $makeindex_silent_switch,        $pdfla-
               tex_silent_switch, and $xelatex_silent_switch
 
 
+       -stdtexcmds
+              Sets  the commands for latex, etc, so that they are the standard
+              ones. This is useful to override special configurations.
+
+              The result is that $latex = 'latex %O  %S',  and  similarly  for
+              $pdflatex,  $lualatex, and $xelatex.  (The option -no-pdf needed
+              for $xelatex is provided automatically, given that %O appears in
+              the definition.)
+
+
        -time  Show  CPU  time  used.   See  also  the  configuration  variable
               $show_time.
 
 
-       -time- Do  not show CPU time used.  See also the configuration variable
+       -time- Do not show CPU time used.  See also the configuration  variable
               $show_time.
 
 
        -use-make
-              When after a run of latex or pdflatex, there are warnings  about
+              When  after a run of latex or pdflatex, there are warnings about
               missing files (e.g., as requested by the LaTeX \input, \include,
-              and \includgraphics commands), latexmk tries to make them  by  a
-              custom  dependency.  If  no  relevant  custom dependency with an
+              and  \includgraphics  commands), latexmk tries to make them by a
+              custom dependency. If no  relevant  custom  dependency  with  an
               appropriate source file is found, and if the -use-make option is
               set, then as a last resort latexmk will try to use the make pro-
               gram to try to make the missing files.
 
-              Note that the filename may be specified  without  an  extension,
-              e.g.,  by  \includegraphics{drawing}  in  a LaTeX file.  In that
-              case, latexmk will try making drawing.ext with ext set  in  turn
-              to  the  possible  extensions that are relevant for latex (or as
-              appropriate pdflatex).
+              Note  that  the  filename may be specified without an extension,
+              e.g., by \includegraphics{drawing} in a  LaTeX  file.   In  that
 
-              See also the documentation for  the  $use_make_for_missing_files
-              configuration variable.
 
 
-       -use-make-
-              Do  not  use  the  make  program  to  try to make missing files.
-              (Default.)
+                                25 October 2018                             19
 
 
-       -v, -version
-              Print version number of latexmk.
 
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              case,  latexmk  will try making drawing.ext with ext set in turn
+              to the possible extensions that are relevant for  latex  (or  as
+              appropriate pdflatex).
 
-                                 7 August 2018                              18
+              See  also  the documentation for the $use_make_for_missing_files
+              configuration variable.
 
 
+       -use-make-
+              Do not use the make  program  to  try  to  make  missing  files.
+              (Default.)
 
 
+       -usepretex
+              Sets the command lines for latex, etc, so that they use the code
+              that is defined by the variable $pre_tex_code or that is set  by
+              the option -pretex=CODE to execute the specified TeX code before
+              the source file is read.  This  option  overrides  any  previous
+              definition of the command lines.
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+              The  result  is  that  $latex = 'latex %O %P', and similarly for
+              $pdflatex, $lualatex, and $xelatex.  (The option -no-pdf  needed
+              for $xelatex is provided automatically, given that %O appears in
+              the definition.)
 
 
+       -usepretex=CODE
+              Equivalent to -pretex=CODE -usepretex.  Example
+
+                latexmk -usepretex='\AtBeginDocument{Message\par}' foo.tex
+
+
+       -v, -version
+              Print version number of latexmk.
+
+
        -verbose
               Opposite of -silent.  This is the default setting.
 
@@ -1209,6 +1311,19 @@
               be opened.
 
 
+
+
+
+
+                                25 October 2018                             20
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
        -Werror
               This  causes  latexmk to return a non-zero status code if any of
               the files processed gives a warning about  problems  with  cita-
@@ -1246,18 +1361,6 @@
 
        The  preview-continuous option -pvc can only work with one file.  So in
        this case you will normally only specify one filename  on  the  command
-
-
-
-                                 7 August 2018                              19
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
        line.
 
        Options  -p,  -pv  and  -pvc  are mutually exclusive.  So each of these
@@ -1275,6 +1378,18 @@
                            file thesis.tex and any files it
                            uses.  After any changes rerun latex
                            the appropriate number of times and
+
+
+
+                                25 October 2018                             21
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
                            remake the postscript file.  If latex
                            encounters an error, latexmk will
                            keep running, watching for
@@ -1312,18 +1427,6 @@
        The  remainder  of  these notes consists of ideas for dealing with more
        difficult situations.
 
-
-
-
-                                 7 August 2018                              20
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
        d. Further tricks can involve  replacing  the  standard  commands  that
        latexmk runs by other commands or scripts.
 
@@ -1342,6 +1445,17 @@
        notice  the  change.)   One solution is just to put the following some-
        where in the LaTeX part of the document:
 
+
+
+                                25 October 2018                             22
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
                      \typeout{(bar.baz)}
 
        This puts a line in the log file that latexmk will  treat  as  implying
@@ -1349,7 +1463,7 @@
        doing this automatically.)  Of course, if  the  file  has  a  different
        name, change bar.baz to the name of your file.
 
-       g. See also the section ADVANCED CONFIGURATION: Some extra resources.
+       g. See also the section "Advanced Configuration: Some extra resources".
 
        h.    Look   on   tex.stackexchange,   i.e.,   at   http://tex.stackex-
        change.com/questions/tagged/latexmk  Someone may  have  already  solved
@@ -1378,18 +1492,6 @@
           "/cygdrive/c/latexmk/LatexMk",
           "/opt/local/share/latexmk/LatexMk",
           "/usr/local/share/latexmk/LatexMk",
-
-
-
-                                 7 August 2018                              21
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
           "/usr/local/lib/latexmk/LatexMk".
 
        In addition, it then tries the same set of locations, but with the file
@@ -1408,6 +1510,18 @@
 
        Here  $HOME  is  the  user's  home  directory.  [Latexmk determines the
        user's home directory as follows:  It is the value of  the  environment
+
+
+
+                                25 October 2018                             23
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
        variable  HOME,  if this variable exists, which normally is the case on
        UNIX-like systems (including Linux and OS-X).  Otherwise  the  environ-
        ment  variable USERPROFILE is used, if it exists, which normally is the
@@ -1445,20 +1559,9 @@
        ror.ctan.org/support/latexmk/example_rcfiles).
 
 
-
-
-                                 7 August 2018                              22
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
 HOW TO SET VARIABLES IN INITIALIZATION FILES
        The important variables that can be configured  are  described  in  the
-       section  "List  of  configuration  variables  usable  in initialization
+       section   "List  of  configuration  variables  usable in initialization
        files".  Syntax for setting these variables is of the following forms:
 
                            $bibtex = 'bibtex %O %B';
@@ -1474,6 +1577,17 @@
        for the setting of an array of strings.  It is possible  to  append  an
        item to an array variable as follows:
 
+
+
+                                25 October 2018                             24
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
                            push @default_files, 'paper2';
 
        Note  that  simple  "scalar"  variables  have names that begin with a $
@@ -1510,18 +1624,6 @@
        The two items starting with the % character  are  placeholders.   These
        are  substituted by appropriate values before the command is run.  Thus
        %S will be replaced by the source file that elatex will be applied  to,
-
-
-
-                                 7 August 2018                              23
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
        and  %O will be replaced by any options that latexmk has decided to use
        for this command.  (E.g., if you used the -silent option in the invoca-
        tion  of  latexmk,   it  results in the replacement of %O by "-interac-
@@ -1536,101 +1638,123 @@
        %D     destination file (e.g., the name of  the  postscript  file  when
               converting a dvi file to postscript).
 
-       %O     options
+       %O     options  %P  If the variable $pre_tex_code is non-empty, then %P
+              is substituted by the  contents  of  $pre_tex_code  followed  by
+              \input{SOURCE},  where  SOURCE stands for the name of the source
+              file.  Appropriate quoting is done.  This enables TeX code to be
 
+
+
+                                25 October 2018                             25
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
+              passed  to  one  of the *latex engines to be executed before the
+              source file is read.
+
+              If the variable $pre_tex_code is the empty string,  then  %P  is
+              equivalent to %S.
+
        %R     root filename.  This is the base name for the main tex file.
 
        %S     source  file  (e.g.,  the name of the dvi file when converting a
               .dvi file to ps).
 
-       %T     The name of the primary tex file.
+       %T     The  name  of  the  primary  tex  file.   %U  If  the   variable
+              $pre_tex_code is non-empty, then its value is substituted for %U
+              (appropriately quoted).  Otherwise it  is  replaced  by  a  null
+              string.
 
        %Y     Name of directory for auxiliary output files (see the configura-
               tion variable $aux_dir).  A directory separation character ('/')
               is appended if $aux_dir is non-empty and does not end in a suit-
               able character, with suitable characters being those appropriate
-              to UNIX and MS-Windows, i.e., ':', '/' and '\'.   Note  that  if
-              after  initialization,  $out_dir is set, but $aux_dir is not set
-              (i.e., it is blank), then latexmk  sets  $aux_dir  to  the  same
+              to  UNIX  and MS-Windows, i.e., ':', '/' and '\'.   Note that if
+              after initialization,  $out_dir is set, but $aux_dir is not  set
+              (i.e.,  it  is  blank),  then  latexmk sets $aux_dir to the same
               value $out_dir.
 
-       %Z     Name  of directory for output files (see the configuration vari-
-              able $out_dir).   A  directory  separation  character  ('/')  is
+       %Z     Name of directory for output files (see the configuration  vari-
+              able  $out_dir).   A  directory  separation  character  ('/') is
               appended if $out_dir is non-empty and does not end in a suitable
-              character, with suitable characters being those  appropriate  to
+              character,  with  suitable characters being those appropriate to
               UNIX and MS-Windows, i.e., ':', '/' and '\'.
 
-       If  for  some  reason you need a literal % character in your string not
+       If for some reason you need a literal % character in  your  string  not
        subject to the above rules, use "%%".
 
-       Appropriate quoting will be applied to the filename  substitutions,  so
-       you  mustn't  supply them yourself even if the names of your files have
+       Appropriate  quoting  will be applied to the filename substitutions, so
+       you mustn't supply them yourself even if the names of your  files  have
        spaces in them.  (But if your TeX filenames have spaces in them, beware
-       that  some  older  versions  of the TeX program cannot correctly handle
-       filenames containing spaces.)  In case latexmk's quoting does not  work
-       correctly  on your system, you can turn it off -- see the documentation
+       that some older versions of the TeX  program  cannot  correctly  handle
+       filenames  containing spaces.)  In case latexmk's quoting does not work
+       correctly on your system, you can turn it off -- see the  documentation
        for the variable $quote_filenames.
 
-       The distinction between %B and %R needs a bit of care, since  they  are
-       often  the same, but not always.  For example on a simple document, the
+       The  distinction  between %B and %R needs a bit of care, since they are
+       often the same, but not always.  For example on a simple document,  the
        basename of a bibtex run is the same as for the texfile.  But in a doc-
-       ument  with  several bibliographies, the bibliography files will have a
-       variety of names.  Since bibtex is invoked with  the  basename  of  the
+       ument with several bibliographies, the bibliography files will  have  a
+       variety  of  names.   Since  bibtex is invoked with the basename of the
+       bibliography file, the setting for the bibtex command should  therefore
+       be
 
+            $bibtex = 'bibtex %O %B';
 
+       Generally,  you  should use %B rather than %R.  Similarly for most pur-
+       poses, the name %T of the primary texfile is not a useful placeholder.
 
-                                 7 August 2018                              24
 
 
+                                25 October 2018                             26
 
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-       bibliography  file, the setting for the bibtex command should therefore
-       be
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
-            $bibtex = 'bibtex %O %B';
 
-       Generally, you should use %B rather than %R.  Similarly for  most  pur-
-       poses, the name %T of the primary texfile is not a useful placeholder.
-
-       See  the default values in the section "List of configuration variables
+       See the default values in the section "List of configuration  variables
        usable in initialization files" for what is normally the most appropri-
        ate usage.
 
        If you omit to supply any placeholders whatever in the specification of
-       a command, latexmk will supply what its author thinks  are  appropriate
+       a  command,  latexmk will supply what its author thinks are appropriate
        defaults.  This gives compatibility with configuration files for previ-
        ous versions of latexmk, which didn't use placeholders.
 
-       "Detaching" a command: Normally when latexmk runs a command,  it  waits
+       "Detaching"  a  command: Normally when latexmk runs a command, it waits
        for the command to run to completion.  This is appropriate for commands
        like latex, of course.  But for previewers, the command should normally
-       run  detached,  so  that  latexmk  gets  the previewer running and then
+       run detached, so that latexmk  gets  the  previewer  running  and  then
        returns to its next task (or exits if there is nothing else to do).  To
-       achieve  this  effect  of  detaching a command, you need to precede the
+       achieve this effect of detaching a command, you  need  to  precede  the
        command name with "start ", as in
 
             $dvi_previewer = 'start xdvi %O %S';
 
-       This will be translated to whatever is appropriate for  your  operating
+       This  will  be translated to whatever is appropriate for your operating
        system.
 
-       Notes:  (1)  In  some  circumstances, latexmk will always run a command
+       Notes: (1) In some circumstances, latexmk will  always  run  a  command
        detached.  This is the case for a previewer in preview continuous mode,
-       since  otherwise previewing continuously makes no sense.  (2) This pre-
-       cludes the possibility of running a command named start.   (3)  If  the
-       word  start  occurs  more  than  once  at  the beginning of the command
-       string, that is equivalent to having just one.  (4) Under cygwin,  some
-       complications  happen, since cygwin amounts to a complicated merging of
-       UNIX and MS-Windows.  See the source code  for  how  I've  handled  the
+       since otherwise previewing continuously makes no sense.  (2) This  pre-
+       cludes  the  possibility  of running a command named start.  (3) If the
+       word start occurs more than  once  at  the  beginning  of  the  command
+       string,  that is equivalent to having just one.  (4) Under cygwin, some
+       complications happen, since cygwin amounts to a complicated merging  of
+       UNIX  and  MS-Windows.   See  the  source code for how I've handled the
        problem.
 
        Command names containing spaces: Under MS-Windows it is common that the
        name of a command includes spaces, since software is often installed in
-       a  subdirectory  of  "C:\Program  Files".  Such command names should be
+       a subdirectory of "C:\Program Files".  Such  command  names  should  be
        enclosed in double quotes, as in
 
             $lpr_pdf  =  '"c:/Program  Files/Ghostgum/gsview/gsview32.exe"  /p
@@ -1637,38 +1761,38 @@
        %S';
             $pdf_previewer   =   'start   "c:/Program   Files/SumatraPDF/Suma-
        traPDF.exe" %O %S';
-            $pdf_previewer = 'start "c:/Program  Files/SumatraPDF  (x86)/Suma-
+            $pdf_previewer  =  'start "c:/Program Files/SumatraPDF (x86)/Suma-
        traPDF.exe" %O %S';
 
 
-       (Note  about  the  above  example: Under MS-Windows forward slashes are
+       (Note about the above example: Under  MS-Windows  forward  slashes  are
+       equivalent to backslashes in a filename under almost all circumstances,
+       provided that the filename is inside double quotes.  It  is  easier  to
+       use forward slashes in examples like the one above, since then one does
+       not have to worry about the rules for dealing with forward  slashes  in
+       strings in the Perl language.)
 
+       Command  names  under  Cygwin: If latexmk is executed by Cygwin's Perl,
+       be particularly certain that pathnames in commands have forward slashes
 
 
-                                 7 August 2018                              25
 
+                                25 October 2018                             27
 
 
 
 
+
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-       equivalent to backslashes in a filename under almost all circumstances,
-       provided  that  the  filename is inside double quotes.  It is easier to
-       use forward slashes in examples like the one above, since then one does
-       not  have  to worry about the rules for dealing with forward slashes in
-       strings in the Perl language.)
-
-       Command names under Cygwin: If latexmk is executed  by  Cygwin's  Perl,
-       be particularly certain that pathnames in commands have forward slashes
-       not the usual backslashes for the  separator  of  pathname  components.
-       See  the  above  examples.  Backslashes often get misinterpreted by the
+       not  the  usual  backslashes  for the separator of pathname components.
+       See the above examples.  Backslashes often get  misinterpreted  by  the
        Unix shell used by Cygwin's Perl to execute external commands.  Forward
        slashes don't suffer from this problem, and (when quoted, as above) are
        equally acceptable to MS-Windows.
 
-       Using MS-Windows file associations: A useful trick  under  modern  ver-
+       Using  MS-Windows  file  associations: A useful trick under modern ver-
        sions of MS-Windows (e.g., WinXP) is to use just the command 'start' by
        itself:
 
@@ -1675,9 +1799,9 @@
             $dvi_previewer = 'start %S';
 
        Under MS-Windows, this will cause to be run whatever program the system
-       has  associated  with  dvi  files.   (The same applies for a postscript
+       has associated with dvi files.  (The  same  applies  for  a  postscript
        viewer and a pdf viewer.)  But note that this trick is not always suit-
-       able  for the pdf previwer, if your system has acroread for the default
+       able for the pdf previwer, if your system has acroread for the  default
        pdf viewer.  As explained elsewhere, acroread under MS-Windows does not
        work well with latex and latexmk, because acroread locks the pdf file.
 
@@ -1686,18 +1810,18 @@
 
             $lpr  = 'NONE lpr';
 
-       This typically is used when an appropriate command does  not  exist  on
+       This  typically  is  used when an appropriate command does not exist on
        your system.  The string after the "NONE" is effectively a comment.
 
        Options to commands: Setting the name of a command can be used not only
        for changing the name of the command called, but also to add options to
-       command.   Suppose  you  want latexmk to use latex with source specials
-       enabled.  Then you might use the following line  in  an  initialization
+       command.  Suppose you want latexmk to use latex  with  source  specials
+       enabled.   Then  you  might use the following line in an initialization
        file:
 
             $latex = 'latex --src-specials %O %S';
 
-       Running  a  subroutine instead of an external command: Use a specifica-
+       Running a subroutine instead of an external command: Use  a  specifica-
        tion starting with "internal", as in
 
             $latex = 'internal mylatex %O %S';
@@ -1707,42 +1831,42 @@
                 return system 'latex', @args;
             }
 
-       For some of the more exotic possibilities that then  become  available,
+       For  some  of the more exotic possibilities that then become available,
+       see the section  "ADVANCED  CONFIGURATION:  Some  extra  resources  and
+       advanced  tricks". Also see some of the examples in the directory exam-
+       ple_rcfiles in the latexmk distribution.
 
+       Advanced tricks: Normally one specifies a single command for  the  com-
+       mands  invoked  by  latexmk.   Naturally,  if there is some complicated
+       additional processing you need to do in your special situation, you can
+       write a script (or batch file) to do the processing, and then configure
 
 
-                                 7 August 2018                              26
 
+                                25 October 2018                             28
 
 
 
 
+
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-       see  the  section  "ADVANCED  CONFIGURATION:  Some  extra resources and
-       advanced tricks". Also see some of the examples in the directory  exam-
-       ple_rcfiles in the latexmk distribution.
-
-       Advanced  tricks:  Normally one specifies a single command for the com-
-       mands invoked by latexmk.  Naturally,  if  there  is  some  complicated
-       additional processing you need to do in your special situation, you can
-       write a script (or batch file) to do the processing, and then configure
        latexmk to use your script in place of the standard program.
 
-       You  can  also  use a Perl subroutine instead of a script -- see above.
+       You can also use a Perl subroutine instead of a script  --  see  above.
        This is generally the most flexible and portable solution.
 
        It is also possible to configure latexmk to run multiple commands.  For
-       example,  if  when  running  pdflatex to generate a pdf file from a tex
-       file you need to run another program after  pdflatex  to  perform  some
+       example, if when running pdflatex to generate a pdf  file  from  a  tex
+       file  you  need  to  run another program after pdflatex to perform some
        extra processing, you could do something like:
 
-            $pdflatex  =  'pdflatex  --shell-escape %O %S; pst2pdf_for_latexmk
+            $pdflatex = 'pdflatex --shell-escape  %O  %S;  pst2pdf_for_latexmk
        %B';
 
-       This definition  assumes  you  are  using  a  UNIX-like  system  (which
-       includes  Linux and OS-X), so that the two commands to be run are sepa-
+       This  definition  assumes  you  are  using  a  UNIX-like  system (which
+       includes Linux and OS-X), so that the two commands to be run are  sepa-
        rated by the semicolon in the middle of the string.
 
        If you are using MS-Windows, you would replace the above line by
@@ -1750,34 +1874,42 @@
           $pdflatex = 'cmd /c pdflatex --shell-escape %O %S'
                       . '&& pst2pdf_for_latexmk %B';
 
-       Here, the UNIX command separator ; is replaced  by  &&.   In  addition,
+       Here,  the  UNIX  command  separator ; is replaced by &&.  In addition,
        there is a problem that some versions of Perl on MS-Windows do not obey
-       the command separator; this problem is overcome by explicitly  invoking
+       the  command separator; this problem is overcome by explicitly invoking
        the MS-Windows command-line processor cmd.exe.
 
 
 LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES
-       Default values are indicated in brackets.
+       Default values are indicated in brackets.  Note that for variables that
+       are  boolean  in character, concerning whether latexmk does or does not
+       behave in a certain way, a non-zero value, normally 1, indicates  true,
+       i.e.,  the behavior occurs, while a zero value indicates a false value,
+       i.e., the behavior does not occur.
 
+
        $always_view_file_via_temporary [0]
-              Whether  .ps and .pdf files are initially to be made in a tempo-
-              rary directory and then moved  to  the  final  location.   (This
+              Whether .ps and .pdf files are initially to be made in a  tempo-
+              rary  directory  and  then  moved  to the final location.  (This
               applies to dvips, dvipdf, and ps2pdf operations, and the filter-
-              ing operators on .dvi and .ps  files.   It  does  not  apply  to
+              ing  operators  on  .dvi  and  .ps  files.  It does not apply to
               pdflatex, unfortunately, since pdflatex provides no way of spec-
               ifying a chosen name for the output file.)
 
               This use of a temporary file solves a problem that the making of
               these files can occupy a substantial time.  If a viewer (notably
-              gv) sees that the file has changed, it may  read  the  new  file
-              before  the  program  writing  the file has not yet finished its
+              gv)  sees  that  the  file has changed, it may read the new file
+              before the program writing the file has  not  yet  finished  its
               work, which  can cause havoc.
 
               See the $pvc_view_file_via_temporary variable for a setting that
+              applies only if preview-continuous mode (-pvc option)  is  used.
+              See $tmpdir for the setting of the directory where the temporary
+              file is created.
 
 
 
-                                 7 August 2018                              27
+                                25 October 2018                             29
 
 
 
@@ -1786,79 +1918,74 @@
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-              applies  only  if preview-continuous mode (-pvc option) is used.
-              See $tmpdir for the setting of the directory where the temporary
-              file is created.
-
-
        $analyze_input_log_always [1]
 
-              After  a run of latex (etc), always analyze .log for input files
-              in the <...> and (...) constructions.  Otherwise,  only  do  the
+              After a run of latex (etc), always analyze .log for input  files
+              in  the  <...>  and (...) constructions.  Otherwise, only do the
               analysis when fls file doesn't exist or is out of date.
 
-              Under  normal  circumstances,  the data in the fls file is reli-
+              Under normal circumstances, the data in the fls  file  is  reli-
               able, and the test of the log file gets lots of false positives;
-              usually  $analyze_input_log_always is best set to zero.  But the
-              test of the log file is needed at least in the following  situa-
-              tion:  When a user needs to persuade latexmk that a certain file
-              is a source file, and latexmk doesn't otherwise find  it.   Then
-              the  user  can  write  code  that causes a line with (...) to be
-              written to log file.  One important case is for lualatex,  which
-              doesn't  always  generate  lines  in the .fls file for input lua
-              files.  (The situation with lualatex is  HIGHLY  version  depen-
-              dent,  e.g.,  there  was  a  big change between TeXLive 2016 and
+              usually $analyze_input_log_always is best set to zero.  But  the
+              test  of the log file is needed at least in the following situa-
+              tion: When a user needs to persuade latexmk that a certain  file
+              is  a  source file, and latexmk doesn't otherwise find it.  Then
+              the user can write code that causes a  line  with  (...)  to  be
+              written  to log file.  One important case is for lualatex, which
+              doesn't always generate lines in the .fls  file  for  input  lua
+              files.   (The  situation  with lualatex is HIGHLY version depen-
+              dent, e.g., there was a big  change  between  TeXLive  2016  and
               TeXLive 2017.)
 
-              To keep backward compatibility with older versions  of  latexmk,
+              To  keep  backward compatibility with older versions of latexmk,
               the default is to set $analyze_input_log_always to 1.
 
 
        $auto_rc_use [1]
-              Whether  to  automatically read the standard initialization (rc)
+              Whether to automatically read the standard  initialization  (rc)
               files, which are the system RC file, the user's RC file, and the
               RC file in the current directory.  The command line option -norc
-              can be used to turn this setting off.  Each RC file  could  also
-              turn  this  setting off, i.e., it could set $auto_rc_use to zero
+              can  be  used to turn this setting off.  Each RC file could also
+              turn this setting off, i.e., it could set $auto_rc_use  to  zero
               to prevent automatic reading of the later RC files.
 
-              This variable does not affect the reading of RC files  specified
+              This  variable does not affect the reading of RC files specified
               on the command line by the -r option.
 
        $aux_dir [""]
               The directory in which auxiliary files (aux, log, etc) are to be
-              written by a run of (pdf)latex.  If this variable  is  not  set,
-              but  $out_dir is set, then $aux_dir is set to $out_dir, which is
+              written  by  a  run of (pdf)latex.  If this variable is not set,
+              but $out_dir is set, then $aux_dir is set to $out_dir, which  is
               the directory to which general output files are to be written.
 
-              Important note:  The  effect  of  $aux_dir,  if  different  from
-              $out_dir,  is  achieved by giving (pdf)latex the -aux-directory.
-              Currently (Dec. 2011 and later) this only works  on  the  MiKTeX
+              Important  note:   The  effect  of  $aux_dir,  if different from
+              $out_dir, is achieved by giving (pdf)latex  the  -aux-directory.
+              Currently  (Dec.  2011  and later) this only works on the MiKTeX
               version of (pdf)latex.
 
               See also the documentation of $out_dir for some complications on
               what directory names are suitable.
 
-              If you also use the  -cd  option,  and  $out_dir  (or  $aux_dir)
+              If  you also use the -cd option, and $out_dir (or $aux_dir) con-
+              tains a relative path, then the path is interpreted relative  to
+              the document directory.
 
+       $banner [0]
+              If  nonzero, the banner message is printed across each page when
 
 
-                                 7 August 2018                              28
 
+                                25 October 2018                             30
 
 
 
 
+
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-              contains  a relative path, then the path is interpreted relative
-              to the document directory.
-
-       $banner [0]
-              If nonzero, the banner message is printed across each page  when
-              converting  the  dvi  file to postscript.  Without modifying the
-              variable $banner_message, this is equivalent to  specifying  the
+              converting the dvi file to postscript.   Without  modifying  the
+              variable  $banner_message,  this is equivalent to specifying the
               -d option.
 
               Note that if $banner is nonzero, the $postscript_mode is assumed
@@ -1867,7 +1994,7 @@
 
        $banner_intensity [0.95]
               Equivalent to the -bi option, this is a decimal number between 0
-              and 1 that specifies how dark to print the banner message. 0  is
+              and  1 that specifies how dark to print the banner message. 0 is
               black, 1 is white.  The default is just right if your toner car-
               tridge isn't running too low.
 
@@ -1876,19 +2003,19 @@
               dvi file to postscript.  This is equivalent to the -bm option.
 
        $banner_scale [220.0]
-              A  decimal  number  that  specifies how large the banner message
-              will be printed.  Experimentation is necessary to get the  right
-              scale  for  your message, as a rule of thumb the scale should be
-              about equal to 1100 divided by the number of characters  in  the
-              message.   The  Default  is just right for 5 character messages.
+              A decimal number that specifies how  large  the  banner  message
+              will  be printed.  Experimentation is necessary to get the right
+              scale for your message, as a rule of thumb the scale  should  be
+              about  equal  to 1100 divided by the number of characters in the
+              message.  The Default is just right for  5  character  messages.
               This is equivalent to the -bs option.
 
        @BIBINPUTS
-              This is an array variable, now mostly obsolete,  that  specifies
-              directories  where  latexmk  should  look  for  .bib  files.  By
+              This  is  an array variable, now mostly obsolete, that specifies
+              directories where  latexmk  should  look  for  .bib  files.   By
               default it is set from the BIBINPUTS environment variable of the
-              operating  system.   If  that environment variable is not set, a
-              single element list consisting of the current directory is  set.
+              operating system.  If that environment variable is  not  set,  a
+              single  element list consisting of the current directory is set.
               The format of the directory names depends on your operating sys-
               tem, of course.  Examples for setting this variable are:
 
@@ -1898,35 +2025,36 @@
                       @BIBINPUTS = ( ".", "//server/bibfiles" );
                       @BIBINPUTS = ( ".", "/usr/local/texmf/bibtex/bib" );
 
-              Note that under MS Windows, either a  forward  slash  "/"  or  a
-              backward  slash "\" can be used to separate pathname components,
-              so the first two and the second  two  examples  are  equivalent.
-              Each  backward slash should be doubled to avoid running afoul of
+              Note  that  under  MS  Windows,  either a forward slash "/" or a
+              backward slash "\" can be used to separate pathname  components,
+              so  the  first  two  and the second two examples are equivalent.
+              Each backward slash should be doubled to avoid running afoul  of
               Perl's rules for writing strings.
 
               Important note: This variable is now mostly obsolete in the cur-
-              rent  version  of  latexmk,  since  it  has  a  better method of
+              rent version of latexmk, since it has a better method of search-
+              ing  for  files  using  the kpsewhich command.  However, if your
+              system is an unusual one without the kpsewhich command, you  may
+              need to set the variable @BIBINPUTS.
 
 
 
-                                 7 August 2018                              29
 
 
+                                25 October 2018                             31
 
 
 
+
+
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-              searching for files using the kpsewhich  command.   However,  if
-              your system is an unusual one without the kpsewhich command, you
-              may need to set the variable @BIBINPUTS.
-
        $biber ["biber %O %S"]
               The biber processing program.
 
        $biber_silent_switch ["--onlylog"]
-              Switch(es) for the biber processing program when silent mode  is
+              Switch(es)  for the biber processing program when silent mode is
               on.
 
        $bibtex ["bibtex %O %S"]
@@ -1933,9 +2061,9 @@
               The BibTeX processing program.
 
        $bibtex_fudge [1]
-              When  using bibtex, whether to take special action to allow bib-
-              tex to work when $out_dir or  $aux_dir  is  specified.   In  May
-              2018,  there  was  planned an update to bibtex to correct a bug,
+              When using bibtex, whether to take special action to allow  bib-
+              tex  to  work  when  $out_dir  or $aux_dir is specified.  In May
+              2018, there was planned an update to bibtex to  correct  a  bug,
               after  that  update,  the  special  action  will  no  longer  be
               required.
 
@@ -1945,30 +2073,34 @@
 
        $bibtex_use [1]
               Under what conditions to run bibtex or biber.  When latexmk dis-
-              covers  from the log file that one (or more) bibtex/biber-gener-
-              ated bibliographies are used, it can run bibtex or  biber  when-
-              ever  it  appears  necessary  to regenerate the bbl file(s) from
-              their source bib  database  file(s).   But  sometimes,  the  bib
+              covers from the log file that one (or more)  bibtex/biber-gener-
+              ated  bibliographies  are used, it can run bibtex or biber when-
+              ever it appears necessary to regenerate  the  bbl  file(s)  from
+              their  source  bib  database  file(s).   But  sometimes, the bib
               file(s) are not available (e.g., for a document obtained from an
               external archive), but the bbl files are provided.  In that case
-              use  of  bibtex or biber will result in incorrect overwriting of
-              the precious  bbl  files.   The  variable  $bibtex_use  controls
-              whether  this  happens,  and  also  controls whether or not .bbl
+              use of bibtex or biber will result in incorrect  overwriting  of
+              the  precious  bbl  files.   The  variable  $bibtex_use controls
+              whether this happens, and also  controls  whether  or  not  .bbl
               files are deleted in a cleanup operation.
 
               The possible values of $bibtex_use are:
-                0: never use BibTeX or biber; never delete  .bbl  files  in  a
+                0:  never  use  BibTeX  or biber; never delete .bbl files in a
               cleanup.
-                1:  only  use  bibtex  or  biber if the bib files exist; never
+                1: only use bibtex or biber if  the  bib  files  exist;  never
               delete .bbl files in a cleanup.
-                1.5: only use bibtex or biber if the bib files  exist;  condi-
-              tionally  delete .bbl files in a cleanup (i.e., delete them only
+                1.5:  only  use bibtex or biber if the bib files exist; condi-
+              tionally delete .bbl files in a cleanup (i.e., delete them  only
               when the bib files all exist).
                 2: run bibtex or biber whenever it appears necessary to update
-              the  bbl  files,  without  testing  for the existence of the bib
+              the bbl files, without testing for  the  existence  of  the  bib
               files; always delete .bbl files in a cleanup.
 
+              Note  that  the value 1.5 does not work properly if the document
+              uses biber instead of bibtex.  (There's a long story why not.)
 
+
+
        $cleanup_includes_cusdep_generated [0]
               If nonzero, specifies that cleanup also deletes files  that  are
               generated by custom dependencies.  (When doing a clean up, e.g.,
@@ -1975,7 +2107,7 @@
 
 
 
-                                 7 August 2018                              30
+                                25 October 2018                             32
 
 
 
@@ -2014,14 +2146,23 @@
               be deleted, by using the place holder %R, as in commands, and it
               is also possible to use wildcards.  Thus setting
 
-                 $clean_ext = "out %R-blx.bib %R-figures*.log";
+                $clean_ext   =   "out  %R-blx.bib  %R-figures*.log  pythontex-
+              files-%R/*";
 
               in an initialization file will imply that when a clean-up opera-
-              tion is specified,  not  only  is  the  standard  set  of  files
-              deleted,  but  also  files of the form FOO.out, FOO-blx.bib, and
-              %R-figures*.log, where FOO stands for the basename of  the  file
-              being processed (as in FOO.tex).
+              tion  is  specified,  not  only  is  the  standard  set of files
+              deleted, but also files of the form  FOO.out,  FOO-blx.bib,  %R-
+              figures*.log,  and  pythontex-files-FOO/*,  where FOO stands for
+              the basename of the file being processed (as in FOO.tex).
 
+              The files to be deleted are relative to the directory  specified
+              by  $aux_dir.   (Note  that if $out_dir but not $aux_dir is set,
+              then in its  initialization,  latexmk  sets  $aux_dir  equal  to
+              $out_dir.   A normal situation is therefore that $aux_dir equals
+              $out_dir, which is the only case supported  by  TeXLive,  unlike
+              MiKTeX.)
+
+
        $clean_full_ext [""]
               Extra  extensions  of  files  for  latexmk to remove when the -C
               option is selected, i.e., extensions of files to remove when the
@@ -2030,106 +2171,109 @@
               More general patterns are allowed, as for $clean_ext.
 
 
-       $compiling_cmd [""], $failure_cmd [""], $warning_cmd [""], $success_cmd
-       [""]
 
-              These variables specify commands that are  executed  at  certain
-              points  of  compilations  during  preview-continuous  mode.  One
-              motivation for their existance is to allow  very  useful  conve-
-              nient  visual  indications  of  compilation status even when the
-              window receiving the screen output of the compilation is hidden.
 
+                                25 October 2018                             33
 
 
-                                 7 August 2018                              31
 
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+              The  files  specified by $clean_full_ext to be deleted are rela-
+              tive to the directory specified by $out_dir.
 
 
-              The commands are executed  at  the  following  points:  $compil-
-              ing_cmd  at the start of compilation, $success_cmd at the end of
-              a completely successful compilation, $failure_cmd at the end  of
+       $compiling_cmd [""], $failure_cmd [""], $warning_cmd [""], $success_cmd
+       [""]
+
+              These  variables  specify  commands that are executed at certain
+              points of  compilations  during  preview-continuous  mode.   One
+              motivation  for  their  existance is to allow very useful conve-
+              nient visual indications of compilation  status  even  when  the
+              window receiving the screen output of the compilation is hidden.
+
+              The  commands  are  executed  at  the following points: $compil-
+              ing_cmd at the start of compilation, $success_cmd at the end  of
+              a  completely successful compilation, $failure_cmd at the end of
               an unsuccessful compilation, $warning_cmd at the of an otherwise
               successful compilation that gives warnings about undefined cita-
               tions or references or about multiply defined references. If any
-              of above variables is undefined or  blank  (the  default  situa-
+              of  above  variables  is  undefined or blank (the default situa-
               tion), then the corresponding command is not executed.
 
-              However,  when  $warning_cmd  is  not set, then in the case of a
-              compilation with warnings about  references  or  citations,  but
-              with  no  other  error,  one  or other of $success_cmd or $fail-
-              ure_cmd is used (if it is  set)  according  to  the  setting  of
+              However, when $warning_cmd is not set, then in  the  case  of  a
+              compilation  with  warnings  about  references or citations, but
+              with no other error, one or  other  of  $success_cmd  or  $fail-
+              ure_cmd  is  used  (if  it  is  set) according to the setting of
               $warnings_as_errors.
 
               An example of a simple setting of these variables is as follows
 
-                  $compiling_cmd  =  "xdotool  search --name \"%D\" set_window
+                  $compiling_cmd = "xdotool search  --name  \"%D\"  set_window
               --name \"%D compiling\"";
-                  $success_cmd   = "xdotool search  --name  \"%D\"  set_window
+                  $success_cmd    =  "xdotool  search --name \"%D\" set_window
               --name \"%D OK\"";
                   $warning_cmd   = "xdotool search --name \"%D\" ".
                                    "set_window --name \"%D CITE/REF ISSUE\"";
-                  $failure_cmd    =  "xdotool  search --name \"%D\" set_window
+                  $failure_cmd   = "xdotool search  --name  \"%D\"  set_window
               --name \"%D FAILURE\"";
 
-              These assume that the program xdotool  is  installed,  that  the
-              previewer  is using an X-Window system for display, and that the
-              title of the window contains the name of the displayed file,  as
-              it  normally  does.   When the commands are executed, the place-
-              holder string %D is replaced by  the  name  of  the  destination
+              These  assume  that  the  program xdotool is installed, that the
+              previewer is using an X-Window system for display, and that  the
+              title  of the window contains the name of the displayed file, as
+              it normally does.  When the commands are  executed,  the  place-
+              holder  string  %D  is  replaced  by the name of the destination
               file, which is the previewed file.  The above commands result in
               an appropriate string being appended to the filename in the win-
               dow title: " compiling", " OK", or " FAILURE".
 
-              Other  placeholders that can be used are %S, %T, and %R, with %S
-              and %T normally being identical. These can be useful for a  com-
-              mand  changing  the title of the edit window. The visual indica-
-              tion in a window title can useful, since the user does not  have
-              to  keep shifting attention to the (possibly hidden) compilation
+              Other placeholders that can be used are %S, %T, and %R, with  %S
+              and  %T normally being identical. These can be useful for a com-
+              mand changing the title of the edit window. The  visual  indica-
+              tion  in a window title can useful, since the user does not have
+              to keep shifting attention to the (possibly hidden)  compilation
               window to know the status of the compilation.
 
-              More complicated situations can best be handled  by  defining  a
-              Perl  subroutine to invoke the necessary commands, and using the
-              "internal" keyword in the definitions to get the  subroutine  to
-              be  invoked.   (See the section Format of Command Specifications
-              for how to do this.)
 
-              Naturally, the above settings that invoke  the  xdotool  program
-              are  only  applicable  when  the X-Window system is used for the
-              relevant window(s).  For other cases, you will have to find what
-              software solutions are available.
 
+                                25 October 2018                             34
 
 
 
 
-                                 7 August 2018                              32
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              More  complicated  situations  can best be handled by defining a
+              Perl subroutine to invoke the necessary commands, and using  the
+              "internal"  keyword  in the definitions to get the subroutine to
+              be invoked.  (See the section "Format of Command Specifications"
+              for how to do this.)
 
+              Naturally,  the  above  settings that invoke the xdotool program
+              are only applicable when the X-Window system  is  used  for  the
+              relevant window(s).  For other cases, you will have to find what
+              software solutions are available.
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
-
        @cus_dep_list [()]
               Custom dependency list -- see section on "Custom Dependencies".
 
        @default_excluded_files [()]
-              When  latexmk  is invoked with no files specified on the command
+              When latexmk is invoked with no files specified on  the  command
               line, then, by default, it will process all files in the current
               directory with the extension .tex.  (In general, it will process
               the files specified in the @default_files variable.)
 
-              But sometimes you want to exclude  particular  files  from  this
-              default  list.   In that case you can specify the excluded files
+              But  sometimes  you  want  to exclude particular files from this
+              default list.  In that case you can specify the  excluded  files
               in the array @default_excluded_files.  For example if you wanted
-              to  process  all  .tex  files  with the exception of common.tex,
-              which is a not a standard alone LaTeX file but a file  input  by
+              to process all .tex files  with  the  exception  of  common.tex,
+              which  is  a not a standard alone LaTeX file but a file input by
               some or all of the others, you could do
 
                    @default_files = ("*.tex");
@@ -2137,11 +2281,11 @@
                    @default_excluded_files = ("common.tex");
 
               If you have a variable or large number of files to be processed,
-              this method saves you from having to  list  them  in  detail  in
-              @default_files  and  having  to  update  the list every time you
+              this  method  saves  you  from  having to list them in detail in
+              @default_files and having to update  the  list  every  time  you
               change the set of files to be processed.
 
-              Notes: 1. This variable has no effect except when no  files  are
+              Notes:  1.  This variable has no effect except when no files are
               specified on the latexmk command line.  2. Wildcards are allowed
               in @default_excluded_files.
 
@@ -2148,199 +2292,199 @@
        @default_files [("*.tex")]
               Default list of files to be processed.
 
-              If no filenames are specified on the command line, latexmk  pro-
-              cesses  all  tex files specified in the @default_files variable,
-              which by default is set to all tex files ("*.tex") in  the  cur-
-              rent  directory.  This is a convenience: just run latexmk and it
-              will process an appropriate set of  files.   But  sometimes  you
+              If  no filenames are specified on the command line, latexmk pro-
+              cesses all tex files specified in the  @default_files  variable,
+              which  by  default is set to all tex files ("*.tex") in the cur-
+              rent directory.  This is a convenience: just run latexmk and  it
+              will  process  an  appropriate  set of files.  But sometimes you
               want only some of these files to be processed.  In this case you
-              can list the files to be processed by setting @default_files  in
-              an  initialization  file (e.g., the file "latexmkrc" in the cur-
-              rent directory).  Then if no files are specified on the  command
-              line  then  the  files you specify by setting @default_files are
-              processed.
+              can  list the files to be processed by setting @default_files in
+              an initialization file (e.g., the file "latexmkrc" in  the  cur-
+              rent  directory).  Then if no files are specified on the command
+              line then the files you specify by  setting  @default_files  are
 
-              Three examples:
 
-                   @default_files = ("paper_current");
 
-                   @default_files = ("paper1", "paper2.tex");
+                                25 October 2018                             35
 
-                   @default_files = ("*.tex", "*.dtx");
 
-              Note that more than file may be  given,  and  that  the  default
-              extension  is  ".tex".  Wild cards are allowed.  The parentheses
 
 
 
-                                 7 August 2018                              33
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              processed.
 
+              Three examples:
 
+                   @default_files = ("paper_current");
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+                   @default_files = ("paper1", "paper2.tex");
 
+                   @default_files = ("*.tex", "*.dtx");
 
+              Note  that  more  than  file  may be given, and that the default
+              extension is ".tex".  Wild cards are allowed.   The  parentheses
               are  because  @default_files  is  an  array  variable,  i.e.,  a
               sequence of filename specifications is possible.
 
-              If  you want latexmk to process all .tex files with a few excep-
+              If you want latexmk to process all .tex files with a few  excep-
               tions, see the @default_excluded_files array variable.
 
        $dependents_phony [0]
-              If a list of dependencies is output,  this  variable  determines
-              whether  to include a phony target for each source file.  If you
-              use the dependents list in a  Makefile,  the  dummy  rules  work
-              around  errors  make  gives  if  you remove header files without
+              If  a  list  of dependencies is output, this variable determines
+              whether to include a phony target for each source file.  If  you
+              use  the  dependents  list  in  a Makefile, the dummy rules work
+              around errors make gives if  you  remove  header  files  without
               updating the Makefile to match.
 
        $dependents_list [0]
-              Whether to display a list(s) of dependencies at  the  end  of  a
+              Whether  to  display  a  list(s) of dependencies at the end of a
               run.
 
        $deps_file ["-"]
-              Name  of file to receive list(s) of dependencies at the end of a
-              run, to be used if $dependesnt_list is set.  If the filename  is
-              "-",  then  the dependency list is set to stdout (i.e., normally
+              Name of file to receive list(s) of dependencies at the end of  a
+              run,  to be used if $dependesnt_list is set.  If the filename is
+              "-", then the dependency list is set to stdout  (i.e.,  normally
               the screen).
 
        $do_cd [0]
-              Whether to change working directory to the  directory  specified
-              for  the  main  source  file  before processing it.  The default
+              Whether  to  change working directory to the directory specified
+              for the main source file  before  processing  it.   The  default
               behavior is not to do this, which is the same as the behavior of
-              latex  and  pdflatex  programs.  This variable is set by the -cd
+              latex and pdflatex programs.  This variable is set  by  the  -cd
               and -cd- options on latexmk's command line.
 
        $dvi_filter [empty]
-              The dvi file filter to be run on the  newly  produced  dvi  file
-              before  other  processing.   Equivalent  to  specifying  the -dF
+              The  dvi  file  filter  to be run on the newly produced dvi file
+              before other  processing.   Equivalent  to  specifying  the  -dF
               option.
 
        $dvi_mode [See below for default]
-              If nonzero, generate a dvi version of the document.   Equivalent
+              If  nonzero, generate a dvi version of the document.  Equivalent
               to the -dvi option.
 
-              The  variable  $dvi_mode  defaults  to  0,  but  if  no explicit
-              requests are made for other types  of  file  (postscript,  pdf),
-              then  $dvi_mode will be set to 1.  In addition, if a request for
-              a file for which a .dvi file is a prerequisite,  then  $dvi_mode
-              will be set to 1.
+              The variable  $dvi_mode  defaults  to  0,  but  if  no  explicit
+              requests  are  made  for  other types of file (postscript, pdf),
+              then $dvi_mode will be set to 1.  In addition, if a request  for
 
-       $dvi_previewer ["start xdvi %O %S" under UNIX]
-              The  command  to  invoke a dvi-previewer.  [Under MS-Windows the
-              default is "start"; then latexmk arranges to use the  MS-Windows
-              start  program,  which will cause to be run whatever command the
-              system has associated with .dvi files.]
 
-              Important note: Normally you will want to have a  previewer  run
-              detached, so that latexmk doesn't wait for the previewer to ter-
-              minate before continuing  its  work.   So  normally  you  should
 
+                                25 October 2018                             36
 
 
-                                 7 August 2018                              34
 
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+              a  file  for which a .dvi file is a prerequisite, then $dvi_mode
+              will be set to 1.
 
+       $dvi_previewer ["start xdvi %O %S" under UNIX]
+              The command to invoke a dvi-previewer.   [Under  MS-Windows  the
+              default  is "start"; then latexmk arranges to use the MS-Windows
+              start program, which will cause to be run whatever  command  the
+              system has associated with .dvi files.]
 
-              prefix  the  command by "start ", which flags to latexmk that it
-              should do the detaching of the  previewer  itself  (by  whatever
-              method  is  appropriate to the operating system).  But sometimes
+              Important  note:  Normally you will want to have a previewer run
+              detached, so that latexmk doesn't wait for the previewer to ter-
+              minate  before continuing its work.  So normally you should pre-
+              fix the command by "start ", which  flags  to  latexmk  that  it
+              should  do  the  detaching  of the previewer itself (by whatever
+              method is appropriate to the operating system).   But  sometimes
               letting latexmk do the detaching is not appropriate (for a vari-
-              ety  of non-trivial reasons), so you should put the "start " bit
+              ety of non-trivial reasons), so you should put the "start "  bit
               in yourself, whenever it is needed.
 
        $dvi_previewer_landscape ["start xdvi %O %S"]
               The command to invoke a dvi-previewer in landscape mode.  [Under
-              MS-Windows  the default is "start"; then latexmk arranges to use
-              the MS-Windows start program, which will cause to be  run  what-
+              MS-Windows the default is "start"; then latexmk arranges to  use
+              the  MS-Windows  start program, which will cause to be run what-
               ever command the system has associated with .dvi files.]
 
        $dvipdf ["dvipdf %O %S %D"]
-              Command  to convert .dvi to .pdf file.  A common reconfiguration
-              is to use the dvipdfm command, which needs its  arguments  in  a
+              Command to convert .dvi to .pdf file.  A common  reconfiguration
+              is  to  use  the dvipdfm command, which needs its arguments in a
               different order:
 
                    $dvipdf = "dvipdfm %O -o %D %S";
 
-              WARNING:  The  default  dvipdf  script  generates pdf files with
+              WARNING: The default dvipdf  script  generates  pdf  files  with
               bitmapped fonts, which do not look good when viewed by acroread.
-              That  script  should  be  modified to give dvips the options "-P
+              That script should be modified to give  dvips  the  options  "-P
               pdf" to ensure that type 1 fonts are used in the pdf file.
 
        $dvipdf_silent_switch ["-q"]
               Switch(es) for dvipdf program when silent mode is on.
 
-              N.B. The standard dvipdf program runs silently,  so  adding  the
-              silent  switch has no effect, but is actually innocuous.  But if
-              an alternative program is used, e.g., dvipdfmx, then the  silent
-              switch  has  an  effect.   The  default  setting  is correct for
+              N.B.  The  standard  dvipdf program runs silently, so adding the
+              silent switch has no effect, but is actually innocuous.  But  if
+              an  alternative program is used, e.g., dvipdfmx, then the silent
+              switch has an  effect.   The  default  setting  is  correct  for
               dvipdfm and dvipdfmx.
 
        $dvips ["dvips %O -o %D %S"]
-              The program to used as a filter to convert a .dvi file to a  .ps
-              file.   If pdf is going to be generated from pdf, then the value
-              of the $dvips_pdf_switch  variable  --  see  below  --  will  be
+              The  program to used as a filter to convert a .dvi file to a .ps
+              file.  If pdf is going to be generated from pdf, then the  value
+              of  the  $dvips_pdf_switch  variable  --  see  below  -- will be
               included in the options substituted for "%O".
 
        $dvips_landscape ["dvips -tlandscape %O -o %D %S"]
-              The  program to used as a filter to convert a .dvi file to a .ps
-              file in landscape mode.
+              The program to used as a filter to convert a .dvi file to a  .ps
 
-       $dvips_pdf_switch ["-P pdf"]
-              Switch(es) for dvips program when pdf file is  to  be  generated
-              from .ps file.
 
-       $dvips_silent_switch ["-q"]
-              Switch(es) for dvips program when silent mode is on.
 
-       $dvi_update_command [""]
-              When  the  dvi  previewer is set to be updated by running a com-
-              mand, this is the command that is run.  See the information  for
+                                25 October 2018                             37
 
 
 
-                                 7 August 2018                              35
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              file in landscape mode.
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+       $dvips_pdf_switch ["-P pdf"]
+              Switch(es)  for  dvips  program when pdf file is to be generated
+              from .ps file.
 
+       $dvips_silent_switch ["-q"]
+              Switch(es) for dvips program when silent mode is on.
 
+       $dvi_update_command [""]
+              When the dvi previewer is set to be updated by  running  a  com-
+              mand,  this is the command that is run.  See the information for
               the variable $dvi_update_method for further information, and see
-              information on the variable $pdf_update_method  for  an  example
+              information  on  the  variable $pdf_update_method for an example
               for the analogous case of a pdf previewer.
 
        $dvi_update_method [2 under UNIX, 1 under MS-Windows]
-              How  the  dvi  viewer  updates its display when the dvi file has
-              changed.    The   values   here    apply    equally    to    the
+              How the dvi viewer updates its display when  the  dvi  file  has
+              changed.     The    values    here    apply   equally   to   the
               $pdf_update_method and to the $ps_update_method variables.
                   0 => update is automatic,
                   1=> manual update by user, which may only mean a mouse click
               on the viewer's window or may mean a more serious action.
-                  2 => Send the  signal,  whose  number  is  in  the  variable
-              $dvi_update_signal.   The  default  value under UNIX is suitable
+                  2  =>  Send  the  signal,  whose  number  is in the variable
+              $dvi_update_signal.  The default value under  UNIX  is  suitable
               for xdvi.
-                  3 => Viewer cannot do an update, because it locks the  file.
+                  3  => Viewer cannot do an update, because it locks the file.
               (As with acroread under MS-Windows.)
-                  4  => run a command to do the update.  The command is speci-
+                  4 => run a command to do the update.  The command is  speci-
               fied by the variable $dvi_update_command.
 
-              See information on the variable $pdf_update_method for an  exam-
+              See  information on the variable $pdf_update_method for an exam-
               ple of updating by command.
 
-       $dvi_update_signal  [Under  UNIX:  SIGUSR1, which is a system-dependent
+       $dvi_update_signal [Under UNIX: SIGUSR1, which  is  a  system-dependent
        value]
-              The number of the signal that is sent to the dvi viewer when  it
-              is  updated  by  sending  a signal -- see the information on the
-              variable $dvi_update_method.   The  default  value  is  the  one
+              The  number of the signal that is sent to the dvi viewer when it
+              is updated by sending a signal -- see  the  information  on  the
+              variable  $dvi_update_method.   The  default  value  is  the one
               appropriate for xdvi on a UNIX system.
 
        $failure_cmd [undefined]
@@ -2347,141 +2491,140 @@
               See the documentation for $compiling_cmd.
 
        $fdb_ext ["fdb_latexmk"]
-              The  extension  of the file which latexmk generates to contain a
-              database of information on source files.  You will not  normally
+              The extension of the file which latexmk generates to  contain  a
+              database  of information on source files.  You will not normally
               need to change this.
 
-       $filetime_causality_threshold   [5];  $filetime_offset_report_threshold
+       $filetime_causality_threshold  [5];   $filetime_offset_report_threshold
        [30]. (Units of seconds.)
 
-              These variables control how latexmk  deals  with  the  following
-              issue,  which  can  affect the use of files that are on a remote
-              filesystem (network share) instead of being  on  a  file  system
-              local  to  the  computer running latexmk.  Almost users will not
-              have to worry about these settings, and can ignore the following
-              explanation.
+              These  variables  control  how  latexmk deals with the following
+              issue, which can affect the use of files that are  on  a  remote
 
-              In  almost all situations, latexmk does not need to use the time
-              stamps of the files it works with.  However, there are a  couple
-              of  situations  when it needs to know whether a certain file was
-              created in the current run of a program (e.g., (pdf)latex) or is
-              a  leftover  file from a previous run. It does this by comparing
-              the modification time of the file  with  the  system  time  just
-              before  the  program  was  started.  If the modification time is
 
 
+                                25 October 2018                             38
 
-                                 7 August 2018                              36
 
 
 
 
-
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-              earlier than when the program was started, the file is  a  left-
-              over  file,  which latexmk treats as if it were not created.  If
-              the filetime is at least the program start time, then it can  be
+              filesystem  (network  share)  instead  of being on a file system
+              local to the computer running latexmk.  Almost  users  will  not
+              have to worry about these settings, and can ignore the following
+              explanation.
+
+              In almost all situations, latexmk does not need to use the  time
+              stamps  of the files it works with.  However, there are a couple
+              of situations when it needs to know whether a certain  file  was
+              created in the current run of a program (e.g., (pdf)latex) or is
+              a leftover file from a previous run. It does this  by  comparing
+              the  modification  time  of  the  file with the system time just
+              before the program was started. If the modification time is ear-
+              lier  than  when the program was started, the file is a leftover
+              file, which latexmk treats as if it were not  created.   If  the
+              filetime  is  at  least  the  program start time, then it can be
               assumed that the file was created in the current run.
 
-              Unfortunately,  this  test  can  fail if the file is on a remote
-              system, since its system time is  not  necessarily  synchronized
-              with  that  of  the  local  system; the timestamps on the remote
-              files are set by the remote system, not the local system.   Gen-
-              erally,  modern  operating  systems  regularly synchronize their
-              time with a server, so the non-synchronization is  mostly  small
+              Unfortunately, this test can fail if the file  is  on  a  remote
+              system,  since  its  system time is not necessarily synchronized
+              with that of the local system;  the  timestamps  on  the  remote
+              files  are set by the remote system, not the local system.  Gen-
+              erally, modern operating  systems  regularly  synchronize  their
+              time  with  a server, so the non-synchronization is mostly small
               (a second or so, or a few seconds).  But even a small difference
               can mess up latexmk's test.
 
               Latexmk measures the time difference between the time on the two
-              systems  and  compensates  for  this.  But the measurement (in a
+              systems and compensates for this.  But  the  measurement  (in  a
               system-independent way) is only accurate to a second or two.  So
-              latexmk  allows  for  a threshold on the difference between file
-              and system time before it concludes that a file  is  a  leftover
-              file  from  a  previous  run.  The configuration variable $file-
-              time_causality_theshhold, which in units of  seconds,  specifies
+              latexmk allows for a threshold on the  difference  between  file
+              and  system  time  before it concludes that a file is a leftover
+              file from a previous  run.  The  configuration  variable  $file-
+              time_causality_theshhold,  which  in units of seconds, specifies
               this threshold.  Luckily high precision is not needed.  The pre-
-              vious run is normally the previous run in a  human  run-edit-run
-              cycle,  and  is  at  least  many seconds back.  A few seconds is
-              therefore  appropriate  for  the  threshold,   $filetime_causal-
-              ity_theshhold;  it  should be non-negative always, and should be
+              vious  run  is normally the previous run in a human run-edit-run
+              cycle, and is at least many seconds  back.   A  few  seconds  is
+              therefore   appropriate  for  the  threshold,  $filetime_causal-
+              ity_theshhold; it should be non-negative always, and  should  be
               bigger than 2 if a remote filesystem or network share is used.
 
-              If the difference in system times on the two systems  is  large,
-              it  normally  indicates that at least one of the systems is mis-
-              configured.   The   variable   $filetime_offset_report_threshold
-              specifies  the  smallest  size  of the difference (or offset) in
-              seconds between the times of the local and remote system  beyond
-              which  the offset is reported.  This is reported at the point in
-              the latexmk's progress that it measures the offset.  The  report
+              If  the  difference in system times on the two systems is large,
+              it normally indicates that at least one of the systems  is  mis-
+              configured.    The   variable  $filetime_offset_report_threshold
+              specifies the smallest size of the  difference  (or  offset)  in
+              seconds  between the times of the local and remote system beyond
+              which the offset is reported.  This is reported at the point  in
+              the  latexmk's  progress that it measures the offset. The report
               is made if silent mode is used and diagnostic mode is not on.
 
 
        $force_mode [0]
-              If  nonzero, continue processing past minor latex errors includ-
+              If nonzero, continue processing past minor latex errors  includ-
               ing unrecognized cross references.  Equivalent to specifying the
               -f option.
 
-       @generated_exts  [(  aux  ,  bbl  , idx , ind , lof , lot , out , toc ,
-       $fdb_ext )]
-              This contains a list of extensions for files that are  generated
-              during  a LaTeX run and that are read in by LaTeX in later runs,
-              either directly or indirectly.
 
-              This list has two uses: (a) to set  the  kinds  of  file  to  be
-              deleted in a cleanup operation (with the -c, -C, -CA, -g and -gg
-              options), and (b) in the determination of  whether  a  rerun  of
-              (pdf)LaTeX is needed after a run that gives an error.
 
+                                25 October 2018                             39
 
 
 
-                                 7 August 2018                              37
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+       @generated_exts [( aux , bbl , idx , ind , lof , lot  ,  out  ,  toc  ,
+       $fdb_ext )]
+              This  contains a list of extensions for files that are generated
+              during a LaTeX run and that are read in by LaTeX in later  runs,
+              either directly or indirectly.
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+              This  list  has  two  uses:  (a)  to set the kinds of file to be
+              deleted in a cleanup operation (with the -c, -C, -CA, -g and -gg
+              options),  and  (b)  in  the determination of whether a rerun of
+              (pdf)LaTeX is needed after a run that gives an error.
 
-
               (Normally, a change of a source file during a run should provoke
-              a rerun.  This includes a file generated by LaTeX, e.g., an  aux
-              file,  that is read in on subsequent runs.  But after a run that
-              results in an error, a new run should occur until the  user  has
-              made  a change in the files.  But the user may have corrected an
+              a  rerun.  This includes a file generated by LaTeX, e.g., an aux
+              file, that is read in on subsequent runs.  But after a run  that
+              results  in  an error, a new run should occur until the user has
+              made a change in the files.  But the user may have corrected  an
               error in a source .tex file during the run.  So latexmk needs to
               distinguish user-generated and automatically generated files; it
-              determines the  automatically  generated  files  as  those  with
+              determines  the  automatically  generated  files  as  those with
               extensions in the list in @generated_exts.)
 
-              A  convenient way to add an extra extension to the list, without
-              losing the already defined ones is to use a push command in  the
+              A convenient way to add an extra extension to the list,  without
+              losing  the already defined ones is to use a push command in the
               line in an RC file.  E.g.,
 
                               push @generated_exts, "end";
 
-              adds  the  extension  "end"  to the list of predefined generated
-              extensions.  (This extension is used by the RevTeX package,  for
+              adds the extension "end" to the  list  of  predefined  generated
+              extensions.   (This extension is used by the RevTeX package, for
               example.)
 
        $go_mode [0]
-              If  nonzero, process files regardless of timestamps, and is then
+              If nonzero, process files regardless of timestamps, and is  then
               equivalent to the -g option.
 
        %hash_calc_ignore_pattern
               !!!This variable is for experts only!!!
 
-              The general rule latexmk uses for determining when an extra  run
-              of  some  program  is needed is that one of the source files has
-              changed.  But consider for example a latex package  that  causes
-              an  encapsulated postscript file (an "eps" file) to be made that
-              is to be read in on the next run.  The file contains  a  comment
-              line  giving  its  creation  date and time.  On the next run the
-              time changes, latex sees that the  eps  file  has  changed,  and
-              therefore  reruns  latex.  This causes an infinite loop, that is
-              only terminated because latexmk has a limit  on  the  number  of
+              The  general rule latexmk uses for determining when an extra run
+              of some program is needed is that one of the  source  files  has
+              changed.   But  consider for example a latex package that causes
+              an encapsulated postscript file (an "eps" file) to be made  that
+              is  to  be read in on the next run.  The file contains a comment
+              line giving its creation date and time.  On  the  next  run  the
+              time  changes,  latex  sees  that  the eps file has changed, and
+              therefore reruns latex.  This causes an infinite loop,  that  is
+              only  terminated  because  latexmk  has a limit on the number of
               runs to guard against pathological situations.
 
               But the changing line has no real effect, since it is a comment.
@@ -2489,44 +2632,44 @@
 
                  $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: ';
 
-              This creates a rule for files with extension .eps about lines to
-              ignore.   The left-hand side is a Perl idiom for setting an item
-              in a hash.  Note that the file extension is specified without  a
-              period.  The value, on the right-hand side, is a string contain-
-              ing a regular expresssion.  (See documentation on Perl  for  how
-              they  are  to be specified in general.)  This particular regular
-              expression specifies that lines beginning with  "%%CreationDate:
-              "  are  to  be  ignored  in deciding whether a file of the given
-              extension .eps has changed.
 
-              There  is  only  one  regular  expression  available  for   each
 
 
+                                25 October 2018                             40
 
-                                 7 August 2018                              38
 
 
 
 
-
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-              extension.   If  you  need  more one pattern to specify lines to
-              ignore, then you need to combine the patterns into a single reg-
-              ular  expression.  The simplest method is separate the different
-              simple patterns by a vertical bar character (indicating  "alter-
-              nation" in the jargon of regular expressions).  For example,
+              This creates a rule for files with extension .eps about lines to
+              ignore.  The left-hand side is a Perl idiom for setting an  item
+              in  a hash.  Note that the file extension is specified without a
+              period.  The value, on the right-hand side, is a string contain-
+              ing  a  regular expresssion.  (See documentation on Perl for how
+              they are to be specified in general.)  This  particular  regular
+              expression  specifies that lines beginning with "%%CreationDate:
+              " are to be ignored in deciding whether  a  file  of  the  given
+              extension .eps has changed.
 
-                 $hash_calc_ignore_pattern{'eps'}      =     '^%%CreationDate:
+              There  is  only one regular expression available for each exten-
+              sion.  If you need more one pattern to specify lines to  ignore,
+              then  you  need  to  combine  the patterns into a single regular
+              expression.  The simplest method is separate the different  sim-
+              ple  patterns  by a vertical bar character (indicating "alterna-
+              tion" in the jargon of regular expressions).  For example,
+
+                 $hash_calc_ignore_pattern{'eps'}     =      '^%%CreationDate:
               |^%%Title: ';
 
-              causes  lines  starting  with  either  "^%%CreationDate:  "   or
+              causes   lines  starting  with  either  "^%%CreationDate:  "  or
               "^%%Title: " to be ignored.
 
-              It  may happen that a pattern to be ignored is specified in, for
-              example, in a system or user initialization file, and  you  wish
-              to  remove  this  in a file that is read later.  To do this, you
+              It may happen that a pattern to be ignored is specified in,  for
+              example,  in  a system or user initialization file, and you wish
+              to remove this in a file that is read later.  To  do  this,  you
               use Perl's delete function, e.g.,
 
                   delete $hash_calc_ignore_pattern{'eps'};
@@ -2533,81 +2676,84 @@
 
 
        $kpsewhich ["kpsewhich %S"]
-              The program called to locate a source file when the  name  alone
-              is  not  sufficient.  Most filenames used by latexmk have suffi-
-              cient path information to be  found  directly.   But  sometimes,
+              The  program  called to locate a source file when the name alone
+              is not sufficient.  Most filenames used by latexmk  have  suffi-
+              cient  path  information  to  be found directly.  But sometimes,
               notably when a .bib or a .bst file is found from the log file of
-              a bibtex or biber run, only the base name of the file is  known,
+              a  bibtex or biber run, only the base name of the file is known,
               but not its path. The program specified by $kpsewhich is used to
               find it.
 
-              (For advanced users: Because  of  the  different  way  in  which
-              latexmk  uses  the  command specified in $kpsewhich, some of the
-              possibilities listed in the FORMAT OF COMMAND SPECIFICATIONS  do
+              (For  advanced  users:  Because  of  the  different way in which
+              latexmk uses the command specified in $kpsewhich,  some  of  the
+              possibilities  listed in the FORMAT OF COMMAND SPECIFICATIONS do
               not apply.  The internal and start keywords are not available. A
               simple command specification with possible options and then "%S"
-              is  all  that  is  guaranteed to work.  Note that for other com-
+              is all that is guaranteed to work.  Note  that  for  other  com-
               mands, "%S" is substituted by a single source file. In contrast,
               for $kpsewhich, "%S" may be substituted by a long list of space-
-              separated filenames, each of which is  quoted.   The  result  on
+              separated  filenames,  each  of  which is quoted.  The result on
               STDOUT of running the command is then piped to latexmk.)
 
-              See  also  the  @BIBINPUTS variable for another way that latexmk
+              See also the @BIBINPUTS variable for another  way  that  latexmk
               also uses to try to locate files; it applies only in the case of
               .bib files.
 
-       $kpsewhich_show [0]
-              Whether  to show diagnostics about invocations of kpsewhich: the
-              command line use to invoke it and the results.   These  diagnos-
-              tics  are shown if $kpsewhich_show is non-zero or if diagnostics
-              mode is on.  (But in the second case, lots of other  diagnostics
-              are  also  shown.)   Without  these diagnostics there is nothing
-              visible in latexmk's screen output about  invocations  of  kpse-
-              which.
 
 
+                                25 October 2018                             41
 
 
 
-                                 7 August 2018                              39
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+       $kpsewhich_show [0]
+              Whether to show diagnostics about invocations of kpsewhich:  the
+              command  line  use to invoke it and the results.  These diagnos-
+              tics are shown if $kpsewhich_show is non-zero or if  diagnostics
+              mode  is on.  (But in the second case, lots of other diagnostics
+              are also shown.)  Without these  diagnostics  there  is  nothing
+              visible  in  latexmk's  screen output about invocations of kpse-
+              which.
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
        $landscape_mode [0]
               If nonzero, run in landscape mode, using the landscape mode pre-
-              viewers and dvi to postscript converters.  Equivalent to the  -l
+              viewers  and dvi to postscript converters.  Equivalent to the -l
               option.  Normally not needed with current previewers.
 
        $latex ["latex %O %S"]
-              The LaTeX processing program.  Note that as with other programs,
-              you can use this variable not just to change  the  name  of  the
-              program used, but also specify options to the program.  E.g.,
+              Specifies the command line for  the  LaTeX  processing  program.
+              Note  that as with other programs, you can use this variable not
+              just to change the name of the program used,  but  also  specify
+              options to the program.  E.g.,
 
-                                  $latex = "latex --src-specials";
+                                  $latex = "latex --src-specials %O %S";
 
+              To do a coordinated setting of all of $latex, $pdflatex, $luala-
+              tex, and $xelatex, see the section "Advanced Configuration".
+
+
        %latex_input_extensions
-              This  variable specifies the extensions tried by latexmk when it
-              finds that a LaTeX run resulted in an error that a file has  not
-              been  found,  and  the file is given without an extension.  This
-              typically happens when LaTeX commands of the  form  \input{file}
-              or  \includegraphics{figure}, when the relevant source file does
+              This variable specifies the extensions tried by latexmk when  it
+              finds  that a LaTeX run resulted in an error that a file has not
+              been found, and the file is given without  an  extension.   This
+              typically  happens  when LaTeX commands of the form \input{file}
+              or \includegraphics{figure}, when the relevant source file  does
               not exist.
 
-              In this situation, latexmk searches for custom  dependencies  to
-              make  the  missing  file(s),  but restricts it to the extensions
-              specified by the variable %latex_input_extensions.  The  default
+              In  this  situation, latexmk searches for custom dependencies to
+              make the missing file(s), but restricts  it  to  the  extensions
+              specified  by the variable %latex_input_extensions.  The default
               extensions are 'tex' and 'eps'.
 
-              (For  Perl experts: %latex_input_extensions is a hash whose keys
-              are the extensions.  The values are  irrelevant.)   Two  subrou-
-              tines  are  provided for manipulating this and the related vari-
-              able     %pdflatex_input_extensions,      add_input_ext      and
-              remove_input_ext.   They  are  used as in the following examples
+              (For Perl experts: %latex_input_extensions is a hash whose  keys
+              are  the  extensions.   The values are irrelevant.)  Two subrou-
+              tines are provided for manipulating this and the  related  vari-
+              able      %pdflatex_input_extensions,      add_input_ext     and
+              remove_input_ext.  They are used as in  the  following  examples
               are possible lines in an initialization file:
 
                   remove_input_ext( 'latex', 'tex' );
@@ -2616,34 +2762,34 @@
 
                   add_input_ext( 'latex', 'asdf' );
 
-              add the extension 'asdf to  latex_input_extensions.   (Naturally
-              with such an extension, you should have made an appropriate cus-
-              tom dependency for latexmk, and should also have done the appro-
-              priate  programming  in the LaTeX source file to enable the file
-              to be read.  The standard extensions are handled  by  LaTeX  and
-              its graphics/graphicx packages.)
+              add  the  extension 'asdf to latex_input_extensions.  (Naturally
+              with such an extension, you  should  have  made  an  appropriate
 
-       $latex_silent_switch ["-interaction=batchmode"]
-              Switch(es)  for the LaTeX processing program when silent mode is
-              on.
 
-              If you use MikTeX, you may prefer the results if  you  configure
-              the  options  to include -c-style-errors, e.g., by the following
-              line in an initialization file
 
-                $latex_silent_switch   =   "-interaction=batchmode   -c-style-
+                                25 October 2018                             42
 
 
 
-                                 7 August 2018                              40
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+              custom  dependency  for  latexmk,  and should also have done the
+              appropriate programming in the LaTeX source file to  enable  the
+              file  to  be read.  The standard extensions are handled by LaTeX
+              and its graphics/graphicx packages.)
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+       $latex_silent_switch ["-interaction=batchmode"]
+              Switch(es) for the LaTeX processing program when silent mode  is
+              on.
 
+              If  you  use MikTeX, you may prefer the results if you configure
+              the options to include -c-style-errors, e.g., by  the  following
+              line in an initialization file
 
+                $latex_silent_switch   =   "-interaction=batchmode   -c-style-
               errors";
 
 
@@ -2650,7 +2796,7 @@
        $lpr ["lpr %O %S" under UNIX/Linux, "NONE lpr" under MS-Windows]
               The command to print postscript files.
 
-              Under  MS-Windows (unlike UNIX/Linux), there is no standard pro-
+              Under MS-Windows (unlike UNIX/Linux), there is no standard  pro-
               gram for printing files.  But there are ways you can do it.  For
               example, if you have gsview installed, you could use it with the
               option "/p":
@@ -2657,12 +2803,12 @@
 
                   $lpr = '"c:/Program Files/Ghostgum/gsview/gsview32.exe" /p';
 
-              If gsview is installed in a different directory, you  will  need
-              to  make the appropriate change.  Note the combination of single
-              and double quotes around the name.  The  single  quotes  specify
-              that  this is a string to be assigned to the configuration vari-
-              able $lpr.  The double quotes are part of the string  passed  to
-              the  operating  system to get the command obeyed; this is neces-
+              If  gsview  is installed in a different directory, you will need
+              to make the appropriate change.  Note the combination of  single
+              and  double  quotes  around the name.  The single quotes specify
+              that this is a string to be assigned to the configuration  vari-
+              able  $lpr.   The double quotes are part of the string passed to
+              the operating system to get the command obeyed; this  is  neces-
               sary because one part of the command name ("Program Files") con-
               tains a space which would otherwise be misinterpreted.
 
@@ -2672,44 +2818,50 @@
        $lpr_pdf ["NONE lpr_pdf"]
               The printing program to print pdf files.
 
-              Under  MS-Windows  you  could  set  this to use gsview, if it is
+              Under MS-Windows you could set this to  use  gsview,  if  it  is
               installed, e.g.,
 
                   $lpr = '"c:/Program Files/Ghostgum/gsview/gsview32.exe" /p';
 
-              If gsview is installed in a different directory, you  will  need
-              to  make  the appropriate change.  Note the double quotes around
+              If  gsview  is installed in a different directory, you will need
+              to make the appropriate change.  Note the double  quotes  around
               the name: this is necessary because one part of the command name
               ("Program Files") contains a space which would otherwise be mis-
               interpreted.
 
-       $lualatex ["lualatex %O %S"]
-              The LaTeX processing program that is to be used when the  luala-
-              tex program is called for (e.g., by the option -lualatex.
 
-       %lualatex_input_extensions
-              This  variable specifies the extensions tried by latexmk when it
-              finds that a lualatex run resulted in an error that a  file  has
-              not  been  found,  and  the  file is given without an extension.
-              This  typically  happens  when  LaTeX  commands  of   the   form
-              \input{file}  or  \includegraphics{figure},  when  the  relevant
-              source file does not exist.
 
-              In this situation, latexmk searches for custom  dependencies  to
-              make  the  missing  file(s),  but restricts it to the extensions
-              specified  by  the  variable  %pdflatex_input_extensions.    The
 
 
+                                25 October 2018                             43
 
-                                 7 August 2018                              41
 
 
 
 
-
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+       $lualatex ["lualatex %O %S"]
+              Specifies the command line for the LaTeX processing program that
+              is to be used when the lualatex program is called for (e.g.,  by
+              the option -lualatex.
+
+              To do a coordinated setting of all of $latex, $pdflatex, $luala-
+              tex, and $xelatex, see the section "Advanced Configuration".
+
+
+       %lualatex_input_extensions
+              This variable specifies the extensions tried by latexmk when  it
+              finds  that  a lualatex run resulted in an error that a file has
+              not been found, and the file  is  given  without  an  extension.
+              This   typically   happens  when  LaTeX  commands  of  the  form
+              \input{file}  or  \includegraphics{figure},  when  the  relevant
+              source file does not exist.
+
+              In  this  situation, latexmk searches for custom dependencies to
+              make the missing file(s), but restricts  it  to  the  extensions
+              specified   by  the  variable  %pdflatex_input_extensions.   The
               default extensions are 'tex', 'pdf', 'jpg, and 'png'.
 
               See details of the %latex_input_extensions for other information
@@ -2716,10 +2868,10 @@
               that equally applies to %lualatex_input_extensions.
 
        $lualatex_silent_switch ["-interaction=batchmode"]
-              Switch(es) for the lualatex program (specified in  the  variable
+              Switch(es)  for  the lualatex program (specified in the variable
               $lualatex) when silent mode is on.
 
-              See  details  of  the $latex_silent_switch for other information
+              See details of the $latex_silent_switch  for  other  information
               that equally applies to $lualatex_silent_switch.
 
        $make ["make"]
@@ -2729,122 +2881,123 @@
               The index processing program.
 
        $makeindex_silent_switch ["-q"]
-              Switch(es) for the index processing program when silent mode  is
+              Switch(es)  for the index processing program when silent mode is
               on.
 
        $max_repeat [5]
-              The  maximum  number  of  times  latexmk will run latex/pdflatex
-              before deciding that there may be an infinite loop and  that  it
+              The maximum number of  times  latexmk  will  run  latex/pdflatex
+              before  deciding  that there may be an infinite loop and that it
               needs to bail out, rather than rerunning latex/pdflatex again to
-              resolve cross-references, etc.  The  default  value  covers  all
+              resolve  cross-references,  etc.   The  default value covers all
               normal cases.
 
-              (Note  that  the  "etc"  covers  a lot of cases where one run of
+              (Note that the "etc" covers a lot of  cases  where  one  run  of
               latex/pdflatex generates files to be read in on a later run.)
 
        $MSWin_back_slash [1]
-              This configuration variable only has an effect when  latexmk  is
-              running under MS-Windows.  It determines whether, when a command
-              is executed under MS-Windows, there should  be  substituted  "\"
-              for  the  separator  character between components of a directory
-              name.  Internally, latexmk uses "/" for the directory  separator
-              character, which is the character used by Unix-like systems.
+              This  configuration  variable only has an effect when latexmk is
 
-              For many programs under MS-Windows, both "\" and "/" are accept-
-              able as the directory separator character.   But  some  programs
-              only  accept  "\"  on  the  command line.  So for safety latexmk
-              makes a translation, by default.  It is conceivable  that  under
-              certain situations this is undesirable, so the configuration can
-              be changed.  (A possible example might be when some of the soft-
-              ware  is  implemented  using  Cygwin, which provides a Unix-like
-              environment inside MS-Windows.)
 
-       $new_viewer_always [0]
-              This variable applies  to  latexmk  only  in  continuous-preview
-              mode.  If $new_viewer_always is 0, latexmk will check for a pre-
-              viously running previewer on the same file, and if one  is  run-
-              ning  will  not  start a new one.  If $new_viewer_always is non-
 
+                                25 October 2018                             44
 
 
-                                 7 August 2018                              42
 
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+              running under MS-Windows.  It determines whether, when a command
+              is  executed  under  MS-Windows, there should be substituted "\"
+              for the separator character between components  of  a  directory
+              name.   Internally, latexmk uses "/" for the directory separator
+              character, which is the character used by Unix-like systems.
 
+              For many programs under MS-Windows, both "\" and "/" are accept-
+              able  as  the  directory separator character.  But some programs
+              only accept "\" on the command  line.   So  for  safety  latexmk
+              makes  a  translation, by default.  It is conceivable that under
+              certain situations this is undesirable, so the configuration can
+              be changed.  (A possible example might be when some of the soft-
+              ware is implemented using Cygwin,  which  provides  a  Unix-like
+              environment inside MS-Windows.)
 
-              zero, this check will be skipped, and latexmk will behave as  if
+       $new_viewer_always [0]
+              This  variable  applies  to  latexmk  only in continuous-preview
+              mode.  If $new_viewer_always is 0, latexmk will check for a pre-
+              viously  running  previewer on the same file, and if one is run-
+              ning will not start a new one.  If  $new_viewer_always  is  non-
+              zero,  this check will be skipped, and latexmk will behave as if
               no viewer is running.
 
        $out_dir [""]
-              If  non-blank,  this  variable  specifies the directory in which
+              If non-blank, this variable specifies  the  directory  in  which
               output files are to be written by a run of (pdf)latex.  See also
               the variable $aux_dir.
 
-              The  effect  of  this  variable  (when non-blank) is achieved by
-              using the -output-directory option of (pdf)latex.   This  exists
-              in  the  usual  current (Dec. 2011 and later) implementations of
-              TeX, i.e., MiKTeX and TeXLive. But it  may  not  be  present  in
+              The effect of this variable  (when  non-blank)  is  achieved  by
+              using  the  -output-directory option of (pdf)latex.  This exists
+              in the usual current (Dec. 2011 and  later)  implementations  of
+              TeX,  i.e.,  MiKTeX  and  TeXLive.  But it may not be present in
               other versions.
 
-              If  you also use the -cd option, and $out_dir (or $aux_dir) con-
-              tains a relative path, then the path is interpreted relative  to
+              If you also use the -cd option, and $out_dir (or $aux_dir)  con-
+              tains  a relative path, then the path is interpreted relative to
               the document directory.
 
-              Commonly,  the  directory specified for output files is a subdi-
+              Commonly, the directory specified for output files is  a  subdi-
               rectory of the current working directory.  However, if you spec-
-              ify  some  other  directory, e.g., "/tmp/foo" or "../output", be
-              aware that this could cause problems, e.g.,  with  makeindex  or
-              bibtex.   This  is because modern versions of these programs, by
-              default, will refuse to work when they find that they are  asked
-              to  write  to  a  file in a directory that appears not to be the
+              ify some other directory, e.g., "/tmp/foo"  or  "../output",  be
+              aware  that  this  could cause problems, e.g., with makeindex or
+              bibtex.  This is because modern versions of these  programs,  by
+              default,  will refuse to work when they find that they are asked
+              to write to a file in a directory that appears  not  to  be  the
               current working directory or one of its subdirectories.  This is
-              part  of  security  measures by the whole TeX system that try to
+              part of security measures by the whole TeX system  that  try  to
               prevent malicious or errant TeX documents from incorrectly mess-
               ing with a user's files.  If for $out_dir or $aux_dir you really
-              do need to specify an absolute pathname (e.g., "/tmp/foo") or  a
+              do  need to specify an absolute pathname (e.g., "/tmp/foo") or a
               path (e.g., "../output") that includes a higher-level directory,
-              and you need to use makeindex or bibtex, then you need  to  dis-
-              able  the  security measures (and assume any risks).  One way of
+              and  you  need to use makeindex or bibtex, then you need to dis-
+              able the security measures (and assume any risks).  One  way  of
               doing this is to temporarily set an operating system environment
-              variable  openout_any  to  "a"  (as  in  "all"), to override the
-              default "paranoid" setting.
 
-       $pdf_mode [0]
-              If zero, do NOT generate a pdf  version  of  the  document.   If
-              equal  to 1, generate a pdf version of the document using pdfla-
-              tex, using the command specified by the $pdflatex variable.   If
-              equal  to  2, generate a pdf version of the document from the ps
-              file, by using the command specified by  the  $ps2pdf  variable.
-              If  equal  to 3, generate a pdf version of the document from the
-              dvi file, by using the command specified by  the  $dvipdf  vari-
-              able.   If  equal  to  4, generate a pdf version of the document
-              using lualatex, using the command  specified  by  the  $lualatex
-              variable.   If  equal  to  5, generate a pdf version (and an xdv
-              version) of the document using xelatex, using the commands spec-
-              ified by the $xelatex and xdvipdfmx variables.
 
-              In  $pdf_mode=2,  it is ensured that .dvi and .ps files are also
-              made.  In $pdf_mode=3, it is ensured that a .dvi  file  is  also
-              made.
 
+                                25 October 2018                             45
 
 
-                                 7 August 2018                              43
 
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+              variable openout_any to "a"  (as  in  "all"),  to  override  the
+              default "paranoid" setting.
 
+       $pdf_mode [0]
+              If  zero,  do  NOT  generate  a pdf version of the document.  If
+              equal to 1, generate a pdf version of the document using  pdfla-
+              tex,  using the command specified by the $pdflatex variable.  If
+              equal to 2, generate a pdf version of the document from  the  ps
+              file,  by  using  the command specified by the $ps2pdf variable.
+              If equal to 3, generate a pdf version of the document  from  the
+              dvi  file,  by  using the command specified by the $dvipdf vari-
+              able.  If equal to 4, generate a pdf  version  of  the  document
+              using  lualatex,  using  the  command specified by the $lualatex
+              variable.  If equal to 5, generate a pdf  version  (and  an  xdv
+              version) of the document using xelatex, using the commands spec-
+              ified by the $xelatex and xdvipdfmx variables.
 
+              In $pdf_mode=2, it is ensured that .dvi and .ps files  are  also
+              made.   In  $pdf_mode=3,  it is ensured that a .dvi file is also
+              made.
+
        $pdflatex ["pdflatex %O %S"]
-              The  LaTeX processing program in a version that makes a pdf file
-              instead of a dvi file.
+              Specifies the command line for the LaTeX processing program in a
+              version that makes a pdf file instead of a dvi file.
 
               An example use of this variable is to add certain options to the
               command line for the program, e.g.,
@@ -2851,12 +3004,15 @@
 
                    $pdflatex = "pdflatex --shell-escape %O %S";
 
-              (In  some  earlier  versions  of  latexmk,  you needed to use an
-              assignment to $pdflatex to allow the use of lualatex or  xelatex
+              (In some earlier versions of  latexmk,  you  needed  to  use  an
+              assignment  to $pdflatex to allow the use of lualatex or xelatex
               instead of pdflatex.  There are now separate configuration vari-
-              ables for the use of lualatex or  xelatex.   See  $lualatex  and
+              ables  for  the  use  of lualatex or xelatex.  See $lualatex and
               $xelatex.)
 
+              To do a coordinated setting of all of $latex, $pdflatex, $luala-
+              tex, and $xelatex, see the section "Advanced Configuration".
+
        %pdflatex_input_extensions
               This  variable specifies the extensions tried by latexmk when it
               finds that a pdflatex run resulted in an error that a  file  has
@@ -2873,6 +3029,17 @@
               See details of the %latex_input_extensions for other information
               that equally applies to %pdflatex_input_extensions.
 
+
+
+                                25 October 2018                             46
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
        $pdflatex_silent_switch ["-interaction=batchmode"]
               Switch(es) for the pdflatex program (specified in  the  variable
               $pdflatex) when silent mode is on.
@@ -2896,18 +3063,6 @@
 
               WARNING:   Problem  under MS-Windows: if acroread is used as the
               pdf previewer, and it is actually viewing a pdf  file,  the  pdf
-
-
-
-                                 7 August 2018                              44
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
               file  cannot  be  updated.   Thus makes acroread a bad choice of
               previewer if you use latexmk's previous-continuous mode  (option
               -pvc)  under  MS-windows.   This  problem does not occur if, for
@@ -2940,6 +3095,17 @@
               Note that acroread under MS-Windows (but not UNIX) locks the pdf
               file, so the default value is then 3.
 
+
+
+                                25 October 2018                             47
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
               Arranging to use a command to get a previewer explicitly updated
               requires three variables to be set.  For example:
 
@@ -2962,18 +3128,6 @@
 
        $pid_position[1 under UNIX, -1 under MS-Windows]
               The variable $pid_position is used  to  specify  which  word  in
-
-
-
-                                 7 August 2018                              45
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
               lines  of  the output from $pscmd corresponds to the process ID.
               The first word in the line is numbered 0.  The default value  of
               1 (2nd word in line) is correct for Solaris 2.6, Linux, and OS-X
@@ -2989,6 +3143,35 @@
               If some other request is made for which  a  postscript  file  is
               needed, then $postscript_mode will be set to 1.
 
+       $pre_tex_code ['']
+
+              Sets  TeX  code to be executed before inputting the source file.
+              This works if the relevant one of $latex, etc contains  a  suit-
+              able command line with a %P or %U substitution.  For example you
+              could do
+
+                   $latex = 'latex %O %P';
+                   $pre_tex_code     =     '1{An     initial      messagear}';
+
+              To  set  all  of  $latex, $pdflatex, $lualatex, and $xelatex you
+              could use the subroutine alt_tex_cmds:
+
+                   &alt_tex_cmds;
+                   $pre_tex_code     =     '1{An     initial      messagear}';
+
+
+
+
+
+                                25 October 2018                             48
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
        $preview_continuous_mode [0]
               If  nonzero,  run a previewer to view the document, and continue
               running latexmk to keep .dvi up-to-date.  Equivalent to the -pvc
@@ -3028,18 +3211,6 @@
               (including Linux).  In these specifications "$ENV{USER}" is sub-
               stituted by the username.
 
-
-
-
-                                 7 August 2018                              46
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
        $ps2pdf ["ps2pdf %O %S %D"]
               Command to convert .ps to .pdf file.
 
@@ -3055,6 +3226,18 @@
 
               Note that gv could be used with the -watch  option  updates  its
               display  whenever the postscript file changes, whereas ghostview
+
+
+
+                                25 October 2018                             49
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
               does not.  However, different versions of gv have slightly  dif-
               ferent  ways  of  writing  this  option.  You can configure this
               variable appropriately.
@@ -3094,18 +3277,6 @@
 
        $ps_update_signal  [Under  UNIX:  SIGHUP,  which  is a system-dependent
        value]
-
-
-
-                                 7 August 2018                              47
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
               The number of the signal that is sent to the pdf viewer when  it
               is  updated  by  sending a signal -- see $ps_update_method.  The
               default value is the one appropriate for gv on a UNIX system.
@@ -3122,6 +3293,17 @@
               The period of inactivity, in minutes, after which pvc mode times
               out.  This is used if $pvc_timeout is nonzero.
 
+
+
+                                25 October 2018                             50
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
        $pvc_view_file_via_temporary [1]
               The same as $always_view_file_via_temporary, except that it only
               applies in preview-continuous mode (-pvc option).
@@ -3159,22 +3341,10 @@
               main document's LaTeX, e.g., for Document.tex, the .fls file  is
               Document.fls.   However,  some  implementations  instead produce
               files named for the program, i.e.,  latex.fls  or  pdflatex.fls.
-              In   this   second   case,   latexmk  copies  the  latex.fls  or
+              In  this  second  case,  latexmk  copies the latex.fls or pdfla-
+              tex.fls to a file with the basename of the main LaTeX  document,
+              e.g., Document.fls.
 
-
-
-                                 7 August 2018                              48
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
-              pdflatex.fls to a file with the basename of the main LaTeX docu-
-              ment, e.g., Document.fls.
-
        $search_path_separator [See below for default]
               The character separating paths in the environment variables TEX-
               INPUTS, BIBINPUTS, and BSTINPUTS.  This variable is mainly  used
@@ -3188,6 +3358,18 @@
               and dvips do, because sometimes graphics files get generated  in
               the output or aux directories.]
 
+
+
+
+                                25 October 2018                             51
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
               The  default  under  MSWin and Cygwin is ';' and under UNIX-like
               operating systems (including Linux and OS-X) is  ':'.   Normally
               the  defaults give correct behavior.  But there can be difficul-
@@ -3227,17 +3409,6 @@
               minimum  of  one  second  delay,  except that zero delay is also
               allowed.
 
-
-
-                                 7 August 2018                              49
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
               A value of exactly 0 gives no delay, and  typically  results  in
               100% CPU usage, which may not be desirable.
 
@@ -3253,6 +3424,18 @@
        $success_cmd [undefined]
               See the documentation for $compiling_cmd.
 
+
+
+
+                                25 October 2018                             52
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
        $tmpdir [See below for default]
               Directory  to  store  temporary  files that latexmk may generate
               while running.
@@ -3293,17 +3476,6 @@
               able $warnings_as_errors controls whether this behavior is modi-
               fied.
 
-
-
-                                 7 August 2018                              50
-
-
-
-
-
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
-
-
               When the variable is non-zero, latexmk at the  end  of  its  run
               will  return  a  non-zero status code to the operating system if
               any of the files processed gives a warning about  problems  with
@@ -3318,6 +3490,18 @@
 
               The default behavior is normally satisfactory in the usual edit-
               compile-edit  cycle.  But, for example, latexmk can also be used
+
+
+
+                                25 October 2018                             53
+
+
+
+
+
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+
+
               as part of a build process for some bigger  project,  e.g.,  for
               creating  documentation  in the build of a software application.
               Then it is often sensible to treat citation and reference  warn-
@@ -3347,40 +3531,46 @@
        $xdvipdfmx_silent_switch ["-q"]
               Switch(es) for the xdvipdfmx program when silent mode is on.
 
-       $xelatex ["xelatex -no-pdf %O %S"]
-              The  LaTeX  processing  program of in a version that makes a pdf
-              file instead of a dvi file, when the xelatex program  is  called
-              for.  See the documentation of the -xelatex option for some spe-
-              cial properties of latexmk's use of xelatex.
+       $xelatex ["xelatex %O %S"]
+              Specifies  the  command line for the LaTeX processing program of
+              when the xelatex program is called for.  See  the  documentation
+              of  the -xelatex option for some special properties of latexmk's
+              use of xelatex.
 
-              Note the use of the -no-pdf option to force xelatex to  make  an
-              .xdv  rather than .pdf file, with the .pdf file being created in
-              a separate step.  See the documentation of the -pdfxe option for
-              more details.
+              Note about xelatex: Now latexmk uses xelatex  to  make  an  .xdv
+              rather  than  .pdf  file,  with the .pdf file being created in a
+              separate step.  This is enforced  by  the  use  of  the  -no-pdf
+              option.  If %O is part of the command for invoking xelatex, then
+              latexmk will insert the -no-pdf option automatically,  otherwise
+              you must provide the option yourself
 
+              To do a coordinated setting of all of $latex, $pdflatex, $luala-
+              tex, and $xelatex, see the section "Advanced Configuration".
 
 
+       %xelatex_input_extensions
+              This variable specifies the extensions tried by latexmk when  it
+              finds  that  an xelatex run resulted in an error that a file has
+              not been found, and the file  is  given  without  an  extension.
+              This   typically   happens  when  LaTeX  commands  of  the  form
+              \input{file}  or  \includegraphics{figure},  when  the  relevant
+              source file does not exist.
 
-                                 7 August 2018                              51
 
 
 
+                                25 October 2018                             54
 
 
+
+
+
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-       %xelatex_input_extensions
-              This  variable specifies the extensions tried by latexmk when it
-              finds that an xelatex run resulted in an error that a  file  has
-              not  been  found,  and  the  file is given without an extension.
-              This  typically  happens  when  LaTeX  commands  of   the   form
-              \input{file}  or  \includegraphics{figure},  when  the  relevant
-              source file does not exist.
-
-              In this situation, latexmk searches for custom  dependencies  to
-              make  the  missing  file(s),  but restricts it to the extensions
-              specified  by  the  variable   %xelatex_input_extensions.    The
+              In  this  situation, latexmk searches for custom dependencies to
+              make the missing file(s), but restricts  it  to  the  extensions
+              specified   by   the  variable  %xelatex_input_extensions.   The
               default extensions are 'tex', 'pdf', 'jpg, and 'png'.
 
               See details of the %latex_input_extensions for other information
@@ -3387,10 +3577,10 @@
               that equally applies to %xelatex_input_extensions.
 
        $xelatex_silent_switch ["-interaction=batchmode"]
-              Switch(es) for the xelatex program (specified  in  the  variable
+              Switch(es)  for  the  xelatex program (specified in the variable
               $xelatex) when silent mode is on.
 
-              See  details  of  the $latex_silent_switch for other information
+              See details of the $latex_silent_switch  for  other  information
               that equally applies to $xelatex_silent_switch.
 
 
@@ -3397,7 +3587,7 @@
 
 
 CUSTOM DEPENDENCIES
-       In any RC file a set of custom dependencies can be set up to convert  a
+       In  any RC file a set of custom dependencies can be set up to convert a
        file with one extension to a file with another.  An example use of this
        would be to allow latexmk to convert a .fig file to .eps to be included
        in the .tex file.
@@ -3405,9 +3595,9 @@
 
    Defining a custom dependency:
        The old method of configuring latexmk to use a custom dependency was to
-       directly manipulate the @cus_dep_list array that  contains  information
-       defining  the  custom  dependencies.   (See  the section "Old Method of
-       Defining Custom Dependencies" for details.) This  method  still  works,
+       directly  manipulate  the @cus_dep_list array that contains information
+       defining the custom dependencies.  (See  the  section  "Old  Method  of
+       Defining  Custom  Dependencies"  for details.) This method still works,
        but is no longer preferred.
 
        A better method is to use the subroutines that allow convenient manipu-
@@ -3420,14 +3610,22 @@
        The arguments are as follows:
 
        from extension:
-              The extension of the file we are converting from  (e.g.  "fig").
+              The  extension  of the file we are converting from (e.g. "fig").
               It is specified without a period.
 
+       to extension:
+              The extension of the file we are converting to (e.g. "eps").  It
+              is specified without a period.
 
+       must:  If  non-zero,  the file from which we are converting must exist,
+              if it doesn't exist latexmk will give an error message and  exit
+              unless the -f option is specified.  If must is zero and the file
+              we are converting from doesn't exist, then no action  is  taken.
+              Generally, the appropriate value of must is zero.
 
 
 
-                                 7 August 2018                              52
+                                25 October 2018                             55
 
 
 
@@ -3436,91 +3634,79 @@
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-       to extension:
-              The extension of the file we are converting to (e.g. "eps").  It
-              is specified without a period.
-
-       must:  If non-zero, the file from which we are converting  must  exist,
-              if  it doesn't exist latexmk will give an error message and exit
-              unless the -f option is specified.  If must is zero and the file
-              we  are  converting from doesn't exist, then no action is taken.
-              Generally, the appropriate value of must is zero.
-
        function:
-              The name of the subroutine that latexmk should call  to  perform
-              the  file  conversion.   The first argument to the subroutine is
+              The  name  of the subroutine that latexmk should call to perform
+              the file conversion.  The first argument to  the  subroutine  is
               the base name of the file to be converted without any extension.
-              The  subroutines  are declared in the syntax of Perl.  The func-
-              tion should return 0 if it was successful and a  nonzero  number
+              The subroutines are declared in the syntax of Perl.   The  func-
+              tion  should  return 0 if it was successful and a nonzero number
               if it failed.
 
 
-       Naturally  add_cus_dep adds a custom dependency with the specified from
-       and to extensions.  If a custom dependency has been previously  defined
-       (e.g.,  in an rcfile that was read earlier), then it is replaced by the
+       Naturally add_cus_dep adds a custom dependency with the specified  from
+       and  to extensions.  If a custom dependency has been previously defined
+       (e.g., in an rcfile that was read earlier), then it is replaced by  the
        new one.
 
-       The subroutine remove_cus_dep removes the specified custom  dependency.
+       The  subroutine remove_cus_dep removes the specified custom dependency.
        The subroutine show_cus_dep causes a list of the currently defined cus-
        tom dependencies to be sent to the screen output.
 
 
    How custom dependencies are used:
-       An instance of a custom dependency rule  is  created  whenever  latexmk
-       detects  that  a  run  of  latex/pdflatex  needs to read a file, like a
-       graphics file, whose extension is the to-extension of a  custom  depen-
+       An  instance  of  a  custom dependency rule is created whenever latexmk
+       detects that a run of latex/pdflatex needs  to  read  a  file,  like  a
+       graphics  file,  whose extension is the to-extension of a custom depen-
        dency.  Then latexmk examines whether a file exists with the same name,
-       but with the corresponding from-extension, as specified in the  custom-
-       dependency.   If  it  does, then a corresponding instance of the custom
-       dependency is created, after which the rule  is  invoked  whenever  the
-       destination  file  (the  one with the to-extension) is out-of-date with
+       but  with the corresponding from-extension, as specified in the custom-
+       dependency.  If it does, then a corresponding instance  of  the  custom
+       dependency  is  created,  after  which the rule is invoked whenever the
+       destination file (the one with the to-extension)  is  out-of-date  with
        respect to the corresponding source file.
 
-       To make the new destination file, the Perl subroutine specified in  the
+       To  make the new destination file, the Perl subroutine specified in the
        rule is invoked, with an argument that is the base name of the files in
-       question.  Simple cases just involve a subroutine invoking an  external
-       program;  this  can  be  done by following the templates below, even by
-       those without knowledge of the Perl programming language.   Of  course,
+       question.   Simple cases just involve a subroutine invoking an external
+       program; this can be done by following the  templates  below,  even  by
+       those  without  knowledge of the Perl programming language.  Of course,
        experts could do something much more elaborate.
 
-       One  item  in the specification of each custom-dependency rule, labeled
-       "must" above, specifies how the rule should be applied when the  source
+       One item in the specification of each custom-dependency  rule,  labeled
+       "must"  above, specifies how the rule should be applied when the source
        file fails to exist.
 
-       When  latex reports that an input file (e.g., a graphics file) does not
+       When latex reports that an input file (e.g., a graphics file) does  not
        exist, latexmk tries to find a source file and a custom dependency that
        can be used to make it.  If it succeeds, then it creates an instance of
+       the  custom  dependency  and invokes it to make the missing file, after
+       which the next pass of latex etc will be able to read the newly created
+       file.
 
+       Note  for  advanced  usage: The operating system's environment variable
+       TEXINPUTS can be used to specify a search path  for  finding  files  by
+       latex  etc.   Correspondingly, when a missing file is reported, latexmk
+       looks in the directories specified in TEXINPUTS as well as in the  cur-
+       rent  directory, to find a source file from which an instance of a cus-
+       tom dependency can be used to make the missing file.
 
 
-                                 7 August 2018                              53
 
+                                25 October 2018                             56
 
 
 
 
+
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-       the custom dependency and invokes it to make the  missing  file,  after
-       which the next pass of latex etc will be able to read the newly created
-       file.
-
-       Note for advanced usage: The operating  system's  environment  variable
-       TEXINPUTS  can  be  used  to specify a search path for finding files by
-       latex etc.  Correspondingly, when a missing file is  reported,  latexmk
-       looks  in the directories specified in TEXINPUTS as well as in the cur-
-       rent directory, to find a source file from which an instance of a  cus-
-       tom dependency can be used to make the missing file.
-
-
    Function to implement custom dependency, traditional method:
-       The  function  that implements a custom dependency gets the information
+       The function that implements a custom dependency gets  the  information
        on the files to be processed in two ways.  The first is through its one
-       argument;  the argument contains the base name of the source and desti-
+       argument; the argument contains the base name of the source and  desti-
        nation files.  The second way is described later.
 
-       A simple and typical example of code in an initialization rcfile  using
+       A  simple and typical example of code in an initialization rcfile using
        the first method is:
 
            add_cus_dep( 'fig', 'eps', 0, 'fig2eps' );
@@ -3528,92 +3714,92 @@
                system( "fig2dev -Leps \"$_[0].fig\" \"$_[0].eps\"" );
            }
 
-       The  first  line  adds  a  custom  dependency that converts a file with
-       extension "fig", as created by the xfig  program,  to  an  encapsulated
-       postscript  file,  with  extension "eps".  The remaining lines define a
-       subroutine that carries out the conversion.  If a rule  for  converting
-       "fig"  to  "eps"  files already exists (e.g., from a previously read-in
-       initialization file), the latexmk will delete this rule  before  making
+       The first line adds a custom  dependency  that  converts  a  file  with
+       extension  "fig",  as  created  by the xfig program, to an encapsulated
+       postscript file, with extension "eps".  The remaining  lines  define  a
+       subroutine  that  carries out the conversion.  If a rule for converting
+       "fig" to "eps" files already exists (e.g., from  a  previously  read-in
+       initialization  file),  the latexmk will delete this rule before making
        the new one.
 
-       Suppose  latexmk  is  using this rule to convert a file "figure.fig" to
-       "figure.eps".  Then it will invoke the fig2eps  subroutine  defined  in
-       the  above  code with a single argument "figure", which is the basename
-       of each of the files (possibly with a path component).   This  argument
-       is  referred to by Perl as $_[0].  In the example above, the subroutine
+       Suppose latexmk is using this rule to convert a  file  "figure.fig"  to
+       "figure.eps".   Then  it  will invoke the fig2eps subroutine defined in
+       the above code with a single argument "figure", which is  the  basename
+       of  each  of the files (possibly with a path component).  This argument
+       is referred to by Perl as $_[0].  In the example above, the  subroutine
        uses the Perl command system to invoke the program fig2dev.  The double
        quotes around the string are a Perl idiom that signify that each string
-       of the form of a variable name, $_[0] in this case, is  to  be  substi-
+       of  the  form  of a variable name, $_[0] in this case, is to be substi-
        tuted by its value.
 
-       If  the  return  value of the subroutine is non-zero, then latexmk will
-       assume an error occurred during the execution of  the  subroutine.   In
-       the  above  example, no explicit return value is given, and instead the
-       return value is the value returned by the last  (and  only)  statement,
+       If the return value of the subroutine is non-zero,  then  latexmk  will
+       assume  an  error  occurred during the execution of the subroutine.  In
+       the above example, no explicit return value is given, and  instead  the
+       return  value  is  the value returned by the last (and only) statement,
        i.e., the invocation of system, which returns the value 0 on success.
 
-       If  you use pdflatex instead of latex, then you will probably prefer to
-       convert your graphics files to pdf format,  in  which  case  you  would
+       If you use pdflatex instead of latex, then you will probably prefer  to
+       convert  your  graphics  files  to  pdf format, in which case you would
        replace the above code in an initialization file by
 
+           add_cus_dep( 'fig', 'pdf, 0, 'fig2pdf' );
+           sub fig2pdf {
+               system( "fig2dev -Lpdf \"$_[0].fig\" \"$_[0].pdf\"" );
+           }
 
+       Note 1: In the command lines given in the system commands in the  above
+       examples,  double  quotes  have  been  inserted  around  the file names
+       (implemented by '\"' in the Perl language).  They immunize the  running
+       of  the  program  against  special characters in filenames.  Very often
+       these quotes are not necessary, i.e., they can be omitted.  But  it  is
+       normally safer to keep them in.  Even though the rules for quoting vary
+       between operating systems, command  shells  and  individual  pieces  of
 
 
-                                 7 August 2018                              54
 
+                                25 October 2018                             57
 
 
 
 
+
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-           add_cus_dep( 'fig', 'pdf, 0, 'fig2pdf' );
-           sub fig2pdf {
-               system( "fig2dev -Lpdf \"$_[0].fig\" \"$_[0].pdf\"" );
-           }
-
-       Note  1: In the command lines given in the system commands in the above
-       examples, double quotes  have  been  inserted  around  the  file  names
-       (implemented  by '\"' in the Perl language).  They immunize the running
-       of the program against special characters  in  filenames.   Very  often
-       these  quotes  are not necessary, i.e., they can be omitted.  But it is
-       normally safer to keep them in.  Even though the rules for quoting vary
-       between  operating  systems,  command  shells  and individual pieces of
        software, the quotes in the above examples do not cause problems in the
        cases I have tested.
 
-       Note  2:  One  case in which the quotes are important is when the files
-       are in a subdirectory and your operating system is  Microsoft  Windows.
-       Then  the  separator character for directory components can be either a
-       forward slash '/' or Microsoft's more usual backward slash  '\'.   For-
-       ward  slashes  are  generated  by  latexmk, to maintain its sanity from
-       software like MiKTeX that mixes both directory  separators;  but  their
+       Note 2: One case in which the quotes are important is  when  the  files
+       are  in  a subdirectory and your operating system is Microsoft Windows.
+       Then the separator character for directory components can be  either  a
+       forward  slash  '/' or Microsoft's more usual backward slash '\'.  For-
+       ward slashes are generated by latexmk,  to  maintain  its  sanity  from
+       software  like  MiKTeX  that mixes both directory separators; but their
        correct use normally requires quoted filenames.  (See a log file from a
-       run of MiKTeX (at least in v. 2.9) for an example of the  use  of  both
+       run  of  MiKTeX  (at least in v. 2.9) for an example of the use of both
        directory separators.)
 
-       Note  3:  The subroutines implementing custom dependencies in the exam-
-       ples given just have  a  single  line  invoking  an  external  program.
-       That's  the usual situation.  But since the subroutines are in the Perl
-       language, you can implement much more  complicated  processing  if  you
+       Note 3: The subroutines implementing custom dependencies in  the  exam-
+       ples  given  just  have  a  single  line  invoking an external program.
+       That's the usual situation.  But since the subroutines are in the  Perl
+       language,  you  can  implement  much more complicated processing if you
        need it.
 
 
    Removing custom dependencies, and when you might need to do this:
-       If  you  have some general custom dependencies defined in the system or
-       user initialization file, you may find that for  a  particular  project
-       they  are  undesirable.  So you might want to delete the unneeded ones.
-       A situation where this would be desirable is where there  are  multiple
-       custom  dependencies with the same from-extension or the same to-exten-
-       sion. In that case, latexmk might choose a different one from  the  one
+       If you have some general custom dependencies defined in the  system  or
+       user  initialization  file,  you may find that for a particular project
+       they are undesirable.  So you might want to delete the  unneeded  ones.
+       A  situation  where this would be desirable is where there are multiple
+       custom dependencies with the same from-extension or the same  to-exten-
+       sion.  In  that case, latexmk might choose a different one from the one
        you want for a specific project.  As an example, to remove any "fig" to
        "eps" rule you would use:
 
            remove_cus_dep( 'fig', 'eps' );
 
-       If you have complicated sets of custom dependencies, you  may  want  to
-       get  a  listing  of the custom dependencies.  This is done by using the
+       If  you  have  complicated sets of custom dependencies, you may want to
+       get a listing of the custom dependencies.  This is done  by  using  the
        line
 
            show_cus_dep();
@@ -3621,11 +3807,23 @@
        in an initialization file.
 
 
+   Function implementing custom dependency, alternative methods:
+       So far the examples for functions to implement custom dependencies have
+       used the argument of the function to specify the base name of converted
+       file.   This  method  has  been  available  since  very old versions of
+       latexmk, and many examples can be found, e.g., on the web.
 
+       However in later versions of latexmk  the  internal  structure  of  the
+       implementation  of  its  "rules" for the steps of processing, including
+       custom dependencies, became much more powerful.   The  function  imple-
+       menting  a custom dependency is executed within a special context where
+       a number of extra variables and subroutines are defined.  Publicly doc-
+       umented  ones, intended to be long-term stable, are listed below, under
+       the heading "Variables and subroutines for processing a rule".
 
 
 
-                                 7 August 2018                              55
+                                25 October 2018                             58
 
 
 
@@ -3634,32 +3832,18 @@
 LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-   Function implementing custom dependency, alternative methods:
-       So far the examples for functions to implement custom dependencies have
-       used the argument of the function to specify the base name of converted
-       file.  This method has  been  available  since  very  old  versions  of
-       latexmk, and many examples can be found, e.g., on the web.
-
-       However  in  later  versions  of  latexmk the internal structure of the
-       implementation of its "rules" for the steps  of  processing,  including
-       custom  dependencies,  became  much more powerful.  The function imple-
-       menting a custom dependency is executed within a special context  where
-       a number of extra variables and subroutines are defined.  Publicly doc-
-       umented ones, intended to be long-term stable, are listed below,  under
-       the heading "Variables and subroutines for processing a rule".
-
-       Examples  of  their  use is given in the following examples, concerning
+       Examples of their use is given in the  following  examples,  concerning
        multiple index files and glossaries.
 
-       The only index-file conversion built-in to latexmk is  from  an  ".idx"
-       file  written on one run of latex/pdflatex to an ".ind" file to be read
-       in on a subsequent run.  But with the index.sty package,  for  example,
-       you  can  create  extra  indexes  with  extensions  that you configure.
+       The  only  index-file  conversion built-in to latexmk is from an ".idx"
+       file written on one run of latex/pdflatex to an ".ind" file to be  read
+       in  on  a subsequent run.  But with the index.sty package, for example,
+       you can create  extra  indexes  with  extensions  that  you  configure.
        Latexmk does not know how to deduce the extensions from the information
-       it  has.  But you can easily write a custom dependency.  For example if
-       your latex file uses the command  "\newindex{special}{ndx}{nnd}{Special
-       index}"  you  will need to get latexmk to convert files with the exten-
-       sion .ndx to .nnd.  The most elementary method is to  define  a  custom
+       it has.  But you can easily write a custom dependency.  For example  if
+       your  latex file uses the command "\newindex{special}{ndx}{nnd}{Special
+       index}" you will need to get latexmk to convert files with  the  exten-
+       sion  .ndx  to  .nnd.  The most elementary method is to define a custom
        dependency as follows:
 
            add_cus_dep( 'ndx', 'nnd', 0, 'ndx2nnd' );
@@ -3668,14 +3852,14 @@
            }
            push @generated_exts, 'ndx', 'nnd';
 
-       Notice  the  added line compared with earlier examples.  The extra line
+       Notice the added line compared with earlier examples.  The  extra  line
        gets the extensions "ndx" and "nnd" added to the list of extensions for
        generated files; then the extra index files will be deleted by clean-up
        operations
 
-       But if you have yet more indexes with yet different  extensions,  e.g.,
-       "adx"  and  "and", then you will need a separate function for each pair
-       of extensions.  This is quite annoying.   You  can  use  the  Run_subst
+       But  if  you have yet more indexes with yet different extensions, e.g.,
+       "adx" and "and", then you will need a separate function for  each  pair
+       of  extensions.   This  is  quite  annoying.  You can use the Run_subst
        function to simplify the definitions to use a single function:
 
            add_cus_dep( 'ndx', 'nnd', 0, 'dx2nd' );
@@ -3688,55 +3872,55 @@
        You could also instead use
 
            add_cus_dep( 'ndx', 'nnd', 0, 'dx2nd' );
+           add_cus_dep( 'adx', 'and', 0, 'dx2nd' );
+           sub dx2nd {
+               return Run_subst( $makeindex );
+           }
+           push @generated_exts, 'ndx', 'nnd', 'adx', 'and';
 
+       This last example uses the command specification in $makeindex, and  so
+       any  customization you have made for the standard index also applies to
+       your extra indexes.
 
+       Similar techniques can be applied for glossaries.
 
-                                 7 August 2018                              56
+       Those of you with experience with Makefiles, may get concerned that the
+       .ndx file is written during a run of latex/pdflatex and is always later
 
 
 
+                                25 October 2018                             59
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-           add_cus_dep( 'adx', 'and', 0, 'dx2nd' );
-           sub dx2nd {
-               return Run_subst( $makeindex );
-           }
-           push @generated_exts, 'ndx', 'nnd', 'adx', 'and';
 
-       This  last example uses the command specification in $makeindex, and so
-       any customization you have made for the standard index also applies  to
-       your extra indexes.
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
-       Similar techniques can be applied for glossaries.
 
-       Those of you with experience with Makefiles, may get concerned that the
-       .ndx file is written during a run of latex/pdflatex and is always later
-       than  the  .nnd  last read in.  Thus the .nnd appears to be perpetually
-       out-of-date.  This situation, of circular dependencies, is  endemic  to
+       than the .nnd last read in.  Thus the .nnd appears  to  be  perpetually
+       out-of-date.   This  situation, of circular dependencies, is endemic to
        latex, and is one of the issues that latexmk is programmed to overcome.
-       It examines the contents of the files (by use of a checksum), and  only
+       It  examines the contents of the files (by use of a checksum), and only
        does a remake when the file contents have actually changed.
 
-       Of  course  if you choose to write random data to the .nnd (or the .aux
-       file, etc) that changes on each new run, then you will have a  problem.
-       For  real experts: See the %hash_cal_ignore_pattern if you have to deal
+       Of course if you choose to write random data to the .nnd (or  the  .aux
+       file,  etc) that changes on each new run, then you will have a problem.
+       For real experts: See the %hash_cal_ignore_pattern if you have to  deal
        with such problems.
 
 
    Old Method of Defining Custom Dependencies:
-       In much older versions of latexmk, the only method of  defining  custom
-       dependencies  was  to directly manipulate the table of custom dependen-
+       In  much  older versions of latexmk, the only method of defining custom
+       dependencies was to directly manipulate the table of  custom  dependen-
        cies.  This is contained in the @cus_dep_list array.  It is an array of
-       strings,  and each string in the array has four items in it, each sepa-
-       rated by a space, the  from-extension,  the  to-extension,  the  "must"
-       item,  and the name of the subroutine for the custom dependency.  These
+       strings, and each string in the array has four items in it, each  sepa-
+       rated  by  a  space,  the  from-extension, the to-extension, the "must"
+       item, and the name of the subroutine for the custom dependency.   These
        were all defined above.
 
        An example of the old method of defining custom dependencies is as fol-
-       lows.  It  is  the code in an RC file to ensure automatic conversion of
+       lows. It is the code in an RC file to ensure  automatic  conversion  of
        .fig files to .eps files:
 
            push @cus_dep_list, "fig eps 0 fig2eps";
@@ -3744,56 +3928,56 @@
                return system( "fig2dev -Lps \"$_[0].fig\" \"$_[0].eps\"" );
            }
 
-       This method still works, and is almost equivalent  to  the  code  given
-       earlier  that used the add_cus_dep subroutine.  However, the old method
-       doesn't delete any previous custom-dependency for the same  conversion.
+       This  method  still  works,  and is almost equivalent to the code given
+       earlier that used the add_cus_dep subroutine.  However, the old  method
+       doesn't  delete any previous custom-dependency for the same conversion.
        So the new method is preferable.
 
 
 
 ADVANCED CONFIGURATION: Some extra resources and advanced tricks
-       For  most purposes, simple configuration for latexmk along the lines of
-       the examples given is sufficient.  But  sometimes  you  need  something
+       For most purposes, simple configuration for latexmk along the lines  of
+       the  examples  given  is  sufficient.  But sometimes you need something
+       harder.  In this section, I indicate some extra possibilities.   Gener-
+       ally  to  use  these, you need to be fluent in the Perl language, since
+       this is what is used in the rc files.
 
+       See also the section DEALING WITH ERRORS, PROBLEMS, ETC.  See also  the
+       examples in the directory example_rcfiles in the latexmk distributions.
+       Even if none of the examples apply to your case, they may give you use-
+       ful ideas
 
 
-                                 7 August 2018                              57
+   Variables and subroutines for processing a rule
+       A step in the processing is called a rule. One possibility to implement
+       the processing of a rule is by a Perl subroutine.  This is  always  the
+       case  for  custom dependencies. Also, for any other rule, you can use a
 
 
 
+                                25 October 2018                             60
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-       harder.   In this section, I indicate some extra possibilities.  Gener-
-       ally to use these, you need to be fluent in the  Perl  language,  since
-       this is what is used in the rc files.
 
-       See  also the section DEALING WITH ERRORS, PROBLEMS, ETC.  See also the
-       examples in the directory example_rcfiles in the latexmk distributions.
-       Even if none of the examples apply to your case, they may give you use-
-       ful ideas
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-   Variables and subroutines for processing a rule
-       A step in the processing is called a rule. One possibility to implement
-       the  processing  of a rule is by a Perl subroutine.  This is always the
-       case for custom dependencies. Also, for any other rule, you can  use  a
-       subroutine  by  prefixing the command specification by the word "inter-
+       subroutine by prefixing the command specification by the  word  "inter-
        nal" -- see the section FORMAT OF COMMAND SPECIFICATIONS.
 
-       When you use a subroutine for processing a rule, all the  possibilities
-       of  Perl  programming  are  available, of course.  In addition, some of
-       latexmk's internal variables and subroutines are available.   The  ones
-       listed  below  are  intended  to  be available to (advanced) users, and
+       When  you use a subroutine for processing a rule, all the possibilities
+       of Perl programming are available, of course.   In  addition,  some  of
+       latexmk's  internal  variables and subroutines are available.  The ones
+       listed below are intended to be  available  to  (advanced)  users,  and
        their specifications will generally have stability under upgrades. Gen-
-       erally,  the  variables  should be treated as read-only: Changing their
-       values can have bad consequences, since it is liable  to  mess  up  the
+       erally, the variables should be treated as  read-only:  Changing  their
+       values  can  have  bad  consequences, since it is liable to mess up the
        consistency of what latexmk is doing.
 
-       $rule  This  variable  has  the  name of the rule, as known to latexmk.
-              Note that the exact contents of this variable for a  given  rule
+       $rule  This variable has the name of the rule,  as  known  to  latexmk.
+              Note  that  the exact contents of this variable for a given rule
               may be dependent on the version of latexmk
 
        $$Psource
@@ -3801,51 +3985,51 @@
               dollar signs.
 
        $$Pdest
-              This gives the name of the main output file if  any.   Note  the
+              This  gives  the  name of the main output file if any.  Note the
               double dollar signs.
 
        rdb_ensure_file( $rule, file )
-              This  a subroutine that ensures that the given file is among the
+              This a subroutine that ensures that the given file is among  the
               source files for the specified rule.  It is typically used when,
-              during  the  processing of a rule, it is known that a particular
-              extra file is among the dependencies that latexmk  should  know,
+              during the processing of a rule, it is known that  a  particular
+              extra  file  is among the dependencies that latexmk should know,
               but its default methods don't find the dependency. Almost always
-              the first argument is the name of the rule currently being  pro-
+              the  first argument is the name of the rule currently being pro-
               cessed, so it is then appropriate to specify it by $rule.
 
-              For  examples of its use, see some of the files in the directory
-              example_rcfiles of latexmk's distribution.  Currently the  cases
-              that   use   this   subroutine   are  bib2gls-latexmkrc,  excel-
-              tex_latexmkrc and texinfo-latexmkrc.  These  illustrate  typical
-              cases  where latexmk's normal processing fails to detect certain
+              For examples of its use, see some of the files in the  directory
+              example_rcfiles  of latexmk's distribution.  Currently the cases
+              that  use  this   subroutine   are   bib2gls-latexmkrc,   excel-
+              tex_latexmkrc  and  texinfo-latexmkrc.  These illustrate typical
+              cases where latexmk's normal processing fails to detect  certain
               extra source files.
 
+       rdb_remove_files( $rule, file, ... )
+              This  subroutine  removes  one or more files from the dependency
+              list for the given rule.
 
+       rdb_list_source( $rule )
+              This subroutine returns the list  of  source  files  (i.e.,  the
+              dependency list) for the given rule.
 
+       rdb_set_source( $rule, file, ... )
 
-                                 7 August 2018                              58
+       rdb_set_source( $rule, @files )
+              This  subroutine  sets the dependency list for the given rule to
+              be the specified files.  Files that are already in the list have
+              unchanged  information.   Files  that  were  not in the list are
 
 
 
+                                25 October 2018                             61
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-       rdb_remove_files( $rule, file, ... )
-              This subroutine removes one or more files  from  the  dependency
-              list for the given rule.
 
-       rdb_list_source( $rule )
-              This  subroutine  returns  the  list  of source files (i.e., the
-              dependency list) for the given rule.
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
-       rdb_set_source( $rule, file, ... )
 
-       rdb_set_source( $rule, @files )
-              This subroutine sets the dependency list for the given  rule  to
-              be the specified files.  Files that are already in the list have
-              unchanged information.  Files that were  not  in  the  list  are
               added to it.  Files in the previous dependency list that are not
               in the newly specified list of files are removed from the depen-
               dency list.
@@ -3852,63 +4036,91 @@
 
        Run_subst( command_spec )
               This subroutine runs the command specified by command_spec.  The
-              specification is a string in the format listed  in  the  section
-              "Format  of Command Specifications".  An important action of the
+              specification  is  a  string in the format listed in the section
+              "Format of Command Specifications".  An important action of  the
               Run_subst is to make substitutions of placeholders, e.g., %S and
-              %D  for  source  and  destination  files;  these get substituted
-              before the command is run.  In addition, the command after  sub-
-              stitution  is printed to the screen unless latexmk is running in
+              %D for source  and  destination  files;  these  get  substituted
+              before  the command is run.  In addition, the command after sub-
+              stitution is printed to the screen unless latexmk is running  in
               silent mode.
 
 
+   Coordinated Setting of Commands for *latex
+       To  set  all  of $latex, $pdflatex, $lualatex, and $xelatex to a common
+       pattern, you can use one of the  following  subroutines,  std_tex_cmds,
+       alt_tex_cmds, and set_tex_cmds.
+
+       They work as follows
+
+          &std_tex_cmds;
+
+       This  results  in  $latex = 'latex %O %S', and similarly for $pdflatex,
+       $lualatex, and $xelatex.  Note the ampersand in  the  invocation;  this
+       indicates to Perl that a subroutine is being called.
+
+          &alt_tex_cmds;
+
+       This  results  in  $latex = 'latex %O %P', and similarly for $pdflatex,
+       $lualatex, and $xelatex.  Note the ampersand in  the  invocation;  this
+       indicates to Perl that a subroutine is being called.
+
+         set_tex_cmds( CMD_SPEC );
+
+       Here  CMD_SPEC  is  the  command  line  without  the program name. This
+       results in $latex = 'CMD_SPEC', and similarly for $pdflatex, $lualatex,
+       and $xelatex. An example would be
+
+         set_tex_cmds( '--interaction=batchmode %O %S' );
+
+
    Advanced configuration: Using latexmk with make
-       This section is targeted only at advanced users who use the  make  pro-
+       This  section  is targeted only at advanced users who use the make pro-
        gram for complex projects, as for software development, with the depen-
        dencies specified by a Makefile.
 
-       Now the basic task of latexmk is to run  the  appropriate  programs  to
-       make  a  viewable version of a LaTeX document.  However, the usual make
-       program is not suited to this purpose for at least two reasons.   First
+       Now  the  basic  task  of latexmk is to run the appropriate programs to
+       make a viewable version of a LaTeX document.  However, the  usual  make
+       program  is not suited to this purpose for at least two reasons.  First
        is that the use of LaTeX involves circular dependencies (e.g., via .aux
        files), and these cannot be handled by the standard make program.  Sec-
-       ond  is  that  in  a  large document the set of source files can change
-       quite frequently, particularly with included graphics  files;  in  this
-       situation  keeping  a  Makefile  manually  updated is inappropriate and
-       error-prone, especially when the dependencies can be  determined  auto-
-       matically.  Latexmk solves both of these problems robustly.
+       ond is that in a large document the set  of  source  files  can  change
 
-       Thus  for  many  standard LaTeX documents latexmk can be used by itself
-       without the make program.  In a complex project it simply needs  to  be
-       suitably  configured.  A standard configuration would be to define cus-
-       tom dependencies to make graphics files from their source files  (e.g.,
-       as  created  by  the  xfig program).  Custom dependencies are latexmk's
-       equivalent of pattern rules in Makefiles.
 
-       Nevertheless there are projects for which a  Makefile  is  appropriate,
-       and it is useful to know how to use latexmk from a Makefile.  A typical
 
+                                25 October 2018                             62
 
 
-                                 7 August 2018                              59
 
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+       quite  frequently,  particularly  with included graphics files; in this
+       situation keeping a Makefile  manually  updated  is  inappropriate  and
+       error-prone,  especially  when the dependencies can be determined auto-
+       matically.  Latexmk solves both of these problems robustly.
 
+       Thus for many standard LaTeX documents latexmk can be  used  by  itself
+       without  the  make program.  In a complex project it simply needs to be
+       suitably configured.  A standard configuration would be to define  cus-
+       tom  dependencies to make graphics files from their source files (e.g.,
+       as created by the xfig program).   Custom  dependencies  are  latexmk's
+       equivalent of pattern rules in Makefiles.
 
-       example would be to generate  documentation  for  a  software  project.
-       Potentially  the interaction with the rest of the rules in the Makefile
+       Nevertheless  there  are  projects for which a Makefile is appropriate,
+       and it is useful to know how to use latexmk from a Makefile.  A typical
+       example  would  be  to  generate  documentation for a software project.
+       Potentially the interaction with the rest of the rules in the  Makefile
        could be quite complicated, for example if some of the source files for
        a LaTeX document are generated by the project's software.
 
        In this section, I give a couple of examples of how latexmk can be use-
-       fully invoked from a Makefile.  The examples use specific  features  of
-       current  versions  of  GNU make, which is the default on both linux and
+       fully  invoked  from a Makefile.  The examples use specific features of
+       current versions of GNU make, which is the default on  both  linux  and
        OS-X systems.  They may need modifications for other versions of make.
 
-       The simplest method is simply to delegate all  the  relevant  tasks  to
+       The  simplest  method  is  simply to delegate all the relevant tasks to
        latexmk, as is suitable for a straightforward LaTeX document.  For this
        a suitable Makefile is like
 
@@ -3917,53 +4129,53 @@
            %.pdf : %.tex FORCE_MAKE
                latexmk -pdf -dvi- -ps- $<
 
-       (Note: the last line must be introduced by a tab for  the  Makefile  to
-       function  correctly!)  Naturally, if making try.pdf from its associated
-       LaTeX file try.tex were the only task to be performed, a direct use  of
-       latexmk  without  a  Makefile would normally be better.  The benefit of
-       using a Makefile for a LaTeX document would be  in  a  larger  project,
+       (Note:  the  last  line must be introduced by a tab for the Makefile to
+       function correctly!)  Naturally, if making try.pdf from its  associated
+       LaTeX  file try.tex were the only task to be performed, a direct use of
+       latexmk without a Makefile would normally be better.   The  benefit  of
+       using  a  Makefile  for  a LaTeX document would be in a larger project,
        where lines such as the above would be only be a small part of a larger
        Makefile.
 
        The above example has a pattern rule for making a .pdf file from a .tex
-       file,  and it is defined to use latexmk in the obvious way.  There is a
+       file, and it is defined to use latexmk in the obvious way.  There is  a
        conventional  default  target  named  "all",  with  a  prerequisite  of
-       try.pdf.   So  when  make is invoked, by default it makes try.pdf.  The
-       only complication is  that  there  may  be  many  source  files  beyond
+       try.pdf.  So when make is invoked, by default it  makes  try.pdf.   The
+       only  complication  is  that  there  may  be  many  source files beyond
        try.tex, but these aren't specified in the Makefile, so changes in them
-       will not by themselves cause latexmk to be invoked.  Instead, the  pat-
-       tern  rule is equipped with a "phony" prerequisite FORCE_MAKE; this has
-       the effect of causing the  rule  to  be  always  out-of-date,  so  that
-       latexmk  is  always run.  It is latexmk that decides whether any action
-       is needed, e.g., a rerun of pdflatex.  Effectively the  Makefile  dele-
+       will  not by themselves cause latexmk to be invoked.  Instead, the pat-
+       tern rule is equipped with a "phony" prerequisite FORCE_MAKE; this  has
+       the  effect  of  causing  the  rule  to  be always out-of-date, so that
+       latexmk is always run.  It is latexmk that decides whether  any  action
+       is  needed,  e.g., a rerun of pdflatex.  Effectively the Makefile dele-
        gates all decisions to latexmk, while make has no knowledge of the list
-       of source files except for primary LaTeX file for  the   document.   If
-       there  are,  for example, graphics files to be made, these must be made
-       by custom dependencies configured in latexmk.
+       of  source  files  except for primary LaTeX file for the  document.  If
 
-       But something better is needed  in  more  complicated  situations,  for
-       example,  when  the  making  of graphics files needs to be specified by
-       rules in the Makefile.  To do this, one can use  a  Makefile  like  the
-       following:
 
-            TARGETS = document1.pdf document2.pdf
-            DEPS_DIR = .deps
-            LATEXMK = latexmk -recorder -use-make -deps \
-                  -e 'warn qq(In Makefile, turn off custom dependencies\n);' \
-                  -e '@cus_dep_list = ();' \
-                  -e 'show_cus_dep();'
 
+                                25 October 2018                             63
 
 
-                                 7 August 2018                              60
 
 
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+       there are, for example, graphics files to be made, these must  be  made
+       by custom dependencies configured in latexmk.
 
+       But  something  better  is  needed  in more complicated situations, for
+       example, when the making of graphics files needs  to  be  specified  by
+       rules  in  the  Makefile.   To do this, one can use a Makefile like the
+       following:
 
+            TARGETS = document1.pdf document2.pdf
+            DEPS_DIR = .deps
+            LATEXMK = latexmk -recorder -use-make -deps \
+                  -e 'warn qq(In Makefile, turn off custom dependencies\n);' \
+                  -e '@cus_dep_list = ();' \
+                  -e 'show_cus_dep();'
             all : $(TARGETS)
             $(foreach file,$(TARGETS),$(eval -include $(DEPS_DIR)/$(file)P))
             $(DEPS_DIR) :
@@ -3974,86 +4186,86 @@
             %.pdf : %.fig
                    fig2dev -Lpdf $< $@
 
-       (Again,  the  lines  containing  the  commands  for the rules should be
+       (Again, the lines containing the  commands  for  the  rules  should  be
        started with tabs.)  This example was inspired by how GNU automake han-
        dles automatic dependency tracking of C source files.
 
-       After  each  run of latexmk, dependency information is put in a file in
-       the .deps subdirectory.  The Makefile causes these dependency files  to
+       After each run of latexmk, dependency information is put in a  file  in
+       the  .deps subdirectory.  The Makefile causes these dependency files to
        be read by make, which now has the full dependency information for each
-       target .pdf file.  To make things less trivial it  is  specificed  that
-       two  files document1.pdf and document2.pdf are the targets.  The depen-
+       target  .pdf  file.   To make things less trivial it is specificed that
+       two files document1.pdf and document2.pdf are the targets.  The  depen-
        dency files are .deps/document1.pdfP and .deps/document2.pdfP.
 
-       There is now no need for the phony prerequisite for the  rule  to  make
+       There  is  now  no need for the phony prerequisite for the rule to make
        .pdf files from .tex files.  But I have added a rule to make .pdf files
-       from .fig files produced by the xfig program; these are  commonly  used
-       for  graphics  insertions  in  LaTeX documents.  Latexmk is arranged to
-       output a dependency file after each run.  It  is  given  the  -recorder
+       from  .fig  files produced by the xfig program; these are commonly used
+       for graphics insertions in LaTeX documents.   Latexmk  is  arranged  to
+       output  a  dependency  file  after each run.  It is given the -recorder
        option, which improves its detection of files generated during a run of
-       pdflatex; such files should not be in  the  dependency  list.   The  -e
-       options  are  used to turn off all custom dependencies, and to document
-       this.  Instead the -use-make is used to delegate the making of  missing
+       pdflatex;  such  files  should  not  be in the dependency list.  The -e
+       options are used to turn off all custom dependencies, and  to  document
+       this.   Instead the -use-make is used to delegate the making of missing
        files to make itself.
 
-       Suppose  in  the LaTeX file there is a command \includegraphics{graph},
-       and an xfig file "graph.fig" exists.  On a first run, pdflatex  reports
-       a  missing  file, named "graph". Latexmk succeeds in making "graph.pdf"
+       Suppose in the LaTeX file there is a  command  \includegraphics{graph},
+       and  an xfig file "graph.fig" exists.  On a first run, pdflatex reports
+       a missing file, named "graph". Latexmk succeeds in  making  "graph.pdf"
        by calling "make graph.pdf", and after completion of its work, it lists
        "fig.pdf" among the dependents of the file latexmk is making.  Then let
-       "fig.fig" be updated, and then let make be  run.   Make  first  remakes
+       "fig.fig"  be  updated,  and  then let make be run.  Make first remakes
        "fig.pdf", and only then reruns latexmk.
 
-       Thus  we  now  have  a method by which all the subsidiary processing is
-       delegated to make.
 
 
-SEE ALSO
-       latex(1), bibtex(1), lualatex(1), pdflatex(1), xelatex(1).
 
-BUGS
-       Sometimes a viewer (gv) tries to read an updated .ps or .pdf file after
-       its  creation is started but before the file is complete.  Work around:
-       manually refresh (or reopen) display.  Or use one of the other preview-
-       ers and update methods.
+                                25 October 2018                             64
 
-       (The   following   isn't   really  a  bug,  but  concerns  features  of
 
 
 
-                                 7 August 2018                              61
 
+LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
 
 
+       Thus we now have a method by which all  the  subsidiary  processing  is
+       delegated to make.
 
 
-LATEXMK(1)                  General Commands Manual                 LATEXMK(1)
+SEE ALSO
+       latex(1), bibtex(1), lualatex(1), pdflatex(1), xelatex(1).
 
+BUGS
+       Sometimes a viewer (gv) tries to read an updated .ps or .pdf file after
+       its creation is started but before the file is complete.  Work  around:
+       manually refresh (or reopen) display.  Or use one of the other preview-
+       ers and update methods.
 
-       previewers.)  Preview continuous mode only works perfectly with certain
-       previewers:  Xdvi  on UNIX/Linux works for dvi files.  Gv on UNIX/Linux
-       works for both postscript and pdf.  Ghostview  on  UNIX/Linux  needs  a
-       manual  update (reopen); it views postscript and pdf.  Gsview under MS-
-       Windows works for both postscript and pdf, but only reads  the  updated
-       file  when  its  screen  is refreshed.  Acroread under UNIX/Linux views
-       pdf, but the file needs to be closed and reopened to  view  an  updated
-       version.   Under  MS-Windows,  acroread locks its input file and so the
-       pdf file cannot be updated.  (Remedy: configure latexmk  to  use  suma-
+       (The following isn't really a bug, but concerns  features  of  preview-
+       ers.)   Preview  continuous mode only works perfectly with certain pre-
+       viewers: Xdvi on UNIX/Linux works for  dvi  files.   Gv  on  UNIX/Linux
+       works  for  both  postscript  and pdf.  Ghostview on UNIX/Linux needs a
+       manual update (reopen); it views postscript and pdf.  Gsview under  MS-
+       Windows  works  for both postscript and pdf, but only reads the updated
+       file when its screen is refreshed.   Acroread  under  UNIX/Linux  views
+       pdf,  but  the  file needs to be closed and reopened to view an updated
+       version.  Under MS-Windows, acroread locks its input file  and  so  the
+       pdf  file  cannot  be updated.  (Remedy: configure latexmk to use suma-
        trapdf instead.)
 
 THANKS TO
-       Authors  of  previous  versions.   Many  users with their feedback, and
-       especially David Coppit (username david at node  coppit.org)  who  made
-       many  useful  suggestions  that  contributed  to version 3, and Herbert
-       Schulz.  (Please note that the e-mail  addresses  are  not  written  in
+       Authors of previous versions.  Many  users  with  their  feedback,  and
+       especially  David  Coppit  (username david at node coppit.org) who made
+       many useful suggestions that contributed  to  version  3,  and  Herbert
+       Schulz.   (Please  note  that  the  e-mail addresses are not written in
        their standard form to avoid being harvested too easily.)
 
 AUTHOR
-       Current  version,  by  John  Collins  (username  jcc8 at node psu.edu).
-       (Version 4.59).
+       Current version, by John  Collins  (username  jcc8  at  node  psu.edu).
+       (Version 4.61).
 
-       Released     version     can      be      obtained      from      CTAN:
-       <http://www.ctan.org/pkg/latexmk/>,   and  from  the  author's  website
+       Released      version      can      be      obtained     from     CTAN:
+       <http://www.ctan.org/pkg/latexmk/>,  and  from  the  author's   website
        <http://www.personal.psu.edu/jcc8/latexmk/>.
        Modifications and enhancements by Evan McLean (Version 2.0)
        Original script called "go" by David J. Musliner (RCS Version 3.2)
@@ -4073,20 +4285,6 @@
 
 
 
+                                25 October 2018                             65
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-                                 7 August 2018                              62
-
-

Modified: trunk/Master/texmf-dist/scripts/latexmk/latexmk.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/latexmk/latexmk.pl	2018-10-25 21:34:47 UTC (rev 48991)
+++ trunk/Master/texmf-dist/scripts/latexmk/latexmk.pl	2018-10-25 21:35:08 UTC (rev 48992)
@@ -121,8 +121,8 @@
 
 $my_name = 'latexmk';
 $My_name = 'Latexmk';
-$version_num = '4.59';
-$version_details = "$My_name, John Collins, 7 August 2018";
+$version_num = '4.61';
+$version_details = "$My_name, John Collins, 25 October 2018";
 
 use Config;
 use File::Basename;
@@ -222,7 +222,27 @@
 ##
 ## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
 ##
-##  7 Aug 2018 John Collins  V. 4.59
+## 25 Oct 2018 John Collins  Fix definition of clean up substitution for %R
+##                             so that something with intermediate %R works,
+##                             as in 'pythontex-files-%R/*'.
+## 24 Oct 2018 John Collins  V. 4.61
+## 16 Oct 2018 John Collins  Routines for setting all of $latex, etc.
+##                           Variables, options, substitutable parameters
+##                             for executing code in *latex before inputting
+##                             source file.
+## 10 Oct 2018 John Collins  Fix problem that if biber gets a remote file,
+##                              it would be deleted and latexmk would report
+##                              it as missing, incorrectly.
+##  8 Oct 2018 John Collins  Report count of warnings about missing characters
+##                             (typically unavailable Unicode characters).
+##                             Messages about this may appear only in the .log
+##                             file and are therefore easily missed by the user.
+##                           V. 4.60a
+## 21 Sep 2018 John Collins  Fix bug that --gg with --deps-file doesn't
+##                             create deps file.
+##  3 Sep 2018 John Collins  -pdfxelatex and -pdflualatex options
+##  3 Sep 2018 John Collins  V. 4.60
+##  7 Aug 2018 John Collins  V. 4.59  Released on CTAN
 ##  1 Aug 2018 John Collins  Correct sub rdb_find_source_file.
 ## 30 Jul 2018 John Collins  Change handling of warnings for a difference 
 ##                             between actual and expected output filenames
@@ -363,18 +383,18 @@
 ## "" means not determined. Obtain from first line of .log file.
 $tex_distribution = '';
 
-## Commands to invoke latex, pdflatex, etc
-$latex  = 'latex %O %S';
-$pdflatex = 'pdflatex %O %S';
-$lualatex = 'lualatex %O %S';
-# Note that xelatex is used to give xdv file, not pdf file, hence the -no-pdf option.
-# See also setting of $xelatex_default_switches, which overcomes user mal-configuration
-$xelatex = 'xelatex -no-pdf %O %S';
+&std_tex_cmds;
 
+# Possible code to execute by *latex before inputting source file.
+# Not used by default.
+$pre_tex_code = '';
+
 ## Default switches:
 $latex_default_switches = '';
 $pdflatex_default_switches = '';
 $lualatex_default_switches = '';
+    # Note that xelatex is used to give xdv file, not pdf file, hence 
+    # we need the -no-pdf option.
 $xelatex_default_switches = '-no-pdf';
 
 ## Switch(es) to make them silent:
@@ -1245,6 +1265,7 @@
 $reference_changed = 0;
 $mult_defined = 0;
 $bad_reference = 0;
+$bad_character = 0;
 $bad_citation = 0;
 @primary_warning_summary = ();
 
@@ -1701,6 +1722,7 @@
   elsif (/^-pdf-$/)  { $pdf_mode = 0; }
   elsif (/^-pdfdvi$/){ $pdf_mode = 3; }
   elsif (/^-pdflua$/){ $pdf_mode = 4; }
+  elsif (/^-pdfps$/) { $pdf_mode = 2; }
   elsif (/^-pdfxe$/) { $pdf_mode = 5; }
 #  elsif (/^-pdflatex$/) {
 #      $pdflatex = "pdflatex %O %S";
@@ -1710,7 +1732,15 @@
   elsif (/^-pdflatex=(.*)$/) {
       $pdflatex = $1;
   }
-  elsif (/^-pdfps$/) { $pdf_mode = 2; }
+  elsif (/^-pdflualatex=(.*)$/) {
+      $lualatex = $1;
+  }
+  elsif (/^-pdfxelatex=(.*)$/) {
+      $xelatex = $1;
+  }
+  elsif (/^-pretex=(.*)$/) {
+      $pre_tex_code = $1;
+  }
   elsif (/^-print=(.*)$/) {
       $value = $1;
       if ( $value =~ /^dvi$|^ps$|^pdf$|^auto$/ ) {
@@ -1761,10 +1791,16 @@
      exit;
   }
   elsif (/^-silent$/ || /^-quiet$/ ){ $silent = 1; }
+  elsif (/^-stdtexcmds$/) { &std_tex_cmds; }
   elsif (/^-time$/) { $show_time = 1;}
   elsif (/^-time-$/) { $show_time = 0;}
   elsif (/^-use-make$/)  { $use_make_for_missing_files = 1; }
   elsif (/^-use-make-$/)  { $use_make_for_missing_files = 0; }
+  elsif (/^-usepretex$/) { &alt_tex_cmds; }
+  elsif (/^-usepretex=(.*)$/) {
+      &alt_tex_cmds;
+      $pre_tex_code = $1;
+  }
   elsif (/^-v$/ || /^-version$/)   { 
       print "\n$version_details. Version $version_num\n";
       exit;
@@ -2180,14 +2216,31 @@
     $deps_file = '-';
 }
 
+# Since deps_file is global (common to all processed files), we must
+# delete it here when doing a clean up, and not in the FILE loop, where
+# per-file processing (including clean-up) is done
+if ( ($cleanup_mode > 0) &&  $dependents_list && ( $deps_file ne '-' ) ) {
+    unlink_or_move( $deps_file );
+}
+
 # In non-pvc mode, the dependency list is global to all processed TeX files,
-# so we open a single file here, and add items to it after processing each file
-# But in -pvc mode, the dependency list should be written after round of
-# processing the single TeX file (as if each round were a separate run of
-# latexmk).  There's undoubtedly some non-optimal structuring here!
-if ( $dependents_list && ! $preview_continuous_mode ) {
+#   so we open a single file here, and add items to it after processing
+#   each file.  But in -pvc mode, the dependency list should be written
+#   after round of processing the single TeX file (as if each round were
+#   a separate run of latexmk).
+# If we are cleaning up ($cleanup_mode != 0) AND NOT continuing to
+#   make files (--gg option and $go_mode == 2), deps_file should not be
+#   created.
+# I will use definedness of $deps_handle as flag for global deps file having
+#   been opened and therefore being available to be written to after
+#   compiling a file.
+$deps_handle = undef;
+if ( $dependents_list
+     && ! $preview_continuous_mode
+     && ( ($cleanup_mode == 0) || ($go_mode == 2) )
+   ) {
     $deps_handle = new FileHandle "> $deps_file";
-    if (! defined $deps_handle ) {
+    if (! $deps_handle ) {
         die "Cannot open '$deps_file' for output of dependency information\n";
     }
 }
@@ -2399,9 +2452,6 @@
         unlink_or_move( 'texput.log', "texput.aux", "missfont.log",
                 keys %index_bibtex_generated, 
                 keys %aux_files );
-        if ( $dependents_list && ( $deps_file ne '-' ) ) {
-            unlink_or_move( $deps_file );
-        }
         if ($cleanup_includes_generated) {
             unlink_or_move( keys %other_generated );
         }
@@ -2530,7 +2580,7 @@
       rdb_for_some( [keys %one_time], \&rdb_run1 );
     }
     if ($#primary_warning_summary > -1) {
-	# N.B. $mult_defined, $bad_reference, $bad_citation also available here.
+	# N.B. $mult_defined, $bad_reference, $bad_character, $bad_citation also available here.
         if ($warnings_as_errors) {
             $failure = 1;
 	    $failure_msg = "Warning(s) from latex (or c.) for '$filename'; treated as error";
@@ -2614,6 +2664,22 @@
 #############################################################
 #############################################################
 
+sub set_tex_cmds {
+    # Usage, e.g., set_tex_cmds( '%O %S' )
+    my $args = $_[0];
+    foreach my $cmd ('latex', 'lualatex', 'pdflatex', 'xelatex' ) {
+	${$cmd} = "$cmd $args";
+    }
+    # N.B. See setting of $latex_default_switches, ...,
+    # $xelatex_default_switches, etc, for any special options needed.
+}
+
+sub std_tex_cmds { set_tex_cmds( '%O %S' ); }
+
+sub alt_tex_cmds { set_tex_cmds( '%O %P' ); }
+
+#========================
+
 sub test_fix_texnames {
     my $illegal_char = 0;
     my $unbalanced_quote = 0;
@@ -3512,7 +3578,9 @@
     my $dir = fix_pattern( shift );
     my $root_fixed = fix_pattern( $root_filename );
     foreach (@_) { 
-        (my $name = /%R/ ? $_ : "%R.$_") =~ s/%R/${dir}${root_fixed}/;
+        my $name = /%R/ ? $_ : "%R.$_";
+	$name =~ s/%R/${root_fixed}/;
+	$name = $dir.$name;
         unlink_or_move( my_glob( "$name" ) );
     }
 } #END cleanup1
@@ -3697,9 +3765,13 @@
   "   -pdfdvi - generate pdf by dvipdf\n",
   "   -pdflatex=<program> - set program used for pdflatex.\n",
   "                      (replace '<program>' by the program name)\n",
+  "   -pdflualatex=<program> - set program used for lualatex.\n",
+  "                      (replace '<program>' by the program name)\n",
   "   -pdfps - generate pdf by ps2pdf\n",
   "   -pdflua - generate pdf by lualatex\n",
   "   -pdfxe - generate pdf by xelatex\n",
+  "   -pdfxelatex=<program> - set program used for xelatex.\n",
+  "                      (replace '<program>' by the program name)\n",
   "   -pdf-  - turn off pdf\n",
   "   -ps    - generate postscript\n",
   "   -ps-   - turn off postscript\n",
@@ -3706,6 +3778,8 @@
   "   -pF <filter> - Filter to apply to postscript file\n",
   "   -p     - print document after generating postscript.\n",
   "            (Can also .dvi or .pdf files -- see documentation)\n",
+  "   -pretex=<TeX code> - Sets TeX code to be executed before inputting source\n",
+  "                    file, if commands suitable configured\n",    
   "   -print=dvi     - when file is to be printed, print the dvi file\n",
   "   -print=ps      - when file is to be printed, print the ps file (default)\n",
   "   -print=pdf     - when file is to be printed, print the pdf file\n",
@@ -3730,10 +3804,14 @@
   "   -showextraoptions  - Show other allowed options that are simply passed\n",
   "               as is to latex and pdflatex\n",
   "   -silent   - silence progress messages from called programs\n",
+  "   -stdtexcmds - Sets standard commands for *latex\n",    
   "   -time     - show CPU time used\n",
   "   -time-    - don't show CPU time used\n",
   "   -use-make - use the make program to try to make missing files\n",
   "   -use-make- - don't use the make program to try to make missing files\n",
+  "   -usepretex - Sets commands for *latex to use extra code before inputting\n",
+  "                source file\n",    
+  "   -usepretex=<TeX code> - Equivalent to -pretex=<TeX code> -usepretex\n",
   "   -v        - display program version\n",
   "   -verbose  - display usual progress messages from called programs\n",
   "   -version      - display program version\n",
@@ -3841,6 +3919,7 @@
     my $not_found_count = 0;
     my $control_file_missing = 0;
     my $control_file_malformed = 0;
+    my %remote = ();                # List of extensions of remote files
     while (<$log_file>) {
         if (/> WARN /) { 
             print "Biber warning: $_"; 
@@ -3872,13 +3951,34 @@
                 }
             }
         }
+        elsif ( /> INFO - Data source '([^']*)' is a remote BibTeX data source - fetching/
+	    ){
+	    my $spec = $1;
+            my ( $base, $path, $ext ) = fileparseA( $spec );
+            $remote{$ext} = 1;
+	}
         elsif ( /> INFO - Found .* '([^']+)'\s*$/
                 || /> INFO - Found '([^']+)'\s*$/
                 || /> INFO - Reading '([^']+)'\s*$/
                 || /> INFO - Processing .* file '([^']+)' .*$/
-              ) {
-            if ( defined $Pbiber_source ) {
-                push @$Pbiber_source, $1;
+	    ) {
+	    my $file = $1;
+            my ( $base, $path, $ext ) = fileparseA( $file );
+	    if ($remote{$ext} && ( $base =~ /^biber_remote_data_source/ ) && 1) {
+		# Ignore the file, which appears to be a temporary local copy
+		# of a remote file. Treating the file as a source file will
+		# be misleading, since it will normally have been deleted by
+		# biber itself.
+	    }
+            elsif ( (defined $Pbiber_source) && (-e $file) ) {
+		# Note that biber log file gives full path to file. (No search is
+		# needed to find it.)  The file must have existed when biber was
+		# run.  If it doesn't exist now, a few moments later, it must
+		# have gotten deleted, probably by biber (e.g., because it is a
+		# copy of a remote file).
+		# So I have included a condition above that the file must
+		# exist to be included in the source-file list.
+                push @$Pbiber_source, $file;
             }
         }
         elsif ( /> INFO - WARNINGS: ([\d]+)\s*$/ ) {
@@ -4155,6 +4255,7 @@
     $reference_changed = 0;
     $mult_defined = 0;
     $bad_reference = 0;
+    $bad_character = 0;
     $bad_citation = 0;
 
     my $log_file = new FileHandle;
@@ -4342,6 +4443,12 @@
             push @warning_list, $1;
             $bad_citation++;
         }
+        elsif ( /^Missing character: There is no /
+  	        || /^! Package inputenc Error: Unicode character /
+	        || /^! Bad character code /
+	    ) {
+            $bad_character++;
+        } 
         elsif ( /^Document Class: / ) {
             # Class sign-on line
             next LINE;
@@ -5652,7 +5759,7 @@
     local $pwd_latex = undef;     # Cwd as reported in fls file by (pdf)latex
 
     # The following are also returned, but are global, to be used by caller
-    # $reference_changed, $bad_reference $bad_citation, $mult_defined
+    # $reference_changed, $bad_reference, $bad_character, $bad_citation, $mult_defined
 
     # Do I have my own eps-to-pdf conversion?
     my $epspdf_cusdep = 0;
@@ -6672,7 +6779,7 @@
     rdb_write( $fdb_name );
 
     if ($#primary_warning_summary > -1) {
-	# N.B. $mult_defined, $bad_reference, $bad_citation also available here.
+	# N.B. $mult_defined, $bad_reference, $bad_character, $bad_citation also available here.
         show_array( "$My_name: Summary of warnings from last run of (pdf)latex:", 
                     @primary_warning_summary );
     }
@@ -7302,16 +7409,25 @@
     my $q = $quote_filenames ? '"' : '';
 
     my %subst = ( 
+       '%B' => $q.$base.$q,
+       '%D' => $q.$dest.$q,
        '%O' => $options,
+       '%S' => $q.$source.$q,
        '%R' => $q.$root_filename.$q,
-       '%B' => $q.$base.$q,
+       '%S' => $q.$source.$q,
        '%T' => $q.$texfile_name.$q,
-       '%S' => $q.$source.$q,
-       '%D' => $q.$dest.$q,
        '%Y' => $q.$aux_dir1.$q,
        '%Z' => $q.$out_dir1.$q,
        '%%' => '%'         # To allow literal %B, %R, etc, by %%B.
-    );
+	);
+    if ($pre_tex_code) {
+	$subst{'%U'} = $q.$pre_tex_code.$q;
+	$subst{'%P'} = "$q$pre_tex_code\\input{$source}$q";
+    }
+    else {
+	$subst{'%U'} = '';
+	$subst{'%P'} = $subst{'%S'};
+    }
     if ( ($^O eq "MSWin32" ) && $MSWin_back_slash ) {
         foreach ( '%R', '%B', '%T', '%S', '%D', '%Y', '%Z' ) {
             $subst{$_} =~ s(/)(\\)g;
@@ -7451,6 +7567,11 @@
         push @primary_warning_summary,
              "Latex found $mult_defined multiply defined reference(s)";
     }
+    if ($bad_character) {
+        push @primary_warning_summary,
+	    "=====Latex reported missing or unavailable character(s).\n".
+	    "=====See log file for details.";
+    }
     if ($bad_citation) {
         push @primary_warning_summary,
              "Latex failed to resolve $bad_citation citation(s)";



More information about the tex-live-commits mailing list