summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/latexmk/latexmk.pl408
-rw-r--r--Master/texmf-dist/doc/man/man1/latexmk.1138
-rw-r--r--Master/texmf-dist/doc/man/man1/latexmk.man1.pdfbin206548 -> 210300 bytes
-rw-r--r--Master/texmf-dist/doc/support/latexmk/CHANGES24
-rw-r--r--Master/texmf-dist/doc/support/latexmk/INSTALL10
-rw-r--r--Master/texmf-dist/doc/support/latexmk/README4
-rw-r--r--Master/texmf-dist/doc/support/latexmk/example_rcfiles/tikz-externalized-latexmkrc75
-rw-r--r--Master/texmf-dist/doc/support/latexmk/latexmk.pdfbin191173 -> 195352 bytes
-rw-r--r--Master/texmf-dist/doc/support/latexmk/latexmk.txt2978
-rwxr-xr-xMaster/texmf-dist/scripts/latexmk/latexmk.pl408
10 files changed, 2253 insertions, 1792 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl b/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
index 4f7aa737664..be8879adc80 100755
--- a/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
+++ b/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
@@ -121,12 +121,13 @@ use warnings;
$my_name = 'latexmk';
$My_name = 'Latexmk';
-$version_num = '4.56';
-$version_details = "$My_name, John Collins, 25 May 2018";
+$version_num = '4.59';
+$version_details = "$My_name, John Collins, 7 August 2018";
use Config;
use File::Basename;
use File::Copy;
+use File::Spec;
# If possible, use better glob, which does not use space as item separator.
# It's either File::Glob::bsd_glob or File::Glob::glob
@@ -219,58 +220,52 @@ else {
##
## Modification log from 9 Dec 2011 onwards in detail
##
-## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
+## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
##
-## 24,25 May 2018 John Collins Fix problem of .bib files not found with msys.
-## Add use of environment variable LATEXMKRCSYS
-## 12 May 2018 John Collins Simplify code in run_bibtex.
-## 3,9 May 2018 John Collins Improved diagnostics on mismatch of output filenames
-## 28,30 Apr 2018 John Collins Improve error messages for bib files not found
-## 26 Apr 2018 John Collins In testing for different expected and actual
-## output of primary run, normalize $$Pdest, to
-## avoid spurious warnings.
-## 4 Apr 2018 John Collins Version 4.56.
-## Get TeX disribution in .log file
-## Start on dealing with aux_dir and out_dir
-## that didn't get used as intended.
-## And on fls_file that didn't get made when expected.
-## Need to finish:
-## 15 Mar 2018 John Collins Version 4.55d.
-## In test for non-existent file in fls, don't give
-## warning.
-## Add corresponding test for files reported as
-## output that no longer exist.
-## (See minted package for cases where reported
-## input and output files don't exist at end of run.)
-## 15 Mar 2018 John Collins Version 4.55c.
-## Move test for non-existent file in fls to calling routine.
-## 15 Mar 2018 John Collins Deal with non-existent input files reported in
-## fls file. (Needed to work around bug in lualatex
-## in TeXLive 2016, 2017 and pretest 2018 (as of the
-## version of 2018 Mar 4).
-## 2 Feb 2018 John Collins Version 4.55b. Correct parsing of biber's log file.
-## 25 Jan 2018 John Collins Implement $warning_cmd
-## 24 Jan 2018 John Collins Version number to 4.55a. Implement warnings_as_errors option
-## 17 Jan 2018 John Collins Version number to 4.55. Ready for release.
-## Release v. 4.55 on CTAN.
-## 15, 16 Jan 2018 John Collins Correct bug in measuring filetime offset.
-## 14 Jan 2018 John Collins Correct issue with possible filetime offset
-## on remote file system.
-## Define defaults for configuration variables
-## that didn't have defaults.
-## 12 Jan 2018 John Collins Implement pvc timeout
-## 10 Jan 2018 John Collins Ensure $search_path_separator is defined.
-## Set it to MS-Win value for msys.
-## 12 Dec 2017 John Collins Further correct bsd_glob fudge (to be in subroutine my_glob)
-## 8 Dec 2017 John Collins Correct bsd_glob fudge
-## 2 Dec 2017 John Collins Fudge on bsd_glob if it doesn't exist
-## 20 Nov 2017 John Collins Ver. 4.54
+## 7 Aug 2018 John Collins V. 4.59
+## 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
+## for a run of a primary rule. Only give a
+## warning if the extensions differ.
+## In all other cases, there were significant
+## numbers of false positives and no true positives.
+## Improve providing of -no-pdf option to xelatex, to
+## ensure it's used even after a user redefinition
+## of $xelatex. Works if %O is in definition.
+## 25 Jul 2018 John Collins Clean up of code.
+## 24 Jul 2018 John Collins Fatal error when filename has initial '&'. This
+## is not allowed for TeX file, since TeX et al
+## treat the initial '&' as specifying the format.
+## 20,21,23 Jul 2018 John Collins Improve quoting in file-not-found messages
+## On MS-Win change \ to / on files on command line
+## 18,19 Jul 2018 John Collins Complete TEXINPUTS stuff
+## Fix reading of file database file when
+## custom dependency no longer exists.
+## 13,17 Jul 2018 John Collins Deal with double quotes in specified filename,
+## and filenames not allowed by TeX.
+## Illegal characters and unbalanced quotes give fatal error.
+## 10 Jul 2018 John Collins Use TEXINPUTS for finding source file for cus dep.
+## Version 4.58.
+## 21 Jun 2018 John Collins Version 4.57.
+## In get_checksum_md5, open file with mode :bytes,
+## to avoid error about malformed utf8 characters
+## that can happen if PERL_UNICODE is set.
+## 15 Jun 2018 John Collins Configuration to be able to turn off bibtex fudge.
+## 24,25 May 2018 John Collins Fix problem of .bib files not found with msys.
+## Add use of environment variable LATEXMKRCSYS
+## 12 May 2018 John Collins Simplify code in run_bibtex.
+## 3,9 May 2018 John Collins Improved diagnostics on mismatch of output filenames
+## 28,30 Apr 2018 John Collins Improve error messages for bib files not found
+## 26 Apr 2018 John Collins In testing for different expected and actual
+## output of primary run, normalize $$Pdest, to
+## avoid spurious warnings.
##
-## 1998-2017, John Collins. Many improvements and fixes.
-## See CHANGE-log.txt for full list, and CHANGES for summary
+## 1998-2018, John Collins. Many improvements and fixes.
+## See CHANGE-log.txt for full list, and CHANGES for summary
##
-## Modified by Evan McLean (no longer available for support)
-## Original script (RCS version 2.3) called "go" written by David J. Musliner
+## Modified by Evan McLean (no longer available for support)
+## Original script (RCS version 2.3) called "go" written by David J. Musliner
##
##-----------------------------------------------------------------------
@@ -313,6 +308,15 @@ $log_wrap = 79;
'! Unable to load picture or PDF file \\\'([^\\\']+)\\\'.',
);
+# Characters that we won't allow in the name of a TeX file.
+# Notes: Some are disallowed by TeX itself.
+# '\' results in TeX macro expansion
+# '$' results in possible variable substitution by kpsewhich called from tex.
+# '"' gets special treatment.
+# See subroutine test_fix_texnames and its call for their use.
+$illegal_in_texname = "\x00\t\f\n\r\$%\\~\x7F";
+
+
## Hash mapping file extension (w/o period, e.g., 'eps') to a single regexp,
# whose matching by a line in a file with that extension indicates that the
# line is to be ignored in the calculation of the hash number (md5 checksum)
@@ -363,14 +367,15 @@ $tex_distribution = '';
$latex = 'latex %O %S';
$pdflatex = 'pdflatex %O %S';
$lualatex = 'lualatex %O %S';
-# xelatex is used to give xdv file, not pdf file
+# 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';
## Default switches:
$latex_default_switches = '';
$pdflatex_default_switches = '';
$lualatex_default_switches = '';
-$xelatex_default_switches = '';
+$xelatex_default_switches = '-no-pdf';
## Switch(es) to make them silent:
$latex_silent_switch = '-interaction=batchmode';
@@ -542,6 +547,8 @@ foreach (
$biber = 'biber %O %B';
$bibtex = 'bibtex %O %B';
# Switch(es) to make biber & bibtex silent:
+$bibtex_fudge = 1; # Use hack to get bibtex working in old versions that
+ # don't handle output-directory.
$biber_silent_switch = '--onlylog';
$bibtex_silent_switch = '-terse';
$bibtex_use = 1; # Whether to actually run bibtex to update bbl files.
@@ -1876,10 +1883,6 @@ $out_dir_requested = $out_dir;
# 3 log file **not** in aux_dir or out_dir, but in cwd.
$where_log = -1;
-foreach ( 'BIBINPUTS', 'TEXINPUTS' ) {
- if ( exists $ENV{$_} ) { $ENV_ORIG{$_} = $ENV{$_}; }
-}
-
&set_dirs_etc;
if ($bibtex_use > 1) {
@@ -1999,20 +2002,19 @@ if ( ($jobname ne '') && ($num_files > 1) ) {
);
}
-
# Normalize the commands, to have place-holders for source, dest etc:
&fix_cmds;
# Add common options
-add_option( $latex_default_switches, \$latex );
+add_option( $latex_default_switches, \$latex );
add_option( $pdflatex_default_switches, \$pdflatex );
add_option( $lualatex_default_switches, \$lualatex );
-add_option( $xelatex_default_switches, \$xelatex );
+add_option( $xelatex_default_switches, \$xelatex );
-foreach (@extra_latex_options) { add_option( $_, \$latex ); }
+foreach (@extra_latex_options) { add_option( $_, \$latex ); }
foreach (@extra_pdflatex_options) { add_option( $_, \$pdflatex ); }
foreach (@extra_lualatex_options) { add_option( $_, \$lualatex ); }
-foreach (@extra_xelatex_options) { add_option( $_, \$xelatex ); }
+foreach (@extra_xelatex_options) { add_option( $_, \$xelatex ); }
# If landscape mode, change dvips processor, and the previewers:
@@ -2195,6 +2197,8 @@ if ( $dependents_list && ! $preview_continuous_mode ) {
# to avoid getting incorrect blank items when they are split.
foreach ($clean_ext, $clean_full_ext) { s/^\s+//; s/\s+$//; s/\s+/ /g; }
+# Deal with illegal and problematic characters in filename:
+test_fix_texnames( @file_list );
FILE:
foreach $filename ( @file_list )
@@ -2248,11 +2252,11 @@ foreach $filename ( @file_list )
if ( find_basename($filename, $root_filename, $texfile_name) )
{
if ( $force_mode ) {
- warn "$My_name: Could not find file [$texfile_name]\n";
+ warn "$My_name: Could not find file '$texfile_name'\n";
}
else {
&ifcd_popd;
- &exit_msg1( "Could not find file [$texfile_name]",
+ &exit_msg1( "Could not find file '$texfile_name'",
11);
}
}
@@ -2610,6 +2614,75 @@ if ( $where_log == 2 ) {
#############################################################
#############################################################
+sub test_fix_texnames {
+ my $illegal_char = 0;
+ my $unbalanced_quote = 0;
+ my $balanced_quote = 0;
+ foreach (@_) {
+ if ( $^O eq "MSWin32" ) {
+ # On MS-Win, change directory separator '\' to '/', as needed
+ # by the TeX engines, for which '\' introduces a macro name.
+ # Remember that '/' is a valid directory separator in MS-Win.
+ s[\\][/]g;
+ }
+ if ( /[\Q$illegal_in_texname\E]/ ) {
+ $illegal_char++;
+ warn "$My_name: Filename '$_' contains character not allowed for TeX file.\n";
+ }
+ my ($filename, $path) = fileparse( $_ );
+ if ( $do_cd && ($filename =~ /^&/) ) {
+ $illegal_char++;
+ warn "$My_name: Filename part of '$_' contains initial '&', which is\n",
+ " not allowed for TeX file in my -cd mode.\n";
+ }
+ elsif ( /^&/ ) {
+ $illegal_char++;
+ warn "$My_name: Filename '$_' contains initial '&', which is not allowed for TeX file.\n";
+ }
+ my $count_q = ($_ =~ tr/\"//);
+ if ( ($count_q % 2) != 0 ) {
+ warn "$My_name: Filename '$_' contains unbalanced quotes, not allowed.\n";
+ $unbalanced_quote++;
+ }
+ elsif ( $count_q > 0 ) {
+ warn "$My_name: Removed (balanced quotes) from filename '$_',\n";
+ s/\"//g;
+ warn " and obtained '$_'.\n";
+ $balanced_quote++;
+ }
+ }
+ if ($illegal_char || $unbalanced_quote) {
+ die "$My_name: Stopping because of bad filename(s).\n";
+ }
+}
+
+#############################################################
+
+sub ensure_path {
+ # Usage: ensure_path( $var, values ...)
+ # $ENV{$var} is an environment variable (e.g. $ENV{TEXINPUTS}.
+ # Ensure the values are in it, prepending them if not, and
+ # creating the environment variable if it doesn't already exist.
+ my $var = shift;
+ my %cmpts = ();
+ if ( exists $ENV{$var} ) {
+ foreach ( split $search_path_separator, $ENV{$var} ) {
+ if ($_ ne '') { $cmpts{$_} = 1; }
+ }
+ }
+ foreach (@_) {
+ next if ( ($_ eq '') || (exists $cmpts{$_}) );
+ if (exists $ENV{$var}) {
+ $ENV{$var} = $_ . $search_path_separator . $ENV{$var};
+ }
+ else {
+ $ENV{$var} = $_ . $search_path_separator;
+ }
+ }
+}
+
+#############################################################
+
sub set_dirs_etc {
# Normalize versions terminating in directory/path separator
# and versions referring to current directory
@@ -2634,16 +2707,7 @@ sub set_dirs_etc {
# cases by adding the aux_dir to the relevant path search environment
# variables. BIBINPUTS seems to be the only one currently affected.
foreach ( 'BIBINPUTS', 'TEXINPUTS' ) {
- if ( exists $ENV_ORIG{$_} ) {
- $ENV{$_} = $aux_dir.$search_path_separator.$ENV_ORIG{$_};
- }
- else {
- # Note the trailing ":" or ";" which ensures that the last item
- # in the list of paths is the empty path, which actually
- # means the default path, i.e., the following means that
- # the search path is $aux_dir and the standard value.
- $ENV{$_} = $aux_dir.$search_path_separator;
- }
+ ensure_path( $_, $aux_dir );
}
}
}
@@ -2652,7 +2716,7 @@ sub set_dirs_etc {
sub fix_cmds {
# If commands do not have placeholders for %S etc, put them in
- foreach ($latex, $pdflatex, $lpr, $lpr_dvi, $lpr_pdf,
+ foreach ($latex, $lualatex, $pdflatex, $xelatex, $lpr, $lpr_dvi, $lpr_pdf,
$pdf_previewer, $ps_previewer, $ps_previewer_landscape,
$dvi_previewer, $dvi_previewer_landscape,
$kpsewhich
@@ -3873,7 +3937,7 @@ sub run_bibtex {
# Prevent changes we make to environment becoming global:
local %ENV = %ENV;
my ( $base, $path, $ext ) = fileparseA( $$Psource );
- if ( $path ) {
+ if ( $path && $bibtex_fudge ) {
# Since (e.g.,) 'bibtex output/main.aux' doesn't find subsidiary .aux
# files, as from \@include{chap.aux}, we change directory to the
# directory of the top-level .aux file to run bibtex. But we have to
@@ -4871,6 +4935,10 @@ sub parse_fls {
if (/^\s*PWD\s+(.*)$/) {
$cwd = $1;
$$Ppwd_latex = $cwd;
+ if ( $cwd =~ /\"/ ) {
+ warn "$My_name: The working directory has a '\"' character in its name:\n",
+ " '$cwd'\n This can cause me trouble. Beware!\n";
+ }
}
elsif (/^\s*INPUT\s+(.*)$/) {
# Take precautions against aliasing of foo, ./foo and other possibilities for cwd.
@@ -4880,7 +4948,9 @@ sub parse_fls {
# us from coding issues if the PWD contains non-ASCII characters. What
# coding scheme (UTF-8, code page, etc) is used depends on OS, TeX
# implementation, ...
- $file =~ s(^\Q$$Ppwd_latex\E[\\/])();
+ if ( defined $$Ppwd_latex ) {
+ $file =~ s(^\Q$$Ppwd_latex\E[\\/])();
+ }
$file = normalize_filename( $file );
if ( (exists $$Poutputs{$file}) && (! exists $$Pinputs{$file}) ) {
$$Pfirst_read_after_write{$file} = 1;
@@ -4891,7 +4961,8 @@ sub parse_fls {
# Take precautions against aliasing of foo, ./foo and other possibilities for cwd.
my $file = $1;
$file =~ s(^\Q$$Ppwd_latex\E[\\/])();
- $$Poutputs{ normalize_filename( $file )} = 1;
+ $file = normalize_filename( $file );
+ $$Poutputs{$file} = 1;
}
}
close( $fls_file );
@@ -4966,20 +5037,6 @@ sub fix_pattern {
#************************************************************
-sub OS_preferred_filename {
- # Usage: OS_preferred_filename(name)
- # Returns filename with directory separator '/' converted
- # to preferred conventions for current OS.
- # Currently implemented: only '\' for MSWin32
- my $file = $_[0];
- if ( $^O eq 'MSWin32' ) {
- $file =~ s(/)(\\)g;
- }
- return $file;
-}
-
-#************************************************************
-
sub parse_aux {
#Usage: parse_aux( $aux_file, \@new_bib_files, \@new_aux_files, \@new_bst_files )
# Parse aux_file (recursively) for bib files, and bst files.
@@ -5210,8 +5267,9 @@ sub rdb_read {
or return ();
my $errors = 0;
my $state = -1; # Values: -1: before start; 0: outside rule;
- # 1: in source section; 2: in generated file section;
- # 10: ignored rule
+ # 1: in source section;
+ # 2: in generated file section;
+ # 10: ignored rule.
my $rule = '';
my $run_time = 0;
my $source = '';
@@ -5275,19 +5333,29 @@ LINE:
my $toext = $2;
my $base = $3;
$source = "$base.$fromext";
- $dest = "$base.$toext";
- my $PAnew_cmd = ['do_cusdep', ''];
+# $dest = "$base.$toext";
+ my $func_name = '';
foreach my $dep ( @cus_dep_list ) {
- my ($tryfromext,$trytoext,$must,$func_name) = split('\s+',$dep);
+ my ($tryfromext,$trytoext,$must,$try_func_name) = split('\s+',$dep);
if ( ($tryfromext eq $fromext) && ($trytoext eq $toext) ) {
- $$PAnew_cmd[1] = $func_name;
+ $func_name = $try_func_name;
}
}
- # Set source file as non-existent.
- # If it existed on last run, it will be in later
- # lines of the fdb file
- rdb_create_rule( $rule, 'cusdep', '', $PAnew_cmd, 1,
- $source, $dest, $base, 0, $run_time, $check_time, 1 );
+ if ($func_name) {
+ my $PAnew_cmd = ['do_cusdep', $func_name];
+ # Set source file as non-existent.
+ # If it existed on last run, it will be in later
+ # lines of the fdb file
+ rdb_create_rule( $rule, 'cusdep', '', $PAnew_cmd, 1,
+ $source, $dest, $base, 0, $run_time, $check_time, 1 );
+ }
+ else {
+ warn "$My_name: In file-database '$in_name', the custom-dependency rule\n",
+ " '$rule' is not available in this session.\n",
+ " Presumably it's no longer in your configuration for latexmk.\n";
+ $state = 10;
+ next LINE;
+ }
}
elsif ( $rule =~ /^(makeindex|bibtex|biber)\s*(.*)$/ ) {
my $PA_extra_gen = [];
@@ -5435,7 +5503,7 @@ sub rdb_write {
&& ! exists( $current_primaries{$rule} )
)
{
- return;
+ return;
}
print $out_handle "[\"$rule\"] $$Prun_time \"$$Psource\" \"$$Pdest\" \"$$Pbase\" $$Pcheck_time\n";
rdb_do_files(
@@ -5561,7 +5629,6 @@ sub rdb_set_latex_deps {
return;
}
-
#?? # We'll prune this by all files determined to be needed for source files.
#?? my %unneeded_source = %$PHsource;
@@ -5716,22 +5783,12 @@ sub rdb_set_latex_deps {
$missing_dvi_pdf = $$Pdest;
}
elsif ($primary_out ne normalize_filename($$Pdest) ) {
- warn "$My_name: ===For rule '$rule', actual output '$primary_out'\n",
- " ======appears not to match expected output '$$Pdest'.\n",
- " Further diagnostics follow:\n";
my ($actual_base, $actual_path, $actual_ext) = fileparseA( $primary_out );
my ($intended_base, $intended_path, $intended_ext) = fileparseA( $$Pdest );
- if ( $actual_base ne $intended_base ) {
- warn " --The base names of the files are different. That is strange!!\n";
- }
- if ( $actual_path ne $intended_path ) {
- warn " --The paths of the files are different. I may have misunderstood\n",
- " different names for the same directory, which is innocuous,\n",
- " or there may be a configuration error.\n";
- }
if ( $actual_ext ne $intended_ext ) {
- warn " --The extensions of the files are different, i.e., the\n",
- " intended and actual types of the output differ.\n";
+ warn "$My_name: ===For rule '$rule', the extensions differ between the\n",
+ " actual output file '$primary_out',\n",
+ " and the expected output '$$Pdest'.\n";
if ( ! exists $allowed_output_ext{$actual_ext} ) {
warn " Actual output file has an extension '$actual_ext' that\n",
" is not one I know about\n";
@@ -5887,7 +5944,8 @@ NEW_SOURCE:
# File was result of conversion by (pdf)latex.
my $cnv_source = $conversions{$new_source};
rdb_ensure_file( $rule, $new_source );
- if ($cnv_source) {
+# if ($cnv_source && ($cnv_source !~ /\"/ ) ) {
+ if ($cnv_source ) {
# Conversion from $cnv_source to $new_source
# implies that effectively $cnv_source is a source
# of the (pdf)latex run.
@@ -6058,6 +6116,7 @@ MISSING_FILE:
my $found = 0;
foreach my $file (keys %new_includes) {
+# if ( $file =~ /\"/ ) {next; }
my $stripped = $file;
$stripped =~ s{^\./}{};
if ( exists $PHsource{$file} ) {
@@ -6099,6 +6158,27 @@ sub rdb_set_dependents {
#************************************************************
+sub rdb_find_source_file {
+ # Helper for searching dependencies in all paths inside the TEXINPUTS
+ # environment variable.
+ my $test = "$_[0].$_[1]";
+ if ( -e $test ) {
+ return $_[0];
+ }
+ if ( exists $ENV{TEXINPUTS} ) {
+ foreach my $searchpath (split $search_path_separator, $ENV{TEXINPUTS}) {
+ my $file = File::Spec->catfile($searchpath,$_[0]);
+ my $test = "$file.$_[1]";
+ if ( -e $test ) {
+ return $file;
+ }
+ }
+ }
+ return "$_[0]";
+}
+
+#************************************************************
+
sub rdb_one_dep {
# Helper for finding dependencies. One case, $rule and $file given
# Assume file (and rule) context for DESTINATION file.
@@ -6118,6 +6198,7 @@ DEP:
foreach my $dep ( @cus_dep_list ) {
my ($fromext,$proptoext,$must,$func_name) = split('\s+',$dep);
if ( $toext eq $proptoext ) {
+ $base_name = rdb_find_source_file($base_name, $fromext);
my $source = "$base_name.$fromext";
# Found match of rule
if ($diagnostics) {
@@ -6125,22 +6206,20 @@ DEP:
}
if ( -e $source ) {
$$Pfrom_rule = "cusdep $fromext $toext $base_name";
-#?? print "?? Ensuring rule for '$$Pfrom_rule'\n";
+ my $new_new_dest = "$base_name.$toext";
+ if ($new_new_dest ne $new_dest) {
+ rdb_ensure_file( $rule, $new_new_dest );
+ $new_dest = $new_new_dest;
+ }
local @PAnew_cmd = ( 'do_cusdep', $func_name );
if ( !-e $new_dest ) {
push @new_sources, $new_dest;
}
if (! rdb_rule_exists( $$Pfrom_rule ) ) {
- print "=== Creating rule for '$$Pfrom_rule'\n";
+ print "$My_name: === Creating rule '$$Pfrom_rule'\n" if $diagnostics;
rdb_create_rule( $$Pfrom_rule, 'cusdep', '', \@PAnew_cmd, 3,
$source, $new_dest, $base_name, 0 );
}
- else {
- rdb_one_rule(
- $$Pfrom_rule,
- sub{ @$PAint_cmd = @PAnew_cmd; $$Pdest = $new_dest;}
- );
- }
return;
}
else {
@@ -6170,6 +6249,7 @@ DEP:
# This normally results from \includegraphics{A}
# without graphics extension for file, when file does
# not exist. So we will try to find something to make it.
+ $base_name = rdb_find_source_file($base_name, $fromext);
my $source = "$base_name.$fromext";
if ( -e $source ) {
$new_dest = "$base_name.$proptoext";
@@ -6179,15 +6259,10 @@ DEP:
if $diagnostics > -1;
local @PAnew_cmd = ( 'do_cusdep', $func_name );
if (! rdb_rule_exists( $from_rule ) ) {
+ print "$My_name: === Creating rule '$$Pfrom_rule'\n" if $diagnostics;
rdb_create_rule( $from_rule, 'cusdep', '', \@PAnew_cmd, 3,
$source, $new_dest, $base_name, 0 );
}
- else {
- rdb_one_rule(
- $$Pfrom_rule,
- sub{ @$PAint_cmd = @PAnew_cmd; $$Pdest = $new_dest;}
- );
- }
rdb_ensure_file( $rule, $new_dest, $from_rule );
# We've now got a spurious file in our rule. But don't mess
# with deleting an item we are in the middle of!
@@ -7031,6 +7106,7 @@ sub rdb_run1 {
my @biber_source = ( );
my $retcode = check_biber_log( $$Pbase, \@biber_source );
foreach my $source ( @biber_source ) {
+# if ( $source =~ /\"/ ) {next; }
print " ===Source file '$source' for '$rule'\n"
if ($diagnostics);
rdb_ensure_file( $rule, $source );
@@ -7844,6 +7920,12 @@ sub rdb_create_rule {
$set_file_not_exists ) {
if (! defined $_) { $_ = ''; }
}
+ if ( ($source =~ /\"/) || ($dest =~ /\"/) || ($base =~ /\"/) ) {
+ die "$My_name: Error. In rdb_create_rule there is a double quote in one of\n",
+ " source, destination or base parameters:\n",
+ " '$source', '$dest', '$base'\n",
+ " I cannot handle this.\n";
+ }
foreach ( $needs_making, $run_time, $check_time, $test_kind ) {
if (! defined $_) { $_ = 0; }
}
@@ -7901,6 +7983,16 @@ sub rdb_add_generated {
#************************************************************
+sub rdb_remove_generated {
+# Assume rule context.
+# Remove arguments from hash of generated files
+ foreach (@_) {
+ delete $$PHdest{$_};
+ }
+} #END rdb_remove_generated
+
+#************************************************************
+
sub rdb_ensure_file {
# rdb_ensure_file( rule, file[, fromrule[, set_not_exists]] )
# Ensures the source file item exists in the given rule.
@@ -7916,10 +8008,16 @@ sub rdb_ensure_file {
my $rule = shift;
local ( $new_file, $new_from_rule, $set_not_exists ) = @_;
if ( ! rdb_rule_exists( $rule ) ) {
- die_trace( "$My_name: BUG in rdb_ensure_file: non-existent rule '$rule'" );
+ die_trace( "$My_name: BUG in call to rdb_ensure_file: non-existent rule '$rule'" );
}
if ( ! defined $new_file ) {
- die_trace( "$My_name: BUG in rdb_ensure_file: undefined file for '$rule'" );
+ die_trace( "$My_name: BUG in call to rdb_ensure_file: undefined file for '$rule'" );
+ }
+ if ( $new_file =~ /\"/ ) {
+ warn "$My_name: in rdb_ensure_file for rule '$rule', there is a double quote in\n",
+ " the filename: '$new_file'.\n",
+ " I cannot handle this, will ignore this file.\n";
+ return;
}
if ( ! defined $set_not_exists ) { $set_not_exists = 0; }
rdb_one_rule( $rule,
@@ -7974,6 +8072,7 @@ sub rdb_set_source {
if (!$rule) { return; }
my %files = ();
foreach (@_) {
+# if ( /\"/ ) {next; }
rdb_ensure_file( $rule, $_ );
$files{$_} = 1;
}
@@ -7985,6 +8084,36 @@ sub rdb_set_source {
#************************************************************
+sub rdb_change_dest {
+ # Assumes rule context.
+ # Usage change_dest( new_dest [, flag] )
+ # Changes destination for this rule. Fixes from_rule links.
+ # If flag set, make the new_dest a source file in any rule
+ # for which the old destination is already set.
+ # No action if there's no change of destination.
+ local ($new_dest, $flag) = @_;
+ local $old_dest = $$Pdest;
+ if ($old_dest eq $new_dest) { return; }
+# if ( $new_dest =~ /\"/ ) { return; }
+ rdb_remove_generated( $old_dest );
+ rdb_add_generated( $new_dest );
+ if ($flag) {
+ print "rdb_change_dest: fixing dependencies\n";
+ rdb_for_all( sub{ if ( rdb_file_exists( $rule, $old_dest ) ) {
+ rdb_ensure_file( $rule, $new_dest );
+ rdb_remove_files( $rule, $old_dest );
+ }
+ }
+ );
+ }
+ $$Pdest = $new_dest;
+ # ??? Do I need to fix from_rule setting?
+ #&rdb_make_links;
+ return;
+} #END rdb_change_dest
+
+#************************************************************
+
sub rdb_rule_exists {
# Call rdb_rule_exists($rule): Returns whether rule exists.
my $rule = shift;
@@ -8337,16 +8466,12 @@ sub get_checksum_md5 {
#&traceback;
#warn "======= GETTING MD5: $source\n";
- if ( $source eq "" ) {
- # STDIN:
- open( $input, '-' );
- }
- elsif ( -d $source ) {
+ if ( -d $source ) {
# We won't use checksum for directory
return 0;
}
else {
- open( $input, '<', $source )
+ open( $input, '<:bytes', $source )
or return 0;
my ($base, $path, $ext) = fileparseA( $source );
$ext =~ s/^\.//;
@@ -8354,7 +8479,6 @@ sub get_checksum_md5 {
$ignore_pattern = $hash_calc_ignore_pattern{$ext};
}
}
-
if ( defined $ignore_pattern ) {
while (<$input>) {
if ( ! /$ignore_pattern/ ){
diff --git a/Master/texmf-dist/doc/man/man1/latexmk.1 b/Master/texmf-dist/doc/man/man1/latexmk.1
index 2823348f536..5eead4a5b56 100644
--- a/Master/texmf-dist/doc/man/man1/latexmk.1
+++ b/Master/texmf-dist/doc/man/man1/latexmk.1
@@ -1,4 +1,4 @@
-.TH LATEXMK 1 "25 May 2018" ""
+.TH LATEXMK 1 "7 August 2018" ""
.SH NAME
latexmk \- generate LaTeX document
.SH SYNOPSIS
@@ -151,7 +151,25 @@ is automatically added, just as LaTeX does. Thus, if you specify:
latexmk foo
-then \fIlatexmk\fR will operate on the file "foo.tex".
+then \fIlatexmk\fR will operate on the file "foo.tex".
+
+There are certain restrictions on what characters can be in a
+filename; certain characters are either prohibited or problematic for
+the \fIlatex\fR etc programs. These characters are: "$", "%", "\\",
+"~", the double quote character, and the control characters null, tab,
+form feed, carriage return, line feed, and delete. In addition "&" is
+prohibited when it is the first character of a filename.
+
+\fILatexmk\fR gives a fatal error when it detects any of the above
+characters in the TeX filename(s) specified on the command line.
+\fIHowever\fR before testing for illegal characters, \fIlatexmk\fR
+removes matching pairs of double quotes from a filename. This matches
+the behavior of \fIlatex\fR etc, and deals with problems that occasionally
+result from filenames that have been incorrectly quoted on the command
+line. \fIIn addition\fR, under Microsoft Windows, the forward slash
+character "\\" is a directory separator, so \fIlatexmk\fR replaces it
+by a backward slash "/", which is also a legal directory separator in
+Windows, and is accepted by \fIlatex\fR etc.
.TP
.B -auxdir=FOO or -aux-directory=FOO
@@ -326,7 +344,7 @@ for details.
.TP
.B -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
+it. Then all the generated files (.aux, .log, .dvi, .pdf, etc) will be
relative to the source file.
This option is particularly useful when \fIlatexmk\fR is invoked from
@@ -336,7 +354,7 @@ source file.
.TP
.B -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
+it. Then all the generated files (.aux, .log, .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
@@ -698,22 +716,22 @@ Generate pdf version of document using \fIlualatex\fR.
.TP
.B -pdfps
-Generate pdf version of document from the ps file, by default using
+Generate pdf version of document from the .ps file, by default using
\fIps2pdf\fR.
.TP
.B -pdfxe
Generate pdf version of document using \fIxelatex\fR. Note that to
optimize processing time, \fIlatexmk\fR uses \fIxelatex\fR to generate
-an xdv file rather than a pdf file directly. Only after possibly
-multiple runs to generate a fully up-to-date xdv does \fIlatexmk\fR
-then call \fIxdvipdfmx\fR to generate the final pdf file.
+an .xdv file rather than a pdf file directly. Only after possibly
+multiple runs to generate a fully up-to-date .xdv file does \fIlatexmk\fR
+then call \fIxdvipdfmx\fR to generate the final .pdf file.
(\fINote:\fR When the document includes large graphics files,
-especially png files, the last step can be quite time consuming, even
-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
+especially .png files, the last step can be quite time consuming, even
+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.)
.TP
@@ -790,10 +808,10 @@ of perl and the operating system on your computer.
.TP
.B -pv
Run file previewer. If the \fB-view\fR option is used, this will select
-the kind of file to be previewed (dvi, ps or pdf).
+the kind of file to be previewed (.dvi, .ps or .pdf).
Otherwise the viewer views the "highest" kind of file selected, by the
\fB-dvi\fR, \fB-ps\fR, \fB-pdf\fR, \fB-pdfps\fR options, in the
-order dvi, ps, pdf (low to high).
+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 \fB-p\fR and \fB-pvc\fR options,
so it turns them off.
@@ -1015,7 +1033,7 @@ Opposite of \fB-silent\fR. This is the default setting.
.B -view=default, -view=dvi, -view=ps, -view=pdf, -view=none
Set the kind of file used when previewing is requested (e.g., by the
\fB-pv\fR or \fB-pvc\fR switches). The default is to view the "highest"
-kind of requested file (in the low-to-high order dvi, ps, pdf).
+kind of requested file (in the low-to-high order .dvi, .ps, .pdf).
Note the possibility \fB-view=none\fR where no viewer is opened at
all. One example of is use is in conjunction with the \fB-pvc\fR
@@ -1045,10 +1063,10 @@ This option is equivalent to using the following set of options
[\fINote\fR: Note that the method of implementation of this option,
but not its intended primary effect, differ from some earlier versions
-of \fIlatexmk\fR. \fILatexmk\fR first uses \fIxelatex\fR to make an
-xdv file, and does all the extra runs needed (including those of
+of \fIlatexmk\fR. \fILatexmk\fR first uses \fIxelatex\fR to make
+an .xdv file, and does all the extra runs needed (including those of
\fIbibtex\fR, etc). Only after that does it make the pdf file from
-the xdv file, using \fIxdvipdfmx\fR. This procedure can result in
+the .xdv file, using \fIxdvipdfmx\fR. This procedure can result in
considerable savings in run time, since the xdv-to-pdf conversion is
quite time-consuming when large graphics files are used in the
document.]
@@ -1272,7 +1290,7 @@ consult a manual for the \fIPerl\fR programming language.
.SH FORMAT OF COMMAND SPECIFICATIONS
Some of the variables set the commands that \fIlatexmk\fR uses for
-carrying out its work, for example to generate a dvi file from a tex
+carrying out its work, for example to generate a .dvi file from a .tex
file or to view a postscript file. This section describes some
important features of how the commands are specified.
(Note\ that some of the possibilities listed here do not apply to
@@ -1311,7 +1329,7 @@ options
root filename. This is the base name for the main tex file.
.TP
.B %S
-source file (e.g., the name of the dvi file when converting a dvi file
+source file (e.g., the name of the dvi file when converting a .dvi file
to ps).
.TP
.B %T
@@ -1340,7 +1358,7 @@ 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
spaces in them. (But if your TeX filenames have spaces in them,
-beware that many versions of the TeX program cannot correctly handle
+beware that some older versions of the TeX program cannot correctly handle
filenames containing spaces.) In case \fIlatexmk\fR's quoting does not work
correctly on your system, you can turn it off -- see the documentation
for the variable \fI$quote_filenames\fR.
@@ -1502,10 +1520,10 @@ invoking the MS-Windows command-line processor \fIcmd.exe\fR.
Default values are indicated in brackets.
.TP
.B $always_view_file_via_temporary [0]
-Whether ps and pdf files are initially to be made in a temporary
+Whether .ps and .pdf files are initially to be made in a temporary
directory and then moved to the final location. (This applies to
\fIdvips\fR, \fIdvipdf\fR, and \fIps2pdf\fR operations, and the
-filtering operators on dvi and ps files. It does not apply to
+filtering operators on .dvi and .ps files. It does not apply to
\fIpdflatex\fR, unfortunately, since \fIpdflatex\fR provides no way of
specifying a chosen name for the output file.)
@@ -1639,6 +1657,12 @@ Switch(es) for the biber processing program when silent mode is on.
.B $bibtex ["bibtex %O %S"]
The BibTeX processing program.
.TP
+.B $bibtex_fudge [1]
+When using bibtex, whether to take special action to allow bibtex 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.
+.TP
.B $bibtex_silent_switch ["-terse"]
Switch(es) for the BibTeX processing program when silent mode is on.
.TP
@@ -1686,7 +1710,7 @@ generation generated files.
.TP
.B $cleanup_mode [0]
If nonzero, specifies cleanup mode: 1 for full cleanup, 2 for cleanup
-except for dvi, ps and pdf files, 3 for cleanup except for dep and aux
+except for .dvi, .ps and .pdf files, 3 for cleanup except for dep and aux
files. (There is also extra cleaning as specified by the
\fI$clean_ext\fR, \fI$clean_full_ext\fR and \fI@generated_exts\fR
variables.)
@@ -1895,7 +1919,7 @@ use the MS-Windows \fIstart\fR program, which will cause to be run
whatever command the system has associated with .dvi files.]
.TP
.B $dvipdf ["dvipdf %O %S %D"]
-Command to convert dvi to pdf file. A common reconfiguration is to
+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";
@@ -1926,7 +1950,7 @@ in landscape mode.
.TP
.B $dvips_pdf_switch ["-P pdf"]
Switch(es) for \fIdvips\fR program when pdf file is to be generated
-from ps file.
+from .ps file.
.TP
.B $dvips_silent_switch ["-q"]
Switch(es) for \fIdvips\fR program when silent mode is on.
@@ -2345,8 +2369,8 @@ If equal to 5, generate a pdf version (and an xdv version) of the
document using \fIxelatex\fR, using the commands specified by the
\fI$xelatex\fR and \fIxdvipdfmx\fR variables.
-In \fI$pdf_mode\fR=2, it is ensured that dvi and ps files are also made.
-In \fI$pdf_mode\fR=3, it is ensured that a dvi file is also made.
+In \fI$pdf_mode\fR=2, it is ensured that .dvi and .ps files are also made.
+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
@@ -2511,7 +2535,7 @@ OS-X, and
In these specifications "$ENV{USER}" is substituted by the username.
.TP
.B $ps2pdf ["ps2pdf %O %S %D"]
-Command to convert ps to pdf file.
+Command to convert .ps to .pdf file.
.TP
.B $ps_filter [empty]
The postscript file filter to be run on the newly produced postscript
@@ -2552,7 +2576,7 @@ is the command that is run. See the information for the variable
\fI$ps_update_method\fR.
.TP
.B $ps_update_method [0 under UNIX, 1 under MS-Windows]
-How the postscript viewer updates its display when the ps file has
+How the postscript viewer updates its display when the .ps file has
changed. See the information on the variable \fI$dvi_update_method\fR
for the codes. (Note that information needs be changed slightly so
that for the value 4, to run a command to do the update, the command
@@ -2712,7 +2736,7 @@ is merely to detect dependencies.
Which kind of file is to be previewed if a previewer is used. The
possible values are "default", "dvi", "ps", "pdf". The value
of "default" means that the "highest" of the kinds of file generated is
-to be used (among dvi, ps and pdf).
+to be used (among .dvi, .ps and .pdf).
.TP
.B $warnings_as_errors [0]
@@ -2765,11 +2789,17 @@ with \fIxelatex\fR when \fI$pdf_mode\fR=5).
.B $xdvipdfmx_silent_switch ["-q"]
Switch(es) for the \fIxdvipdfmx\fR program when silent mode is on.
.TP
-.B $xelatex ["xelatex %O %S"]
+.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
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.
+
.TP
.B %xelatex_input_extensions
This variable specifies the extensions tried by \fIlatexmk\fR when it finds
@@ -2831,6 +2861,7 @@ If non-zero, the file from which we are converting \fBmust\fR exist, if it
doesn't exist \fIlatexmk\fR will give an error message and exit unless
the \fB-f\fR option is specified. If \fImust\fR is zero and the file
we are converting from doesn't exist, then no action is taken.
+Generally, the appropriate value of \fImust\fR is zero.
.TP
.B function:
The name of the subroutine that \fIlatexmk\fR should call to perform the
@@ -2852,16 +2883,15 @@ currently defined custom dependencies to be sent to the screen
output.
.SS How custom dependencies are used:
-A custom dependency rule is invoked whenever \fIlatexmk\fR 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 dependency. Then
-\fIlatexmk\fR examines whether a file exists with the same name, but
-with the corresponding from-extension, as specified in the
-custom-dependency rule. If it does, then 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.
+An instance of a custom dependency rule is created whenever
+\fIlatexmk\fR 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 dependency. Then \fIlatexmk\fR 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 respect to the corresponding source file.
To make the new destination file, the \fIPerl\fR subroutine specified in the
rule is invoked, with an argument that is the base name of the files
@@ -2870,10 +2900,24 @@ external program; this can be done by following the templates below,
even by those without knowledge of the \fIPerl\fR programming language. Of
course, experts could do something much more elaborate.
-One other 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.
+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 \fIlatex\fR reports that an input file (e.g., a graphics file)
+does not exist, \fIlatexmk\fR 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 \fIlatex\fR etc will be
+able to read the newly created file.
+
+\fINote for advanced usage\fR: The operating system's environment
+variable TEXINPUTS can be used to specify a search path for finding
+files by \fIlatex\fR etc. Correspondingly, when a missing file is
+reported, \fIlatexmk\fR looks in the directories specified in
+TEXINPUTS as well as in the current directory, to find a source file
+from which an instance of a custom dependency can be used to make the
+missing file.
.SS Function to implement custom dependency, traditional method:
The function that implements a custom dependency gets the information
@@ -3329,7 +3373,7 @@ e-mail addresses are not written in their standard form to avoid being
harvested too easily.)
.SH AUTHOR
Current version, by John Collins (username jcc8 at node psu.edu).
-(Version 4.56).
+(Version 4.59).
Released version can be obtained from CTAN:
<http://www.ctan.org/pkg/latexmk/>, and from the
diff --git a/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf b/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf
index b5bcd1a74d5..9401ea9992b 100644
--- a/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/latexmk/CHANGES b/Master/texmf-dist/doc/support/latexmk/CHANGES
index 775e879c8fb..5910c8dc950 100644
--- a/Master/texmf-dist/doc/support/latexmk/CHANGES
+++ b/Master/texmf-dist/doc/support/latexmk/CHANGES
@@ -621,3 +621,27 @@ From v. 4.55a to 4.56
Add use of environment variable LATEXMKRCSYS to specify system rc
file.
+From v. 4.56 to 4.57
+ Correct problem that in calculation of md5 checksum, an error
+ sometimes occurs about malformed utf8 characters. This can happen
+ if the environment variable PERL_UNICODE is set.
+ Add configuration variable $bibtex_fudge to allow to choose
+ whether to use the fudge that made bibtex run correctly when
+ an output directory (or aux directory) is specified. (A
+ planned future version of bibtex in TeXLive will not need
+ the fudge.)
+
+From v. 4.57 to 4.59
+ Deal with double quote ('"') characters in files on command line to
+ correspond to behavior of tex programs. Remove balanced pairs,
+ and give fatal error for unbalanced double quotes. (Note MiKTeX's
+ tex programs simply remove unbalanced quotes.) In all cases, the
+ '"' character is not allowed in a filename read by tex and
+ friends.
+ Give fatal error when name of tex file on command line is either not
+ allowed by tex and friends are gives problematic behavior.
+ Use TEXINPUTS as search path for source files for custom
+ dependency.
+ 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.
diff --git a/Master/texmf-dist/doc/support/latexmk/INSTALL b/Master/texmf-dist/doc/support/latexmk/INSTALL
index ede38726136..4b70285165d 100644
--- a/Master/texmf-dist/doc/support/latexmk/INSTALL
+++ b/Master/texmf-dist/doc/support/latexmk/INSTALL
@@ -1,6 +1,6 @@
INSTALLING latexmk
==================
- (Version 4.56, 25 May 2018)
+ (Version 4.59, 7 August 2018)
John Collins
Physics Department
@@ -76,7 +76,7 @@ distribution.
In the case of MiKTeX, the other standard distribution for MS-Windows,
the main difference from TeXLive as regards latexmk is that you may
need to install a distribution of Perl. A standard default
-installation should enable
+installation of Perl should enable latexmk to work.
Installing on UNIX/LINUX/OS-X
@@ -219,7 +219,11 @@ NOTE: If you are using TeXLive 2009 or later, you can install latexmk
simply by using the TeXLive package manager. In fact, depending on
how much of TeXLive you have already installed, latexmk may already
have been installed. In that case you don't normally need to bother
-with the manual installation explained below.
+with the manual installation explained below.
+
+Similarly if you have MiKTeX, you can install latexmk by using
+MiKTeX's package manager. But to allow latexmk to work, you will also
+need to install a distribution of Perl if you haven't done so already.
1. Make sure you have working installations of Perl and TeX/LaTeX,
complete with viewers for dvi and/or postscript files. You will
diff --git a/Master/texmf-dist/doc/support/latexmk/README b/Master/texmf-dist/doc/support/latexmk/README
index 119b64d0f89..55bd8fa5c03 100644
--- a/Master/texmf-dist/doc/support/latexmk/README
+++ b/Master/texmf-dist/doc/support/latexmk/README
@@ -1,4 +1,4 @@
-Latexmk, version 4.56, 25 May 2018
+Latexmk, version 4.59, 7 Aug 2018
----------------------------------
Latexmk completely automates the process of generating a LaTeX
@@ -91,7 +91,7 @@ NOTES:-
John Collins
---------------------------- "latexmk -h" ----------------------------
-Latexmk 4.56: Automatic LaTeX document generation routine
+Latexmk 4.59: Automatic LaTeX document generation routine
Usage: latexmk [latexmk_options] [filename ...]
diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/tikz-externalized-latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/tikz-externalized-latexmkrc
new file mode 100644
index 00000000000..22ed6f7d388
--- /dev/null
+++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/tikz-externalized-latexmkrc
@@ -0,0 +1,75 @@
+# This shows how to deal with tikz when it is used in its externalized mode.
+#
+# Here is an example of a document that uses externalization.
+# Externalization results in a .pdf file for each tikzpicture
+# environment.
+#
+# \documentclass{article}
+# \usepackage{tikz,pgfplots}
+# \usetikzlibrary{external}
+# \tikzexternalize[mode=list and make]
+#
+# \begin{document}
+# \begin{tikzpicture}
+# \begin{axis}
+# \addplot coordinates {(1,1) (2,2) (3,5)};
+# \end{axis}
+# \end{tikzpicture}%
+# \end{document}
+
+
+$clean_ext .= ' %R.figlist %R-figure* %R.makefile fls.tmp';
+
+$latex = 'internal tikzlatex latex %B %O %S';
+$pdflatex = 'internal tikzlatex pdflatex %B %O %S';
+$lualatex = 'internal tikzlatex lualatex %B %O %S';
+$xelatex = 'internal tikzlatex xelatex %B %O %S';
+
+$hash_calc_ignore_pattern{'pdf'} = '^(/CreationDate|/ModDate|/ID)';
+$hash_calc_ignore_pattern{'ps'} = '^%%CreationDate';
+
+sub tikzlatex {
+ my ($engine, $base, @args) = @_;
+ my $ret = 0;
+ print "Tikzlatex: ===Running '$engine @args'...\n";
+ $ret = system( $engine, @args );
+ print "Tikzlatex: Fixing .fls file ...\n";
+ system "echo INPUT \"$aux_dir1$base.figlist\" > \"$aux_dir1$base.fls.tmp\"";
+ system "echo INPUT \"$aux_dir1$base.makefile\" >> \"$aux_dir1$base.fls.tmp\"";
+ system "cat \"$aux_dir1$base.fls\" >> \"$aux_dir1$base.fls.tmp\"";
+ rename "$aux_dir1$base.fls.tmp", "$aux_dir1$base.fls";
+ if ($ret) { return $ret; }
+ if ( -e "$aux_dir1$base.makefile" ) {
+ if ($engine eq 'xelatex') {
+ print "Tikzlatex: ---Correcting '$aux_dir1$base.makefile' made under xelatex\n";
+ system( 'perl', '-i', '-p', '-e', 's/^\^\^I/\t/', "$aux_dir1$base.makefile" );
+ }
+ elsif ($engine eq 'latex') {
+ print "Tikzlatex: ---Correcting '$aux_dir1$base.makefile' made under latex\n";
+ system( 'perl', '-i', '-p', '-e', 's/\.epsi/\.ps/', "$aux_dir1$base.makefile" );
+ }
+ print "Tikzlatex: ---Running 'make -f $aux_dir1$base.makefile' ...\n";
+ if ($aux_dir) {
+ # latexmk has set $ENV{TEXINPUTS} in this case.
+ my $SAVETEXINPUTS = $ENV{TEXINPUTS};
+ $ENV{TEXINPUTS} = good_cwd().$search_path_separator.$ENV{TEXINPUTS};
+ pushd( $aux_dir );
+ $ret = system "make", "-j", "5", "-f", "$base.makefile";
+ &popd;
+ $ENV{TEXINPUTS} = $SAVETEXINPUTS;
+ }
+ else {
+ $ret = system "make", "-j", "5", "-f", "$base.makefile";
+ }
+ if ($ret) {
+ print "Tikzlatex: !!!!!!!!!!!!!! Error from make !!!!!!!!! \n",
+ " The log files for making the figures '$aux_dir1$base-figure*.log'\n",
+ " may have information\n";
+ }
+ }
+ else {
+ print "Tikzlatex: No '$aux_dir1$base.makefile', so I won't run make.\n";
+ }
+ return $ret;
+}
+
diff --git a/Master/texmf-dist/doc/support/latexmk/latexmk.pdf b/Master/texmf-dist/doc/support/latexmk/latexmk.pdf
index 9d22eb8a023..ef944e90fc0 100644
--- a/Master/texmf-dist/doc/support/latexmk/latexmk.pdf
+++ b/Master/texmf-dist/doc/support/latexmk/latexmk.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/latexmk/latexmk.txt b/Master/texmf-dist/doc/support/latexmk/latexmk.txt
index 5bf1c69056c..edf5b6b4dd8 100644
--- a/Master/texmf-dist/doc/support/latexmk/latexmk.txt
+++ b/Master/texmf-dist/doc/support/latexmk/latexmk.txt
@@ -61,7 +61,7 @@ DESCRIPTION
- 25 May 2018 1
+ 7 August 2018 1
@@ -127,7 +127,7 @@ LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE
- 25 May 2018 2
+ 7 August 2018 2
@@ -172,313 +172,328 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
then latexmk will operate on the file "foo.tex".
+ There are certain restrictions on what characters can be in a
+ filename; certain characters are either prohibited or problem-
+ atic for the latex etc programs. These characters are: "$",
+ "%", "\", "~", the double quote character, and the control char-
+ acters null, tab, form feed, carriage return, line feed, and
+ delete. In addition "&" is prohibited when it is the first
+ character of a filename.
- -auxdir=FOO or -aux-directory=FOO
- Sets the directory for auxiliary output files of (pdf)latex
- (.aux, .log etc). This achieves its effect by the -aux-direc-
- tory option of (pdf)latex, which currently is only implemented
- on the MiKTeX version of (pdf)latex.
+ Latexmk gives a fatal error when it detects any of the above
+ characters in the TeX filename(s) specified on the command line.
+ However before testing for illegal characters, latexmk removes
+ matching pairs of double quotes from a filename. This matches
+ the behavior of latex etc, and deals with problems that occa-
+ sionally result from filenames that have been incorrectly quoted
+ on the command line. In addition, under Microsoft Windows, the
+ forward slash character "\" is a directory separator, so latexmk
+ replaces it by a backward slash "/", which is also a legal
+ directory separator in Windows, and is accepted by latex etc.
- See also the -outdir/-output-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 auxiliary out-
- put directory is a relative path, then the path is interpreted
- relative to the document directory.
+ 7 August 2018 3
- 25 May 2018 3
+LATEXMK(1) General Commands Manual LATEXMK(1)
+ -auxdir=FOO or -aux-directory=FOO
+ Sets the directory for auxiliary output files of (pdf)latex
+ (.aux, .log etc). This achieves its effect by the -aux-direc-
+ tory option of (pdf)latex, which currently is only implemented
+ on the MiKTeX version of (pdf)latex.
+ See also the -outdir/-output-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.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ If you also use the -cd option, and the specified auxiliary out-
+ put directory is a relative path, then the path is interpreted
+ relative to the document directory.
-bibtex
When the source file uses bbl files for bibliography, run bibtex
or biber as needed to regenerate the bbl files.
- This property can also be configured by setting the $bibtex_use
+ This property can also be configured by setting the $bibtex_use
variable to 2 in a configuration file.
-bibtex-
- Never run bibtex or biber. Also, always treat .bbl files as
+ Never run bibtex or biber. Also, always treat .bbl files as
precious, i.e., do not delete them in a cleanup operation.
- A common use for this option is when a document comes from an
- external source, complete with its bbl file(s), and the user
- does not have the corresponding bib files available. In this
- situation use of the -bibtex- option will prevent latexmk from
+ A common use for this option is when a document comes from an
+ external source, complete with its bbl file(s), and the user
+ does not have the corresponding bib files available. In this
+ situation use of the -bibtex- option will prevent latexmk from
trying to run bibtex or biber, which would result in overwriting
of the bbl files.
- This property can also be configured by setting the $bibtex_use
+ This property can also be configured by setting the $bibtex_use
variable to 0 in a configuration file.
-bibtex-cond
- When the source file uses bbl file(s) for the bibliography, run
- bibtex or biber as needed to regenerate the bbl files, but only
- if the relevant bib file(s) exist. Thus when the bib files are
- not available, bibtex or biber is not run, thereby avoiding
- overwriting of the bbl file(s). Also, always treat .bbl files
+ When the source file uses bbl file(s) for the bibliography, run
+ bibtex or biber as needed to regenerate the bbl files, but only
+ if the relevant bib file(s) exist. Thus when the bib files are
+ not available, bibtex or biber is not run, thereby avoiding
+ overwriting of the bbl file(s). Also, always treat .bbl files
as precious, i.e., do not delete them in a cleanup operation.
- This is the default setting. It can also be configured by set-
+ This is the default setting. It can also be configured by set-
ting the $bibtex_use variable to 1 in a configuration file.
- The reason for using this setting is that sometimes a .bbl file
+ The reason for using this setting is that sometimes a .bbl file
is available containing the bibliography for a document, but the
- .bib file is not available. An example would be for a scien-
- tific journal where authors submit .tex and .bbl files, but not
- the original .bib file. In that case, running bibtex or biber
- would not work, and the .bbl file should be treated as a user
- source file, and not as a file that can be regenerated on
- demand.
+ .bib file is not available. An example would be for a
- (Note that it is possible for latexmk to decide that the bib
- file does not exist, even though the bib file does exist and
- bibtex or biber finds it. The problem is that the bib file may
- not be in the current directory but in some search path; the
- places latexmk and bibtex or biber cause to be searched need not
- be identical. On modern installations of TeX and related pro-
- grams this problem should not arise, since latexmk uses the
- kpsewhich program to do the search, and kpsewhich should use the
- same search path as bibtex and biber. If this problem arises,
- use the -bibtex option when invoking latexmk.)
+ 7 August 2018 4
- 25 May 2018 4
+LATEXMK(1) General Commands Manual LATEXMK(1)
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ scientific journal where authors submit .tex and .bbl files, but
+ not the original .bib file. In that case, running bibtex or
+ biber would not work, and the .bbl file should be treated as a
+ user source file, and not as a file that can be regenerated on
+ demand.
+
+ (Note that it is possible for latexmk to decide that the bib
+ file does not exist, even though the bib file does exist and
+ bibtex or biber finds it. The problem is that the bib file may
+ not be in the current directory but in some search path; the
+ places latexmk and bibtex or biber cause to be searched need not
+ be identical. On modern installations of TeX and related pro-
+ grams this problem should not arise, since latexmk uses the
+ kpsewhich program to do the search, and kpsewhich should use the
+ same search path as bibtex and biber. If this problem arises,
+ use the -bibtex option when invoking latexmk.)
-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
+ 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.
- -commands
- List the commands used by latexmk for processing files, and then
- exit.
-
-
- -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
- removed.
- This cleanup is instead of a regular make. See the -gg option
- if you want to do a cleanup then a make.
+ 7 August 2018 5
- 25 May 2018 5
+LATEXMK(1) General Commands Manual LATEXMK(1)
+ -commands
+ List the commands used by latexmk for processing files, and then
+ exit.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -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
+ removed.
+ 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
+ -CA (Obsolete). Now equivalent to the -C option. See that option
for details.
- -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
- source file.
+ 7 August 2018 6
- -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 rather
- than the source file.
- This is the default behavior and corresponds to the behavior of
- 25 May 2018 6
+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,
+ .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
+ source file.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -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
+ rather than the source file.
-
- 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.
- -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-
+ 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
+ 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.)
+ 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,
- -dependents
- Equivalent to -deps.
+ 7 August 2018 7
- -deps- Do not show a list of dependent files after processing. (This
- is the default.)
- -dependents-
- Equivalent to -deps-.
+LATEXMK(1) General Commands Manual LATEXMK(1)
+ and -MP options that behave like those of gcc.)
- 25 May 2018 7
+ -dependents
+ Equivalent to -deps.
+ -deps- Do not show a list of dependent files after processing. (This
+ is the default.)
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -dependents-
+ Equivalent to -deps-.
-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
@@ -488,7 +503,7 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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.
@@ -496,56 +511,56 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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
+ -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
- 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.
+ Execute the specified initialization code before processing.
+ The code is Perl code of the same form as is used in latexmk's
- 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
+ 7 August 2018 8
- 25 May 2018 8
+LATEXMK(1) General Commands Manual LATEXMK(1)
-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-
+ 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
+ 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
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
@@ -554,48 +569,50 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
+ (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.)
- -f Force latexmk to continue document processing despite errors.
+ -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
- (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.
+ 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
- -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-
- figuration file.
+ 7 August 2018 9
- -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.
- 25 May 2018 9
+LATEXMK(1) General Commands Manual LATEXMK(1)
+ (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.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -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-
+ 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
+ reprocess the files.
-g- Turn off -g.
@@ -610,17 +627,17 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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.
@@ -629,105 +646,105 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-latex="COMMAND"
This sets the string specifying the command to run latex, and is
- typically used to add desired options. Since the string nor-
+ typically used to add desired options. Since the string nor-
mally contains spaces, it should be quoted, e.g.,
latexmk -latex="latex --shell-escape %O %S" foo.tex
- 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).
+ The specification of the contents of the string are the same as
- To set the command for running pdflatex (rather than the command
- for latex) see the -pdflatex option.
- -logfilewarninglist
- -logfilewarnings After a run of (pdf)latex, give a list of warn-
- ings about undefined citations and references (unless silent
- mode is on).
+ 7 August 2018 10
- See also the $silence_logfile_warnings configuration variable.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- 25 May 2018 10
+ 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
+ for latex) see the -pdflatex option.
+ -logfilewarninglist
+ -logfilewarnings After a run of (pdf)latex, give a list of warn-
+ ings about undefined citations and references (unless silent
+ mode is on).
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ See also the $silence_logfile_warnings configuration variable.
-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.
-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
-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
+ 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
+ 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
- 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
- option turns off the default behavior.
- -new-viewer-
- 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.
+ 7 August 2018 11
- 25 May 2018 11
+LATEXMK(1) General Commands Manual LATEXMK(1)
+ -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
+ 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
+ option turns off the default behavior.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -new-viewer-
+ 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.
-nobibtex
@@ -736,71 +753,71 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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
+ 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.
- -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.
+ -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,
- and you must have configured the print commands used by latexmk.
- 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.
+ However, printing is enabled by default only under UNIX/Linux
- This option is incompatible with the -pv and -pvc options, so it
- turns them off.
- -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
+ 7 August 2018 12
- 25 May 2018 12
+LATEXMK(1) General Commands Manual LATEXMK(1)
+ 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,
+ and you must have configured the print commands used by latexmk.
+ 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.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ This option is incompatible with the -pv and -pvc options, so it
+ turns them off.
+ -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
"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.
@@ -808,73 +825,73 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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 does latexmk
- then call xdvipdfmx to generate the final pdf file.
+ -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
+ (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.)
- -pdf- Turn off generation of pdf version of document. (This can be
- used to override a setting in a configuration file. It may get
+ -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).
+ If after all options have been processed, pdf generation is
+ still turned off, then generation of a dvi file will be turned
- -pdflatex="COMMAND"
- This sets the string specifying the command to run pdflatex, and
- is typically used to add desired options. Since the string nor-
- mally contains spaces, it should be quoted, e.g.,
- latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S"
- foo.tex
+ 7 August 2018 13
- 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
- 25 May 2018 13
+LATEXMK(1) General Commands Manual LATEXMK(1)
+ 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).
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -pdflatex="COMMAND"
+ This sets the string specifying the command to run pdflatex, and
+ is typically used to add desired options. Since the string nor-
+ mally contains spaces, it should be quoted, e.g.,
+ latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S"
+ foo.tex
- something else).
+ 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).
- 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.
-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.
@@ -882,13 +899,13 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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.
@@ -900,98 +917,99 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
- 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). Oth-
- erwise 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 pre-
- viewer will be used. This option is incompatible with the -p
- and -pvc options, so it turns them off.
+ 7 August 2018 14
- -pv- Turn off -pv.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- 25 May 2018 14
+ Whether to use single or double quotes round the "psnup -2" will
+ 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
+ previewer will be used. This option is incompatible with the -p
+ and -pvc options, so it turns them off.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -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
+ 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.
- Note that if latexmk dies or is stopped by the user, the
+ 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.)
+ 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
- -pvc- Turn off -pvc.
+ 7 August 2018 15
- -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
- like compiling the document.
- -pvctimeout-
- Don't do timeout in pvc mode after inactivity.
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+ it knows how to determine whether an existing previewer is run-
+ ning.)
- 25 May 2018 15
+ -pvc- Turn off -pvc.
+ -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
+ like compiling the document.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -pvctimeout-
+ Don't do timeout in pvc mode after inactivity.
-pvctimeoutmins=<time>
@@ -1002,155 +1020,158 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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
+ 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.
-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-
+ 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
- configuration variable.
- -recorder-
- Do not supply the -recorder option with latex and pdflatex.
+ 7 August 2018 16
- -rules Show a list of latemk's rules and dependencies after processing.
- -rules-
- Do not show a list of latexmk's rules and dependencies after
- processing. (This is the default.)
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
+ 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
+ configuration variable.
- 25 May 2018 16
+ -recorder-
+ Do not supply the -recorder option with latex and pdflatex.
+ -rules Show a list of latemk's rules and dependencies after processing.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -rules-
+ 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
+ -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.
-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
- (pdf)latex and friends.
+ of diagnostics generated. For example, with the default set-
+ tings, the command "latex -interaction=batchmode" is used for
- See also the -logfilewarninglist and -logfilewarninglist-
- options.
- Also reduce the number of informational messages that latexmk
- itself generates.
- 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-
- tex_silent_switch, and $xelatex_silent_switch
+ 7 August 2018 17
- -time Show CPU time used. See also the configuration variable
- $show_time.
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
- 25 May 2018 17
+ (pdf)latex and friends.
+ See also the -logfilewarninglist and -logfilewarninglist-
+ options.
+ Also reduce the number of informational messages that latexmk
+ itself generates.
+ 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-
+ tex_silent_switch, and $xelatex_silent_switch
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ -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
+ 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).
- See also the documentation for the $use_make_for_missing_files
+ 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.
+ Do not use the make program to try to make missing files.
(Default.)
@@ -1158,6 +1179,19 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
Print version number of latexmk.
+
+
+
+
+ 7 August 2018 18
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
-verbose
Opposite of -silent. This is the default setting.
@@ -1165,7 +1199,8 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-view=default, -view=dvi, -view=ps, -view=pdf, -view=none
Set the kind of file used when previewing is requested (e.g., by
the -pv or -pvc switches). The default is to view the "highest"
- kind of requested file (in the low-to-high order dvi, ps, pdf).
+ kind of requested file (in the low-to-high order .dvi, .ps,
+ .pdf).
Note the possibility -view=none where no viewer is opened at
all. One example of is use is in conjunction with the -pvc
@@ -1180,18 +1215,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
tions or references (i.e., undefined citations or references or
about multiply defined references). This is after latexmk has
completed all the runs it needs to try and resolve references
-
-
-
- 25 May 2018 18
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
and citations. Thus -Werror causes latexmk to treat such warn-
ings as errors, but only when they occur on the last run of
(pdf)latex and only after processing is complete. Also can be
@@ -1209,10 +1232,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
[Note: Note that the method of implementation of this option,
but not its intended primary effect, differ from some earlier
- versions of latexmk. Latexmk first uses xelatex to make an xdv
+ versions of latexmk. Latexmk first uses xelatex to make an .xdv
file, and does all the extra runs needed (including those of
bibtex, etc). Only after that does it make the pdf file from
- the xdv file, using xdvipdfmx. This procedure can result in
+ the .xdv file, using xdvipdfmx. This procedure can result in
considerable savings in run time, since the xdv-to-pdf conver-
sion is quite time-consuming when large graphics files are used
in the document.]
@@ -1223,6 +1246,18 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
@@ -1246,18 +1281,6 @@ EXAMPLES
source file changes.
% latexmk -c # remove .aux, .log, .bbl, .blg, .dvi,
-
-
-
- 25 May 2018 19
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
.pdf, .ps & .bbl files
@@ -1289,6 +1312,18 @@ DEALING WITH ERRORS, PROBLEMS, ETC
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.
@@ -1312,18 +1347,6 @@ DEALING WITH ERRORS, PROBLEMS, ETC
This puts a line in the log file that latexmk will treat as implying
that the file bar.baz was read. (At present I don't know a way of
doing this automatically.) Of course, if the file has a different
-
-
-
- 25 May 2018 20
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
name, change bar.baz to the name of your file.
g. See also the section ADVANCED CONFIGURATION: Some extra resources.
@@ -1355,6 +1378,18 @@ CONFIGURATION/INITIALIZATION (RC) FILES
"/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
@@ -1379,17 +1414,6 @@ CONFIGURATION/INITIALIZATION (RC) FILES
case on MS-Windows systems. Otherwise a blank string is used instead of
$HOME, in which case latexmk does not look for an RC file in it.]
-
-
- 25 May 2018 21
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
$XDG_CONFIG_HOME is the value of the environment variable XDG_CON-
FIG_HOME if it exists. If this environment variable does not exist,
but $HOME is non-blank, then $XDG_CONFIG_HOME is set to the default
@@ -1421,6 +1445,17 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
@@ -1445,17 +1480,6 @@ HOW TO SET VARIABLES IN INITIALIZATION FILES
character and array variables have names that begin with a @ character.
Each statement ends with a semicolon.
-
-
- 25 May 2018 22
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
Strings should be enclosed in single quotes. (You could use double
quotes, as in many programming languages. But then the Perl program-
ming language brings into play some special rules for interpolating
@@ -1470,11 +1494,11 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
FORMAT OF COMMAND SPECIFICATIONS
Some of the variables set the commands that latexmk uses for carrying
- out its work, for example to generate a dvi file from a tex file or to
- view a postscript file. This section describes some important features
- of how the commands are specified. (Note that some of the possibili-
- ties listed here do not apply to the $kpsewhich variable; see its docu-
- mentation.)
+ out its work, for example to generate a .dvi file from a .tex file or
+ to view a postscript file. This section describes some important fea-
+ tures of how the commands are specified. (Note that some of the possi-
+ bilities listed here do not apply to the $kpsewhich variable; see its
+ documentation.)
Placeholders: Supposed you wanted latexmk to use the command elatex in
place of the regular latex command, and suppose moreover that you
@@ -1486,6 +1510,18 @@ FORMAT OF COMMAND SPECIFICATIONS
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-
@@ -1505,24 +1541,11 @@ FORMAT OF COMMAND SPECIFICATIONS
%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).
+ .dvi file to ps).
%T The name of the primary tex file.
- %Y
-
-
-
- 25 May 2018 23
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
- Name of directory for auxiliary output files (see the configura-
+ %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
@@ -1543,16 +1566,28 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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 many 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.
+ 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
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
+
+
+
+ 7 August 2018 24
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
bibliography file, the setting for the bibtex command should therefore
be
@@ -1576,18 +1611,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
-
-
-
- 25 May 2018 24
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
command name with "start ", as in
$dvi_previewer = 'start xdvi %O %S';
@@ -1619,6 +1642,18 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
(Note about the above example: Under MS-Windows forward slashes are
+
+
+
+ 7 August 2018 25
+
+
+
+
+
+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
@@ -1641,41 +1676,28 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
Under MS-Windows, this will cause to be run whatever program the system
has associated with dvi files. (The same applies for a postscript
- viewer and a pdf viewer.) But note that this trick is not always
-
-
-
- 25 May 2018 25
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
- suitable 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.
+ 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
+ pdf viewer. As explained elsewhere, acroread under MS-Windows does not
+ work well with latex and latexmk, because acroread locks the pdf file.
Not using a certain command: If a command is not to be run, the command
name NONE is used, as in
$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';
@@ -1685,42 +1707,42 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
return system 'latex', @args;
}
- 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.
+ For some of the more exotic possibilities that then become available,
- 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.
- 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
- extra processing, you could do something like:
+ 7 August 2018 26
- $pdflatex = 'pdflatex --shell-escape %O %S; pst2pdf_for_latexmk
- %B';
- This definition assumes you are using a UNIX-like system (which
- 25 May 2018 26
+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.
+ This is generally the most flexible and portable solution.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ 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
+ extra processing, you could do something like:
+ $pdflatex = 'pdflatex --shell-escape %O %S; pst2pdf_for_latexmk
+ %B';
- 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
@@ -1728,9 +1750,9 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$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.
@@ -1738,93 +1760,105 @@ LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES
Default values are indicated in brackets.
$always_view_file_via_temporary [0]
- Whether ps and pdf files are initially to be made in a temporary
- directory and then moved to the final location. (This applies
- to dvips, dvipdf, and ps2pdf operations, and the filtering oper-
- ators on dvi and ps files. It does not apply to pdflatex,
- unfortunately, since pdflatex provides no way of specifying a
- chosen name for the output file.)
+ 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
+ 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.
- $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
- analysis when fls file doesn't exist or is out of date.
+ 7 August 2018 27
- 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
- 25 May 2018 27
+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.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ $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
+ analysis when fls file doesn't exist or is out of date.
+ 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
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) con-
- tains a relative path, then the path is interpreted relative to
- the document directory.
+ If you also use the -cd option, and $out_dir (or $aux_dir)
+
+
+
+ 7 August 2018 28
+
+
+
+
+
+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
+ 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
-d option.
Note that if $banner is nonzero, the $postscript_mode is assumed
@@ -1833,7 +1867,7 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$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.
@@ -1841,31 +1875,20 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
The banner message to print across each page when converting the
dvi file to postscript. This is equivalent to the -bm option.
-
-
- 25 May 2018 28
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
$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:
@@ -1875,96 +1898,115 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
@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 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.
+ rent version of latexmk, since it has a better method of
+
+
+
+ 7 August 2018 29
+
+
+
+
+
+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"]
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,
+ after that update, the special action will no longer be
+ required.
+
$bibtex_silent_switch ["-terse"]
Switch(es) for the BibTeX processing program when silent mode is
on.
$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
-
-
-
- 25 May 2018 29
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
- 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.
$cleanup_includes_cusdep_generated [0]
- If nonzero, specifies that cleanup also deletes files that are
+ If nonzero, specifies that cleanup also deletes files that are
generated by custom dependencies. (When doing a clean up, e.g.,
+
+
+
+ 7 August 2018 30
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
by use of the -C option, custom dependencies are those listed in
the .fdb_latexmk file from a previous run.)
$cleanup_includes_generated [0]
- If nonzero, specifies that cleanup also deletes files that are
- detected in log file as being generated (see the \openout lines
- in the log file). It will also include files made from these
+ If nonzero, specifies that cleanup also deletes files that are
+ detected in log file as being generated (see the \openout lines
+ in the log file). It will also include files made from these
first generation generated files.
$cleanup_mode [0]
- If nonzero, specifies cleanup mode: 1 for full cleanup, 2 for
- cleanup except for dvi, ps and pdf files, 3 for cleanup except
- for dep and aux files. (There is also extra cleaning as speci-
- fied by the $clean_ext, $clean_full_ext and @generated_exts
+ If nonzero, specifies cleanup mode: 1 for full cleanup, 2 for
+ cleanup except for .dvi, .ps and .pdf files, 3 for cleanup
+ except for dep and aux files. (There is also extra cleaning as
+ specified by the $clean_ext, $clean_full_ext and @generated_exts
variables.)
- This variable is equivalent to specifying one of the -c or -C
- options. But there should be no need to set this variable from
+ This variable is equivalent to specifying one of the -c or -C
+ options. But there should be no need to set this variable from
an RC file.
$clean_ext [""]
- Extra extensions of files for latexmk to remove when any of the
- clean-up options (-c or -C) is selected. The value of this
+ Extra extensions of files for latexmk to remove when any of the
+ clean-up options (-c or -C) is selected. The value of this
variable is a string containing the extensions separated by spa-
ces.
@@ -1972,28 +2014,16 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
be deleted, by using the place holder %R, as in commands, and it
is also possible to use wildcards. Thus setting
-
-
-
- 25 May 2018 30
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
$clean_ext = "out %R-blx.bib %R-figures*.log";
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
+ 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).
$clean_full_ext [""]
- Extra extensions of files for latexmk to remove when the -C
+ Extra extensions of files for latexmk to remove when the -C
option is selected, i.e., extensions of files to remove when the
.dvi, etc files are to be cleaned-up.
@@ -2003,92 +2033,103 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$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
+ 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
+
+
+ 7 August 2018 31
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
+ 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
+ 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
+ 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.)
- 25 May 2018 31
+ 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)
+ 7 August 2018 32
- 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
- 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.
+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");
@@ -2096,488 +2137,477 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
@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.
+ @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
+ 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.
+ Three examples:
- 25 May 2018 32
+ @default_files = ("paper_current");
+ @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
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ 7 August 2018 33
- @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
- 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.
- Three examples:
- @default_files = ("paper_current");
- @default_files = ("paper1", "paper2.tex");
+LATEXMK(1) General Commands Manual LATEXMK(1)
- @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
+ option.
+
+ $dvi_mode [See below for default]
+ 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.
- 25 May 2018 33
+ $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
+ 7 August 2018 34
-LATEXMK(1) General Commands Manual LATEXMK(1)
- $dvi_filter [empty]
- 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
- 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.
+LATEXMK(1) General Commands Manual LATEXMK(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.]
- 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
+ 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
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 dif-
- ferent order:
+ 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
+ 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
+ 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.
- 25 May 2018 34
+ $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
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ 7 August 2018 35
- 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
- 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.
- $dvips_pdf_switch ["-P pdf"]
- Switch(es) for dvips program when pdf file is to be generated
- from ps file.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $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]
+ 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
+ need to change this.
+ $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.
- 25 May 2018 35
-
+ 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
+ 7 August 2018 36
-LATEXMK(1) General Commands Manual LATEXMK(1)
- $failure_cmd [undefined]
- 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
- need to change this.
- $filetime_causality_threshold [5]; $filetime_offset_report_threshold
- [30]. (Units of seconds.)
+LATEXMK(1) General Commands Manual LATEXMK(1)
- 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.
- 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
+ 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
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,
+ 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-
+ ing unrecognized cross references. Equivalent to specifying the
+ -f option.
- 25 May 2018 36
+ @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.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ 7 August 2018 37
- 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-
- 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.
+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
+ 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.
+ You can instruct latex to ignore the offending line as follows:
+ $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: ';
- 25 May 2018 37
+ 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
+ 7 August 2018 38
-LATEXMK(1) General Commands Manual LATEXMK(1)
- 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.
- You can instruct latex to ignore the offending line as follows:
- $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: ';
+LATEXMK(1) General Commands Manual LATEXMK(1)
- 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 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,
+ 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,
- $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate:
+ $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'};
$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
+ 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-
+ 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
+ STDOUT of running the command is then piped to 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 May 2018 38
+ 7 August 2018 39
-LATEXMK(1) General Commands Manual LATEXMK(1)
- (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-
- 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
- STDOUT of running the command is then piped to 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.
+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
+ 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_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
-
-
-
- 25 May 2018 39
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
+ (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' );
@@ -2586,41 +2616,53 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
add_input_ext( 'latex', 'asdf' );
- add the extension 'asdf to latex_input_extensions. (Naturally
+ 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
+ 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.)
$latex_silent_switch ["-interaction=batchmode"]
- Switch(es) for the LaTeX processing program when silent mode is
+ 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
+ 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-
+
+
+
+ 7 August 2018 40
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
errors";
$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":
$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.
@@ -2630,53 +2672,54 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$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.,
-
-
- 25 May 2018 40
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
$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-
+ 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
+ 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
+ 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
+
+
+
+ 7 August 2018 41
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
default extensions are 'tex', 'pdf', 'jpg, and 'png'.
See details of the %latex_input_extensions for other information
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"]
@@ -2686,121 +2729,121 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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.)
-
-
- 25 May 2018 41
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
$MSWin_back_slash [1]
- This configuration variable only has an effect when latexmk is
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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-
+
+
+
+ 7 August 2018 42
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
+ 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
-
+ 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.
- 25 May 2018 42
+ 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.
+ 7 August 2018 43
-LATEXMK(1) General Commands Manual LATEXMK(1)
- disable the security measures (and assume any risks). One way
- of doing this is to temporarily set an operating system environ-
- ment 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.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- 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
+ 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
@@ -2808,106 +2851,95 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$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.)
%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
- not been found, and the file is given without an extension.
- This typically happens when LaTeX commands of the form
+ This variable specifies the extensions tried by latexmk when it
+ finds that a pdflatex 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
+ 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
that equally applies to %pdflatex_input_extensions.
+ $pdflatex_silent_switch ["-interaction=batchmode"]
+ Switch(es) for the pdflatex program (specified in the variable
+ $pdflatex) when silent mode is on.
+ See details of the $latex_silent_switch for other information
+ that equally applies to $pdflatex_silent_switch.
+ $pdf_previewer ["start acroread %O %S"]
+ The command to invoke a pdf-previewer.
- 25 May 2018 43
+ On MS-Windows, the default is changed to "cmd /c start """;
+ under more recent versions of Windows, this will cause to be run
+ whatever command the system has associated with .pdf files. But
+ this may be undesirable if this association is to acroread --
+ see the notes in the explanation of the -pvc option.]
+ On OS-X the default is changed to "open %S", which results in
+ OS-X starting up (and detaching) the viewer associated with the
+ file. By default, for pdf files this association is to OS-X's
+ preview, which is quite satisfactory.
+ WARNING: Problem under MS-Windows: if acroread is used as the
+ pdf previewer, and it is actually viewing a pdf file, the pdf
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ 7 August 2018 44
- $pdflatex_silent_switch ["-interaction=batchmode"]
- Switch(es) for the pdflatex program (specified in the variable
- $pdflatex) when silent mode is on.
- See details of the $latex_silent_switch for other information
- that equally applies to $pdflatex_silent_switch.
- $pdf_previewer ["start acroread %O %S"]
- The command to invoke a pdf-previewer.
- On MS-Windows, the default is changed to "cmd /c start """;
- under more recent versions of Windows, this will cause to be run
- whatever command the system has associated with .pdf files. But
- this may be undesirable if this association is to acroread --
- see the notes in the explanation of the -pvc option.]
+LATEXMK(1) General Commands Manual LATEXMK(1)
- On OS-X the default is changed to "open %S", which results in
- OS-X starting up (and detaching) the viewer associated with the
- file. By default, for pdf files this association is to OS-X's
- preview, which is quite satisfactory.
- WARNING: Problem under MS-Windows: if acroread is used as the
- pdf previewer, and it is actually viewing a pdf file, the pdf
- 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
+ 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
example, SumatraPDF or gsview is used to view pdf files.
- Important note: Normally you will want to have a previewer run
+ 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
+ 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.
$pdf_update_command [""]
- When the pdf previewer is set to be updated by running a com-
- mand, this is the command that is run. See the information for
+ When the pdf previewer is set to be updated by running a com-
+ mand, this is the command that is run. See the information for
the variable $pdf_update_method.
$pdf_update_method [1 under UNIX, 3 under MS-Windows]
- How the pdf viewer updates its display when the pdf file has
- changed. See the information on the variable $dvi_update_method
+ How the pdf viewer updates its display when the pdf file has
+ changed. See the information on the variable $dvi_update_method
for the codes. (Note that information needs be changed slightly
- so that for the value 4, to run a command to do the update, the
- command is specified by the variable $pdf_update_command, and
- for the value 2, to specify update by signal, the signal is
+ so that for the value 4, to run a command to do the update, the
+ command is specified by the variable $pdf_update_command, and
+ for the value 2, to specify update by signal, the signal is
specified by $pdf_update_signal.)
Note that acroread under MS-Windows (but not UNIX) locks the pdf
file, so the default value is then 3.
-
-
- 25 May 2018 44
-
-
-
-
-
-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:
@@ -2915,160 +2947,174 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$pdf_update_method = 4;
$pdf_update_command = "xpdf -remote %R -reload";
- The first setting arranges for the xpdf program to be used in
- its "remote server mode", with the server name specified as the
- rootname of the TeX file. The second setting arranges for
+ The first setting arranges for the xpdf program to be used in
+ its "remote server mode", with the server name specified as the
+ rootname of the TeX file. The second setting arranges for
updating to be done in response to a command, and the third set-
ting sets the update command.
- $pdf_update_signal [Under UNIX: SIGHUP, which is a system-dependent
+ $pdf_update_signal [Under UNIX: SIGHUP, which is a system-dependent
value]
- The number of the signal that is sent to the pdf viewer when it
- is updated by sending a signal -- see the information on the
- variable $pdf_update_method. The default value is the one
+ The number of the signal that is sent to the pdf viewer when it
+ is updated by sending a signal -- see the information on the
+ variable $pdf_update_method. The default value is the one
appropriate for gv on a UNIX system.
$pid_position[1 under UNIX, -1 under MS-Windows]
- The variable $pid_position is used to specify which word in
- lines of the output from $pscmd corresponds to the process ID.
- The first word in the line is numbered 0. The default value of
+ 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
with their default settings of $pscmd.
- Setting the variable to -1 is used to indicate that $pscmd is
+ Setting the variable to -1 is used to indicate that $pscmd is
not to be used.
$postscript_mode [0]
- If nonzero, generate a postscript version of the document.
+ If nonzero, generate a postscript version of the document.
Equivalent to the -ps option.
- If some other request is made for which a postscript file is
+ If some other request is made for which a postscript file is
needed, then $postscript_mode will be set to 1.
$preview_continuous_mode [0]
- If nonzero, run a previewer to view the document, and continue
+ If nonzero, run a previewer to view the document, and continue
running latexmk to keep .dvi up-to-date. Equivalent to the -pvc
- option. Which previewer is run depends on the other settings,
+ option. Which previewer is run depends on the other settings,
see the command line options -view=, and the variable $view.
$preview_mode [0]
If nonzero, run a previewer to preview the document. Equivalent
- to the -pv option. Which previewer is run depends on the other
- settings, see the command line options -view=, and the variable
+ to the -pv option. Which previewer is run depends on the other
+ settings, see the command line options -view=, and the variable
$view.
$printout_mode [0]
- If nonzero, print the document using the command specified in
+ If nonzero, print the document using the command specified in
the $lpr variable. Equivalent to the -p option. This is recom-
- mended not to be set from an RC file, otherwise you could waste
+ mended not to be set from an RC file, otherwise you could waste
lots of paper.
-
-
- 25 May 2018 45
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
$print_type = ["auto"]
- Type of file to printout: possibilities are "auto", "dvi",
+ Type of file to printout: possibilities are "auto", "dvi",
"none", "pdf", or "ps". See the option -print= for the meaning
of the "auto" value.
$pscmd Command used to get all the processes currently run by the user.
- The -pvc option uses the command specified by the variable
- $pscmd to determine if there is an already running previewer,
- and to find the process ID (needed if latexmk needs to signal
+ The -pvc option uses the command specified by the variable
+ $pscmd to determine if there is an already running previewer,
+ and to find the process ID (needed if latexmk needs to signal
the previewer about file changes).
Each line of the output of this command is assumed to correspond
- to one process. See the $pid_position variable for how the
+ to one process. See the $pid_position variable for how the
process number is determined.
- The default for pscmd is "NONE" under MS-Windows and cygwin
- (i.e., the command is not used), "ps -ww -u $ENV{USER}" under
- OS-X, and "ps -f -u $ENV{USER}" under other operating systems
+ The default for pscmd is "NONE" under MS-Windows and cygwin
+ (i.e., the command is not used), "ps -ww -u $ENV{USER}" under
+ OS-X, and "ps -f -u $ENV{USER}" under other operating systems
(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.
+ Command to convert .ps to .pdf file.
$ps_filter [empty]
The postscript file filter to be run on the newly produced post-
- script file before other processing. Equivalent to specifying
+ script file before other processing. Equivalent to specifying
the -pF option.
$ps_previewer ["start gv %O %S", but start %O %S under MS-Windows]
- The command to invoke a ps-previewer. (The default under MS-
- Windows will cause to be run whatever command the system has
+ The command to invoke a ps-previewer. (The default under MS-
+ Windows will cause to be run whatever command the system has
associated with .ps files.)
- Note that gv could be used with the -watch option updates its
- display whenever the postscript file changes, whereas ghostview
- does not. However, different versions of gv have slightly dif-
- ferent ways of writing this option. You can configure this
+ Note that gv could be used with the -watch option updates its
+ display whenever the postscript file changes, whereas ghostview
+ does not. However, different versions of gv have slightly dif-
+ ferent ways of writing this option. You can configure this
variable appropriately.
WARNING: Linux systems may have installed one (or more) versions
- of gv under different names, e.g., ggv, kghostview, etc, but
+ of gv under different names, e.g., ggv, kghostview, etc, but
perhaps not one actually called gv.
- Important note: Normally you will want to have a previewer run
+ 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
+ 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.
-
-
- 25 May 2018 46
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
- $ps_previewer_landscape ["start gv -swap %O %S", but start %O %S under
+ $ps_previewer_landscape ["start gv -swap %O %S", but start %O %S under
MS-Windows]
The command to invoke a ps-previewer in landscape mode.
$ps_update_command [""]
- When the postscript previewer is set to be updated by running a
- command, this is the command that is run. See the information
+ When the postscript previewer is set to be updated by running a
+ command, this is the command that is run. See the information
for the variable $ps_update_method.
$ps_update_method [0 under UNIX, 1 under MS-Windows]
- How the postscript viewer updates its display when the ps file
- has changed. See the information on the variable
- $dvi_update_method for the codes. (Note that information needs
+ How the postscript viewer updates its display when the .ps file
+ has changed. See the information on the variable
+ $dvi_update_method for the codes. (Note that information needs
be changed slightly so that for the value 4, to run a command to
do the update, the command is specified by the variable
- $ps_update_command, and for the value 2, to specify update by
+ $ps_update_command, and for the value 2, to specify update by
signal, the signal is specified by $ps_update_signal.)
- $ps_update_signal [Under UNIX: SIGHUP, which is a system-dependent
+ $ps_update_signal [Under UNIX: SIGHUP, which is a system-dependent
value]
- 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
+
+
+
+ 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.
$pvc_timeout [0]
- If this variable is nonzero, there will be a timeout in pvc
- mode after a period of inactivity. Inactivity means a period
- when latexmk has detected no file changes and hence has not
- taken any actions like compiling the document. The period of
+ If this variable is nonzero, there will be a timeout in pvc
+ mode after a period of inactivity. Inactivity means a period
+ when latexmk has detected no file changes and hence has not
+ taken any actions like compiling the document. The period of
inactivity is in the variable $pvc_timeout_mins.
@@ -3083,124 +3129,124 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$quote_filenames [1]
This specifies whether substitutions for placeholders in command
specifications (as in $pdflatex) are surrounded by double
- quotes. If this variable is 1 (or any other value Perl regards
+ quotes. If this variable is 1 (or any other value Perl regards
as true), then quoting is done. Otherwise quoting is omitted.
- The quoting method used by latexmk is tested to work correctly
- under UNIX systems (including Linux and Mac OS-X) and under MS-
- Windows. It allows the use of filenames containing special
- characters, notably spaces. (But note that many versions of
- latex and pdflatex cannot correctly deal with TeX files whose
- names contain spaces. Latexmk's quoting only ensures that such
+ The quoting method used by latexmk is tested to work correctly
+ under UNIX systems (including Linux and Mac OS-X) and under MS-
+ Windows. It allows the use of filenames containing special
+ characters, notably spaces. (But note that many versions of
+ latex and pdflatex cannot correctly deal with TeX files whose
+ names contain spaces. Latexmk's quoting only ensures that such
filenames are correctly treated by the operating system in pass-
ing arguments to programs.)
+ $recorder [1]
+ Whether to use the -recorder option to latex and pdflatex. Use
+ of this option results in a file of extension .fls containing a
+ list of the files that these programs 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 pdfla-
+ tex.
+ It is generally recommended to use this option (or to configure
+ the $recorder variable to be on.) But it only works if
+ (pdf)latex supports the -recorder option, which is true for most
+ current implementations
- 25 May 2018 47
+ Note about the name of the .fls file: Most implementations of
+ (pdf)latex produce an .fls file with the same basename as the
+ 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
+ 7 August 2018 48
-LATEXMK(1) General Commands Manual LATEXMK(1)
- $recorder [1]
- Whether to use the -recorder option to latex and pdflatex. Use
- of this option results in a file of extension .fls containing a
- list of the files that these programs 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 pdfla-
- tex.
- It is generally recommended to use this option (or to configure
- the $recorder variable to be on.) But it only works if
- (pdf)latex supports the -recorder option, which is true for most
- current implementations
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
- Note about the name of the .fls file: Most implementations of
- (pdf)latex produce an .fls file with the same basename as the
- 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 pdfla-
- tex.fls to a file with the basename of the main LaTeX document,
- e.g., Document.fls.
+ 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
- by latexmk when the -outdir, -output-directory, -auxdir, and/or
- -aux-directory options are used. In that case latexmk needs to
+ INPUTS, BIBINPUTS, and BSTINPUTS. This variable is mainly used
+ by latexmk when the -outdir, -output-directory, -auxdir, and/or
+ -aux-directory options are used. In that case latexmk needs to
communicate appropriately modified search paths to bibtex,
dvipdf, dvips, and (pdf)latex.
- [Comment to technically savvy readers: (pdf)latex doesn't actu-
- ally need the modified search path. But, surprisingly, dvipdf
- and dvips do, because sometimes graphics files get generated in
+ [Comment to technically savvy readers: (pdf)latex doesn't actu-
+ ally need the modified search path. But, surprisingly, dvipdf
+ and dvips do, because sometimes graphics files get generated in
the output or aux directories.]
- 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-
- ties if your operating system is of one kind, but some of your
- software is running under an emulator for the other kind of
- operating system; in that case you'll need to find out what is
- needed, and set $search_path_separator explicitly. (The same
- goes, of course, for unusual operating systems that are not in
+ 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-
+ ties if your operating system is of one kind, but some of your
+ software is running under an emulator for the other kind of
+ operating system; in that case you'll need to find out what is
+ needed, and set $search_path_separator explicitly. (The same
+ goes, of course, for unusual operating systems that are not in
the MSWin, Linux, OS-X, Unix collection.)
$show_time [0]
Whether to show CPU time used.
$silence_logfile_warnings [0]
- Whether after a run of (pdf)latex to summarize warnings in the
- log file about undefined citations and references. Setting
- $silence_logfile_warnings=0 gives the summary of warnings (pro-
- vided silent mode isn't also set), and this is useful to locate
+ Whether after a run of (pdf)latex to summarize warnings in the
+ log file about undefined citations and references. Setting
+ $silence_logfile_warnings=0 gives the summary of warnings (pro-
+ vided silent mode isn't also set), and this is useful to locate
undefined citations and references without searching through the
-
-
-
- 25 May 2018 48
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
- much more verbose log file or the screen output of (pdf)latex.
- But the summary can also be excessively annoying. The default
- is not to give these warnings. The command line options
+ much more verbose log file or the screen output of (pdf)latex.
+ But the summary can also be excessively annoying. The default
+ is not to give these warnings. The command line options
-silence_logfile_warning_list and -silence_logfile_warning_list-
also set this variable.
- Note that multiple occurrences for the same undefined object on
+ Note that multiple occurrences for the same undefined object on
the same page and same line will be compressed to a single warn-
ing.
$silent [0]
- Whether to run silently. Setting $silent to 1 has the same
+ Whether to run silently. Setting $silent to 1 has the same
effect as the -quiet of -silent options on the command line.
$sleep_time [2]
- The time to sleep (in seconds) between checking for source file
+ The time to sleep (in seconds) between checking for source file
changes when running with the -pvc option. This is subject to a
- minimum of one second delay, except that zero delay is also
+ minimum of one second delay, except that zero delay is also
allowed.
- A value of exactly 0 gives no delay, and typically results in
+
+
+ 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.
$texfile_search [""]
- This is an obsolete variable, replaced by the @default_files
+ This is an obsolete variable, replaced by the @default_files
variable.
- For backward compatibility, if you choose to set $tex-
- file_search, it is a string of space-separated filenames, and
+ For backward compatibility, if you choose to set $tex-
+ file_search, it is a string of space-separated filenames, and
then latexmk replaces @default_files with the filenames in $tex-
file_search to which is added "*.tex".
@@ -3208,115 +3254,121 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
See the documentation for $compiling_cmd.
$tmpdir [See below for default]
- Directory to store temporary files that latexmk may generate
+ Directory to store temporary files that latexmk may generate
while running.
- The default under MSWindows (including cygwin), is to set
- $tmpdir to the value of the first of whichever of the system
- environment variables TMPDIR or TEMP exists, otherwise to the
- current directory. Under other operating systems (expected to
- be UNIX/Linux, including OS-X), the default is the value of the
- system environment variable TMPDIR if it exists, otherwise
+ The default under MSWindows (including cygwin), is to set
+ $tmpdir to the value of the first of whichever of the system
+ environment variables TMPDIR or TEMP exists, otherwise to the
+ current directory. Under other operating systems (expected to
+ be UNIX/Linux, including OS-X), the default is the value of the
+ system environment variable TMPDIR if it exists, otherwise
"/tmp".
$use_make_for_missing_files [0]
Whether to use make to try and make files that are missing after
- a run of latex or pdflatex, and for which a custom dependency
- has not been found. This is generally useful only when latexmk
- is used as part of a bigger project which is built by using the
+ a run of latex or pdflatex, and for which a custom dependency
+ has not been found. This is generally useful only when latexmk
+ is used as part of a bigger project which is built by using the
make program.
+ Note that once a missing file has been made, no further calls to
+ make will be made on a subsequent run of latexmk to update the
+ file. Handling this problem is the job of a suitably defined
+ Makefile. See the section "USING latexmk WITH make" for how to
+ do this. The intent of calling make from latexmk is merely to
+ detect dependencies.
+ $view ["default"]
+ Which kind of file is to be previewed if a previewer is used.
+ The possible values are "default", "dvi", "ps", "pdf". The
+ value of "default" means that the "highest" of the kinds of file
+ generated is to be used (among .dvi, .ps and .pdf).
- 25 May 2018 49
-
+ $warnings_as_errors [0]
+ Normally latexmk copies the behavior of latex in treating unde-
+ fined references and citations and multiply defined references
+ as conditions that give a warning but not an error. The vari-
+ able $warnings_as_errors controls whether this behavior is modi-
+ fied.
+ 7 August 2018 50
-LATEXMK(1) General Commands Manual LATEXMK(1)
- Note that once a missing file has been made, no further calls to
- make will be made on a subsequent run of latexmk to update the
- file. Handling this problem is the job of a suitably defined
- Makefile. See the section "USING latexmk WITH make" for how to
- do this. The intent of calling make from latexmk is merely to
- detect dependencies.
- $view ["default"]
- Which kind of file is to be previewed if a previewer is used.
- The possible values are "default", "dvi", "ps", "pdf". The
- value of "default" means that the "highest" of the kinds of file
- generated is to be used (among dvi, ps and pdf).
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $warnings_as_errors [0]
- Normally latexmk copies the behavior of latex in treating unde-
- fined references and citations and multiply defined references
- as conditions that give a warning but not an error. The vari-
- able $warnings_as_errors controls whether this behavior is modi-
- fied.
- 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
+ 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
citations or references (i.e., undefined citations or references
or multiply defined references). This is after latexmk has com-
- pleted all the runs it needs to try and resolve references and
- citations. Thus $warnings_as_errors being nonzero causes
- latexmk to treat such warnings as errors, but only when they
+ pleted all the runs it needs to try and resolve references and
+ citations. Thus $warnings_as_errors being nonzero causes
+ latexmk to treat such warnings as errors, but only when they
occur on the last run of (pdf)latex and only after processing is
- complete. A non-zero value $warnings_as_errors can be set by
+ complete. A non-zero value $warnings_as_errors can be set by
the command-line option -Werror.
The default behavior is normally satisfactory in the usual edit-
- compile-edit cycle. But, for example, latexmk can also be used
- 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-
- ings as errors that require the overall build process to be
- aborted. Of course, since multiple runs of (pdf)latex are gen-
- erally needed to resolve references and citations, what matters
- is not the warnings on the first run, but the warnings on the
+ compile-edit cycle. But, for example, latexmk can also be used
+ 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-
+ ings as errors that require the overall build process to be
+ aborted. Of course, since multiple runs of (pdf)latex are gen-
+ erally needed to resolve references and citations, what matters
+ is not the warnings on the first run, but the warnings on the
last run; latexmk takes this into account appropriately.
- In addition, when preview-continuous mode is used, a non-zero
- value for $warnings_as_errors changes the use of the commands
- $failure_cmd, $warning_cmd, and $success_cmd after a complia-
+ In addition, when preview-continuous mode is used, a non-zero
+ value for $warnings_as_errors changes the use of the commands
+ $failure_cmd, $warning_cmd, and $success_cmd after a complia-
tion. If there are citation or reference warnings, but no other
- errors, the behavior is as follows. If $warning_cmd is set, it
- is used. If it is not set, then then if $warnings_as_errors is
- non-zero and $failure_cmd is set, then $failure_cmd. Otherwise
- $success_cmd is used, if it is set. (The foregoing explanation
+ errors, the behavior is as follows. If $warning_cmd is set, it
+ is used. If it is not set, then then if $warnings_as_errors is
+ non-zero and $failure_cmd is set, then $failure_cmd. Otherwise
+ $success_cmd is used, if it is set. (The foregoing explanation
is rather complicated, because latexmk has to deal with the case
that one or more of the commands isn't set.)
+ $xdvipdfmx ["xdvipdfmx -o %D %O %S"]
+
+ The program to make a pdf file from an xdv file (used in con-
+ junction with xelatex when $pdf_mode=5).
+
+ $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.
- 25 May 2018 50
+ 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.
+ 7 August 2018 51
-LATEXMK(1) General Commands Manual LATEXMK(1)
- $xdvipdfmx ["xdvipdfmx -o %D %O %S"]
- The program to make a pdf file from an xdv file (used in con-
- junction with xelatex when $pdf_mode=5).
- $xdvipdfmx_silent_switch ["-q"]
- Switch(es) for the xdvipdfmx program when silent mode is on.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $xelatex ["xelatex %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_input_extensions
This variable specifies the extensions tried by latexmk when it
@@ -3358,30 +3410,31 @@ CUSTOM DEPENDENCIES
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-
+ lations of the custom dependency list. These are
+
+ add_cus_dep( fromextension, toextension, must, subroutine )
+ remove_cus_dep( fromextension, toextension )
+ show_cus_dep()
+ The arguments are as follows:
+ from extension:
+ The extension of the file we are converting from (e.g. "fig").
+ It is specified without a period.
- 25 May 2018 51
+ 7 August 2018 52
-LATEXMK(1) General Commands Manual LATEXMK(1)
- A better method is to use the subroutines that allow convenient manipu-
- lations of the custom dependency list. These are
- add_cus_dep( fromextension, toextension, must, subroutine )
- remove_cus_dep( fromextension, toextension )
- show_cus_dep()
- The arguments are as follows:
+LATEXMK(1) General Commands Manual LATEXMK(1)
- from extension:
- 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
@@ -3390,44 +3443,57 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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.
+ 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:
- A custom dependency rule is invoked 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 dependency. Then latexmk
- examines whether a file exists with the same name, but with the corre-
- sponding from-extension, as specified in the custom-dependency rule.
- If it does, then the rule is invoked whenever the destination file (the
- one with the to-extension) is out-of-date with respect to the corre-
- sponding source file.
+ 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
+ respect to the corresponding source file.
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,
+ 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
+ file fails to exist.
+ 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
- 25 May 2018 52
+
+ 7 August 2018 53
@@ -3436,13 +3502,16 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- 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.
+ 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.
- One other 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.
+ 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:
@@ -3487,13 +3556,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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\"" );
- 25 May 2018 53
+ 7 August 2018 54
@@ -3502,6 +3568,9 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
@@ -3552,14 +3621,11 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
- 25 May 2018 54
+
+ 7 August 2018 55
@@ -3568,6 +3634,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
@@ -3618,14 +3688,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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 );
- }
- 25 May 2018 55
+ 7 August 2018 56
@@ -3634,6 +3700,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
@@ -3684,14 +3754,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
- 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.
-
- 25 May 2018 56
+ 7 August 2018 57
@@ -3700,6 +3766,10 @@ ADVANCED CONFIGURATION: Some extra resources and advanced tricks
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-
@@ -3750,14 +3820,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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.
-
- 25 May 2018 57
+ 7 August 2018 58
@@ -3766,6 +3832,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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.
@@ -3816,14 +3886,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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.
- 25 May 2018 58
+ 7 August 2018 59
@@ -3832,6 +3898,11 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
+ 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
@@ -3881,15 +3952,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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) :
- mkdir $@
- %.pdf : %.tex
- 25 May 2018 59
+ 7 August 2018 60
@@ -3898,6 +3964,11 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
+ all : $(TARGETS)
+ $(foreach file,$(TARGETS),$(eval -include $(DEPS_DIR)/$(file)P))
+ $(DEPS_DIR) :
+ mkdir $@
+ %.pdf : %.tex
if [ ! -e $(DEPS_DIR) ]; then mkdir $(DEPS_DIR); fi
$(LATEXMK) -pdf -dvi- -ps- -deps-out=$(DEPS_DIR)/$@P $<
%.pdf : %.fig
@@ -3946,16 +4017,11 @@ BUGS
manually refresh (or reopen) display. Or use one of the other preview-
ers and update methods.
- (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
+ (The following isn't really a bug, but concerns features of
- 25 May 2018 60
+ 7 August 2018 61
@@ -3964,6 +4030,11 @@ BUGS
LATEXMK(1) General Commands Manual LATEXMK(1)
+ 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
@@ -3979,7 +4050,7 @@ THANKS TO
AUTHOR
Current version, by John Collins (username jcc8 at node psu.edu).
- (Version 4.56).
+ (Version 4.59).
Released version can be obtained from CTAN:
<http://www.ctan.org/pkg/latexmk/>, and from the author's website
@@ -4016,11 +4087,6 @@ AUTHOR
-
-
-
-
-
- 25 May 2018 61
+ 7 August 2018 62
diff --git a/Master/texmf-dist/scripts/latexmk/latexmk.pl b/Master/texmf-dist/scripts/latexmk/latexmk.pl
index 4f7aa737664..be8879adc80 100755
--- a/Master/texmf-dist/scripts/latexmk/latexmk.pl
+++ b/Master/texmf-dist/scripts/latexmk/latexmk.pl
@@ -121,12 +121,13 @@ use warnings;
$my_name = 'latexmk';
$My_name = 'Latexmk';
-$version_num = '4.56';
-$version_details = "$My_name, John Collins, 25 May 2018";
+$version_num = '4.59';
+$version_details = "$My_name, John Collins, 7 August 2018";
use Config;
use File::Basename;
use File::Copy;
+use File::Spec;
# If possible, use better glob, which does not use space as item separator.
# It's either File::Glob::bsd_glob or File::Glob::glob
@@ -219,58 +220,52 @@ else {
##
## Modification log from 9 Dec 2011 onwards in detail
##
-## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
+## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
##
-## 24,25 May 2018 John Collins Fix problem of .bib files not found with msys.
-## Add use of environment variable LATEXMKRCSYS
-## 12 May 2018 John Collins Simplify code in run_bibtex.
-## 3,9 May 2018 John Collins Improved diagnostics on mismatch of output filenames
-## 28,30 Apr 2018 John Collins Improve error messages for bib files not found
-## 26 Apr 2018 John Collins In testing for different expected and actual
-## output of primary run, normalize $$Pdest, to
-## avoid spurious warnings.
-## 4 Apr 2018 John Collins Version 4.56.
-## Get TeX disribution in .log file
-## Start on dealing with aux_dir and out_dir
-## that didn't get used as intended.
-## And on fls_file that didn't get made when expected.
-## Need to finish:
-## 15 Mar 2018 John Collins Version 4.55d.
-## In test for non-existent file in fls, don't give
-## warning.
-## Add corresponding test for files reported as
-## output that no longer exist.
-## (See minted package for cases where reported
-## input and output files don't exist at end of run.)
-## 15 Mar 2018 John Collins Version 4.55c.
-## Move test for non-existent file in fls to calling routine.
-## 15 Mar 2018 John Collins Deal with non-existent input files reported in
-## fls file. (Needed to work around bug in lualatex
-## in TeXLive 2016, 2017 and pretest 2018 (as of the
-## version of 2018 Mar 4).
-## 2 Feb 2018 John Collins Version 4.55b. Correct parsing of biber's log file.
-## 25 Jan 2018 John Collins Implement $warning_cmd
-## 24 Jan 2018 John Collins Version number to 4.55a. Implement warnings_as_errors option
-## 17 Jan 2018 John Collins Version number to 4.55. Ready for release.
-## Release v. 4.55 on CTAN.
-## 15, 16 Jan 2018 John Collins Correct bug in measuring filetime offset.
-## 14 Jan 2018 John Collins Correct issue with possible filetime offset
-## on remote file system.
-## Define defaults for configuration variables
-## that didn't have defaults.
-## 12 Jan 2018 John Collins Implement pvc timeout
-## 10 Jan 2018 John Collins Ensure $search_path_separator is defined.
-## Set it to MS-Win value for msys.
-## 12 Dec 2017 John Collins Further correct bsd_glob fudge (to be in subroutine my_glob)
-## 8 Dec 2017 John Collins Correct bsd_glob fudge
-## 2 Dec 2017 John Collins Fudge on bsd_glob if it doesn't exist
-## 20 Nov 2017 John Collins Ver. 4.54
+## 7 Aug 2018 John Collins V. 4.59
+## 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
+## for a run of a primary rule. Only give a
+## warning if the extensions differ.
+## In all other cases, there were significant
+## numbers of false positives and no true positives.
+## Improve providing of -no-pdf option to xelatex, to
+## ensure it's used even after a user redefinition
+## of $xelatex. Works if %O is in definition.
+## 25 Jul 2018 John Collins Clean up of code.
+## 24 Jul 2018 John Collins Fatal error when filename has initial '&'. This
+## is not allowed for TeX file, since TeX et al
+## treat the initial '&' as specifying the format.
+## 20,21,23 Jul 2018 John Collins Improve quoting in file-not-found messages
+## On MS-Win change \ to / on files on command line
+## 18,19 Jul 2018 John Collins Complete TEXINPUTS stuff
+## Fix reading of file database file when
+## custom dependency no longer exists.
+## 13,17 Jul 2018 John Collins Deal with double quotes in specified filename,
+## and filenames not allowed by TeX.
+## Illegal characters and unbalanced quotes give fatal error.
+## 10 Jul 2018 John Collins Use TEXINPUTS for finding source file for cus dep.
+## Version 4.58.
+## 21 Jun 2018 John Collins Version 4.57.
+## In get_checksum_md5, open file with mode :bytes,
+## to avoid error about malformed utf8 characters
+## that can happen if PERL_UNICODE is set.
+## 15 Jun 2018 John Collins Configuration to be able to turn off bibtex fudge.
+## 24,25 May 2018 John Collins Fix problem of .bib files not found with msys.
+## Add use of environment variable LATEXMKRCSYS
+## 12 May 2018 John Collins Simplify code in run_bibtex.
+## 3,9 May 2018 John Collins Improved diagnostics on mismatch of output filenames
+## 28,30 Apr 2018 John Collins Improve error messages for bib files not found
+## 26 Apr 2018 John Collins In testing for different expected and actual
+## output of primary run, normalize $$Pdest, to
+## avoid spurious warnings.
##
-## 1998-2017, John Collins. Many improvements and fixes.
-## See CHANGE-log.txt for full list, and CHANGES for summary
+## 1998-2018, John Collins. Many improvements and fixes.
+## See CHANGE-log.txt for full list, and CHANGES for summary
##
-## Modified by Evan McLean (no longer available for support)
-## Original script (RCS version 2.3) called "go" written by David J. Musliner
+## Modified by Evan McLean (no longer available for support)
+## Original script (RCS version 2.3) called "go" written by David J. Musliner
##
##-----------------------------------------------------------------------
@@ -313,6 +308,15 @@ $log_wrap = 79;
'! Unable to load picture or PDF file \\\'([^\\\']+)\\\'.',
);
+# Characters that we won't allow in the name of a TeX file.
+# Notes: Some are disallowed by TeX itself.
+# '\' results in TeX macro expansion
+# '$' results in possible variable substitution by kpsewhich called from tex.
+# '"' gets special treatment.
+# See subroutine test_fix_texnames and its call for their use.
+$illegal_in_texname = "\x00\t\f\n\r\$%\\~\x7F";
+
+
## Hash mapping file extension (w/o period, e.g., 'eps') to a single regexp,
# whose matching by a line in a file with that extension indicates that the
# line is to be ignored in the calculation of the hash number (md5 checksum)
@@ -363,14 +367,15 @@ $tex_distribution = '';
$latex = 'latex %O %S';
$pdflatex = 'pdflatex %O %S';
$lualatex = 'lualatex %O %S';
-# xelatex is used to give xdv file, not pdf file
+# 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';
## Default switches:
$latex_default_switches = '';
$pdflatex_default_switches = '';
$lualatex_default_switches = '';
-$xelatex_default_switches = '';
+$xelatex_default_switches = '-no-pdf';
## Switch(es) to make them silent:
$latex_silent_switch = '-interaction=batchmode';
@@ -542,6 +547,8 @@ foreach (
$biber = 'biber %O %B';
$bibtex = 'bibtex %O %B';
# Switch(es) to make biber & bibtex silent:
+$bibtex_fudge = 1; # Use hack to get bibtex working in old versions that
+ # don't handle output-directory.
$biber_silent_switch = '--onlylog';
$bibtex_silent_switch = '-terse';
$bibtex_use = 1; # Whether to actually run bibtex to update bbl files.
@@ -1876,10 +1883,6 @@ $out_dir_requested = $out_dir;
# 3 log file **not** in aux_dir or out_dir, but in cwd.
$where_log = -1;
-foreach ( 'BIBINPUTS', 'TEXINPUTS' ) {
- if ( exists $ENV{$_} ) { $ENV_ORIG{$_} = $ENV{$_}; }
-}
-
&set_dirs_etc;
if ($bibtex_use > 1) {
@@ -1999,20 +2002,19 @@ if ( ($jobname ne '') && ($num_files > 1) ) {
);
}
-
# Normalize the commands, to have place-holders for source, dest etc:
&fix_cmds;
# Add common options
-add_option( $latex_default_switches, \$latex );
+add_option( $latex_default_switches, \$latex );
add_option( $pdflatex_default_switches, \$pdflatex );
add_option( $lualatex_default_switches, \$lualatex );
-add_option( $xelatex_default_switches, \$xelatex );
+add_option( $xelatex_default_switches, \$xelatex );
-foreach (@extra_latex_options) { add_option( $_, \$latex ); }
+foreach (@extra_latex_options) { add_option( $_, \$latex ); }
foreach (@extra_pdflatex_options) { add_option( $_, \$pdflatex ); }
foreach (@extra_lualatex_options) { add_option( $_, \$lualatex ); }
-foreach (@extra_xelatex_options) { add_option( $_, \$xelatex ); }
+foreach (@extra_xelatex_options) { add_option( $_, \$xelatex ); }
# If landscape mode, change dvips processor, and the previewers:
@@ -2195,6 +2197,8 @@ if ( $dependents_list && ! $preview_continuous_mode ) {
# to avoid getting incorrect blank items when they are split.
foreach ($clean_ext, $clean_full_ext) { s/^\s+//; s/\s+$//; s/\s+/ /g; }
+# Deal with illegal and problematic characters in filename:
+test_fix_texnames( @file_list );
FILE:
foreach $filename ( @file_list )
@@ -2248,11 +2252,11 @@ foreach $filename ( @file_list )
if ( find_basename($filename, $root_filename, $texfile_name) )
{
if ( $force_mode ) {
- warn "$My_name: Could not find file [$texfile_name]\n";
+ warn "$My_name: Could not find file '$texfile_name'\n";
}
else {
&ifcd_popd;
- &exit_msg1( "Could not find file [$texfile_name]",
+ &exit_msg1( "Could not find file '$texfile_name'",
11);
}
}
@@ -2610,6 +2614,75 @@ if ( $where_log == 2 ) {
#############################################################
#############################################################
+sub test_fix_texnames {
+ my $illegal_char = 0;
+ my $unbalanced_quote = 0;
+ my $balanced_quote = 0;
+ foreach (@_) {
+ if ( $^O eq "MSWin32" ) {
+ # On MS-Win, change directory separator '\' to '/', as needed
+ # by the TeX engines, for which '\' introduces a macro name.
+ # Remember that '/' is a valid directory separator in MS-Win.
+ s[\\][/]g;
+ }
+ if ( /[\Q$illegal_in_texname\E]/ ) {
+ $illegal_char++;
+ warn "$My_name: Filename '$_' contains character not allowed for TeX file.\n";
+ }
+ my ($filename, $path) = fileparse( $_ );
+ if ( $do_cd && ($filename =~ /^&/) ) {
+ $illegal_char++;
+ warn "$My_name: Filename part of '$_' contains initial '&', which is\n",
+ " not allowed for TeX file in my -cd mode.\n";
+ }
+ elsif ( /^&/ ) {
+ $illegal_char++;
+ warn "$My_name: Filename '$_' contains initial '&', which is not allowed for TeX file.\n";
+ }
+ my $count_q = ($_ =~ tr/\"//);
+ if ( ($count_q % 2) != 0 ) {
+ warn "$My_name: Filename '$_' contains unbalanced quotes, not allowed.\n";
+ $unbalanced_quote++;
+ }
+ elsif ( $count_q > 0 ) {
+ warn "$My_name: Removed (balanced quotes) from filename '$_',\n";
+ s/\"//g;
+ warn " and obtained '$_'.\n";
+ $balanced_quote++;
+ }
+ }
+ if ($illegal_char || $unbalanced_quote) {
+ die "$My_name: Stopping because of bad filename(s).\n";
+ }
+}
+
+#############################################################
+
+sub ensure_path {
+ # Usage: ensure_path( $var, values ...)
+ # $ENV{$var} is an environment variable (e.g. $ENV{TEXINPUTS}.
+ # Ensure the values are in it, prepending them if not, and
+ # creating the environment variable if it doesn't already exist.
+ my $var = shift;
+ my %cmpts = ();
+ if ( exists $ENV{$var} ) {
+ foreach ( split $search_path_separator, $ENV{$var} ) {
+ if ($_ ne '') { $cmpts{$_} = 1; }
+ }
+ }
+ foreach (@_) {
+ next if ( ($_ eq '') || (exists $cmpts{$_}) );
+ if (exists $ENV{$var}) {
+ $ENV{$var} = $_ . $search_path_separator . $ENV{$var};
+ }
+ else {
+ $ENV{$var} = $_ . $search_path_separator;
+ }
+ }
+}
+
+#############################################################
+
sub set_dirs_etc {
# Normalize versions terminating in directory/path separator
# and versions referring to current directory
@@ -2634,16 +2707,7 @@ sub set_dirs_etc {
# cases by adding the aux_dir to the relevant path search environment
# variables. BIBINPUTS seems to be the only one currently affected.
foreach ( 'BIBINPUTS', 'TEXINPUTS' ) {
- if ( exists $ENV_ORIG{$_} ) {
- $ENV{$_} = $aux_dir.$search_path_separator.$ENV_ORIG{$_};
- }
- else {
- # Note the trailing ":" or ";" which ensures that the last item
- # in the list of paths is the empty path, which actually
- # means the default path, i.e., the following means that
- # the search path is $aux_dir and the standard value.
- $ENV{$_} = $aux_dir.$search_path_separator;
- }
+ ensure_path( $_, $aux_dir );
}
}
}
@@ -2652,7 +2716,7 @@ sub set_dirs_etc {
sub fix_cmds {
# If commands do not have placeholders for %S etc, put them in
- foreach ($latex, $pdflatex, $lpr, $lpr_dvi, $lpr_pdf,
+ foreach ($latex, $lualatex, $pdflatex, $xelatex, $lpr, $lpr_dvi, $lpr_pdf,
$pdf_previewer, $ps_previewer, $ps_previewer_landscape,
$dvi_previewer, $dvi_previewer_landscape,
$kpsewhich
@@ -3873,7 +3937,7 @@ sub run_bibtex {
# Prevent changes we make to environment becoming global:
local %ENV = %ENV;
my ( $base, $path, $ext ) = fileparseA( $$Psource );
- if ( $path ) {
+ if ( $path && $bibtex_fudge ) {
# Since (e.g.,) 'bibtex output/main.aux' doesn't find subsidiary .aux
# files, as from \@include{chap.aux}, we change directory to the
# directory of the top-level .aux file to run bibtex. But we have to
@@ -4871,6 +4935,10 @@ sub parse_fls {
if (/^\s*PWD\s+(.*)$/) {
$cwd = $1;
$$Ppwd_latex = $cwd;
+ if ( $cwd =~ /\"/ ) {
+ warn "$My_name: The working directory has a '\"' character in its name:\n",
+ " '$cwd'\n This can cause me trouble. Beware!\n";
+ }
}
elsif (/^\s*INPUT\s+(.*)$/) {
# Take precautions against aliasing of foo, ./foo and other possibilities for cwd.
@@ -4880,7 +4948,9 @@ sub parse_fls {
# us from coding issues if the PWD contains non-ASCII characters. What
# coding scheme (UTF-8, code page, etc) is used depends on OS, TeX
# implementation, ...
- $file =~ s(^\Q$$Ppwd_latex\E[\\/])();
+ if ( defined $$Ppwd_latex ) {
+ $file =~ s(^\Q$$Ppwd_latex\E[\\/])();
+ }
$file = normalize_filename( $file );
if ( (exists $$Poutputs{$file}) && (! exists $$Pinputs{$file}) ) {
$$Pfirst_read_after_write{$file} = 1;
@@ -4891,7 +4961,8 @@ sub parse_fls {
# Take precautions against aliasing of foo, ./foo and other possibilities for cwd.
my $file = $1;
$file =~ s(^\Q$$Ppwd_latex\E[\\/])();
- $$Poutputs{ normalize_filename( $file )} = 1;
+ $file = normalize_filename( $file );
+ $$Poutputs{$file} = 1;
}
}
close( $fls_file );
@@ -4966,20 +5037,6 @@ sub fix_pattern {
#************************************************************
-sub OS_preferred_filename {
- # Usage: OS_preferred_filename(name)
- # Returns filename with directory separator '/' converted
- # to preferred conventions for current OS.
- # Currently implemented: only '\' for MSWin32
- my $file = $_[0];
- if ( $^O eq 'MSWin32' ) {
- $file =~ s(/)(\\)g;
- }
- return $file;
-}
-
-#************************************************************
-
sub parse_aux {
#Usage: parse_aux( $aux_file, \@new_bib_files, \@new_aux_files, \@new_bst_files )
# Parse aux_file (recursively) for bib files, and bst files.
@@ -5210,8 +5267,9 @@ sub rdb_read {
or return ();
my $errors = 0;
my $state = -1; # Values: -1: before start; 0: outside rule;
- # 1: in source section; 2: in generated file section;
- # 10: ignored rule
+ # 1: in source section;
+ # 2: in generated file section;
+ # 10: ignored rule.
my $rule = '';
my $run_time = 0;
my $source = '';
@@ -5275,19 +5333,29 @@ LINE:
my $toext = $2;
my $base = $3;
$source = "$base.$fromext";
- $dest = "$base.$toext";
- my $PAnew_cmd = ['do_cusdep', ''];
+# $dest = "$base.$toext";
+ my $func_name = '';
foreach my $dep ( @cus_dep_list ) {
- my ($tryfromext,$trytoext,$must,$func_name) = split('\s+',$dep);
+ my ($tryfromext,$trytoext,$must,$try_func_name) = split('\s+',$dep);
if ( ($tryfromext eq $fromext) && ($trytoext eq $toext) ) {
- $$PAnew_cmd[1] = $func_name;
+ $func_name = $try_func_name;
}
}
- # Set source file as non-existent.
- # If it existed on last run, it will be in later
- # lines of the fdb file
- rdb_create_rule( $rule, 'cusdep', '', $PAnew_cmd, 1,
- $source, $dest, $base, 0, $run_time, $check_time, 1 );
+ if ($func_name) {
+ my $PAnew_cmd = ['do_cusdep', $func_name];
+ # Set source file as non-existent.
+ # If it existed on last run, it will be in later
+ # lines of the fdb file
+ rdb_create_rule( $rule, 'cusdep', '', $PAnew_cmd, 1,
+ $source, $dest, $base, 0, $run_time, $check_time, 1 );
+ }
+ else {
+ warn "$My_name: In file-database '$in_name', the custom-dependency rule\n",
+ " '$rule' is not available in this session.\n",
+ " Presumably it's no longer in your configuration for latexmk.\n";
+ $state = 10;
+ next LINE;
+ }
}
elsif ( $rule =~ /^(makeindex|bibtex|biber)\s*(.*)$/ ) {
my $PA_extra_gen = [];
@@ -5435,7 +5503,7 @@ sub rdb_write {
&& ! exists( $current_primaries{$rule} )
)
{
- return;
+ return;
}
print $out_handle "[\"$rule\"] $$Prun_time \"$$Psource\" \"$$Pdest\" \"$$Pbase\" $$Pcheck_time\n";
rdb_do_files(
@@ -5561,7 +5629,6 @@ sub rdb_set_latex_deps {
return;
}
-
#?? # We'll prune this by all files determined to be needed for source files.
#?? my %unneeded_source = %$PHsource;
@@ -5716,22 +5783,12 @@ sub rdb_set_latex_deps {
$missing_dvi_pdf = $$Pdest;
}
elsif ($primary_out ne normalize_filename($$Pdest) ) {
- warn "$My_name: ===For rule '$rule', actual output '$primary_out'\n",
- " ======appears not to match expected output '$$Pdest'.\n",
- " Further diagnostics follow:\n";
my ($actual_base, $actual_path, $actual_ext) = fileparseA( $primary_out );
my ($intended_base, $intended_path, $intended_ext) = fileparseA( $$Pdest );
- if ( $actual_base ne $intended_base ) {
- warn " --The base names of the files are different. That is strange!!\n";
- }
- if ( $actual_path ne $intended_path ) {
- warn " --The paths of the files are different. I may have misunderstood\n",
- " different names for the same directory, which is innocuous,\n",
- " or there may be a configuration error.\n";
- }
if ( $actual_ext ne $intended_ext ) {
- warn " --The extensions of the files are different, i.e., the\n",
- " intended and actual types of the output differ.\n";
+ warn "$My_name: ===For rule '$rule', the extensions differ between the\n",
+ " actual output file '$primary_out',\n",
+ " and the expected output '$$Pdest'.\n";
if ( ! exists $allowed_output_ext{$actual_ext} ) {
warn " Actual output file has an extension '$actual_ext' that\n",
" is not one I know about\n";
@@ -5887,7 +5944,8 @@ NEW_SOURCE:
# File was result of conversion by (pdf)latex.
my $cnv_source = $conversions{$new_source};
rdb_ensure_file( $rule, $new_source );
- if ($cnv_source) {
+# if ($cnv_source && ($cnv_source !~ /\"/ ) ) {
+ if ($cnv_source ) {
# Conversion from $cnv_source to $new_source
# implies that effectively $cnv_source is a source
# of the (pdf)latex run.
@@ -6058,6 +6116,7 @@ MISSING_FILE:
my $found = 0;
foreach my $file (keys %new_includes) {
+# if ( $file =~ /\"/ ) {next; }
my $stripped = $file;
$stripped =~ s{^\./}{};
if ( exists $PHsource{$file} ) {
@@ -6099,6 +6158,27 @@ sub rdb_set_dependents {
#************************************************************
+sub rdb_find_source_file {
+ # Helper for searching dependencies in all paths inside the TEXINPUTS
+ # environment variable.
+ my $test = "$_[0].$_[1]";
+ if ( -e $test ) {
+ return $_[0];
+ }
+ if ( exists $ENV{TEXINPUTS} ) {
+ foreach my $searchpath (split $search_path_separator, $ENV{TEXINPUTS}) {
+ my $file = File::Spec->catfile($searchpath,$_[0]);
+ my $test = "$file.$_[1]";
+ if ( -e $test ) {
+ return $file;
+ }
+ }
+ }
+ return "$_[0]";
+}
+
+#************************************************************
+
sub rdb_one_dep {
# Helper for finding dependencies. One case, $rule and $file given
# Assume file (and rule) context for DESTINATION file.
@@ -6118,6 +6198,7 @@ DEP:
foreach my $dep ( @cus_dep_list ) {
my ($fromext,$proptoext,$must,$func_name) = split('\s+',$dep);
if ( $toext eq $proptoext ) {
+ $base_name = rdb_find_source_file($base_name, $fromext);
my $source = "$base_name.$fromext";
# Found match of rule
if ($diagnostics) {
@@ -6125,22 +6206,20 @@ DEP:
}
if ( -e $source ) {
$$Pfrom_rule = "cusdep $fromext $toext $base_name";
-#?? print "?? Ensuring rule for '$$Pfrom_rule'\n";
+ my $new_new_dest = "$base_name.$toext";
+ if ($new_new_dest ne $new_dest) {
+ rdb_ensure_file( $rule, $new_new_dest );
+ $new_dest = $new_new_dest;
+ }
local @PAnew_cmd = ( 'do_cusdep', $func_name );
if ( !-e $new_dest ) {
push @new_sources, $new_dest;
}
if (! rdb_rule_exists( $$Pfrom_rule ) ) {
- print "=== Creating rule for '$$Pfrom_rule'\n";
+ print "$My_name: === Creating rule '$$Pfrom_rule'\n" if $diagnostics;
rdb_create_rule( $$Pfrom_rule, 'cusdep', '', \@PAnew_cmd, 3,
$source, $new_dest, $base_name, 0 );
}
- else {
- rdb_one_rule(
- $$Pfrom_rule,
- sub{ @$PAint_cmd = @PAnew_cmd; $$Pdest = $new_dest;}
- );
- }
return;
}
else {
@@ -6170,6 +6249,7 @@ DEP:
# This normally results from \includegraphics{A}
# without graphics extension for file, when file does
# not exist. So we will try to find something to make it.
+ $base_name = rdb_find_source_file($base_name, $fromext);
my $source = "$base_name.$fromext";
if ( -e $source ) {
$new_dest = "$base_name.$proptoext";
@@ -6179,15 +6259,10 @@ DEP:
if $diagnostics > -1;
local @PAnew_cmd = ( 'do_cusdep', $func_name );
if (! rdb_rule_exists( $from_rule ) ) {
+ print "$My_name: === Creating rule '$$Pfrom_rule'\n" if $diagnostics;
rdb_create_rule( $from_rule, 'cusdep', '', \@PAnew_cmd, 3,
$source, $new_dest, $base_name, 0 );
}
- else {
- rdb_one_rule(
- $$Pfrom_rule,
- sub{ @$PAint_cmd = @PAnew_cmd; $$Pdest = $new_dest;}
- );
- }
rdb_ensure_file( $rule, $new_dest, $from_rule );
# We've now got a spurious file in our rule. But don't mess
# with deleting an item we are in the middle of!
@@ -7031,6 +7106,7 @@ sub rdb_run1 {
my @biber_source = ( );
my $retcode = check_biber_log( $$Pbase, \@biber_source );
foreach my $source ( @biber_source ) {
+# if ( $source =~ /\"/ ) {next; }
print " ===Source file '$source' for '$rule'\n"
if ($diagnostics);
rdb_ensure_file( $rule, $source );
@@ -7844,6 +7920,12 @@ sub rdb_create_rule {
$set_file_not_exists ) {
if (! defined $_) { $_ = ''; }
}
+ if ( ($source =~ /\"/) || ($dest =~ /\"/) || ($base =~ /\"/) ) {
+ die "$My_name: Error. In rdb_create_rule there is a double quote in one of\n",
+ " source, destination or base parameters:\n",
+ " '$source', '$dest', '$base'\n",
+ " I cannot handle this.\n";
+ }
foreach ( $needs_making, $run_time, $check_time, $test_kind ) {
if (! defined $_) { $_ = 0; }
}
@@ -7901,6 +7983,16 @@ sub rdb_add_generated {
#************************************************************
+sub rdb_remove_generated {
+# Assume rule context.
+# Remove arguments from hash of generated files
+ foreach (@_) {
+ delete $$PHdest{$_};
+ }
+} #END rdb_remove_generated
+
+#************************************************************
+
sub rdb_ensure_file {
# rdb_ensure_file( rule, file[, fromrule[, set_not_exists]] )
# Ensures the source file item exists in the given rule.
@@ -7916,10 +8008,16 @@ sub rdb_ensure_file {
my $rule = shift;
local ( $new_file, $new_from_rule, $set_not_exists ) = @_;
if ( ! rdb_rule_exists( $rule ) ) {
- die_trace( "$My_name: BUG in rdb_ensure_file: non-existent rule '$rule'" );
+ die_trace( "$My_name: BUG in call to rdb_ensure_file: non-existent rule '$rule'" );
}
if ( ! defined $new_file ) {
- die_trace( "$My_name: BUG in rdb_ensure_file: undefined file for '$rule'" );
+ die_trace( "$My_name: BUG in call to rdb_ensure_file: undefined file for '$rule'" );
+ }
+ if ( $new_file =~ /\"/ ) {
+ warn "$My_name: in rdb_ensure_file for rule '$rule', there is a double quote in\n",
+ " the filename: '$new_file'.\n",
+ " I cannot handle this, will ignore this file.\n";
+ return;
}
if ( ! defined $set_not_exists ) { $set_not_exists = 0; }
rdb_one_rule( $rule,
@@ -7974,6 +8072,7 @@ sub rdb_set_source {
if (!$rule) { return; }
my %files = ();
foreach (@_) {
+# if ( /\"/ ) {next; }
rdb_ensure_file( $rule, $_ );
$files{$_} = 1;
}
@@ -7985,6 +8084,36 @@ sub rdb_set_source {
#************************************************************
+sub rdb_change_dest {
+ # Assumes rule context.
+ # Usage change_dest( new_dest [, flag] )
+ # Changes destination for this rule. Fixes from_rule links.
+ # If flag set, make the new_dest a source file in any rule
+ # for which the old destination is already set.
+ # No action if there's no change of destination.
+ local ($new_dest, $flag) = @_;
+ local $old_dest = $$Pdest;
+ if ($old_dest eq $new_dest) { return; }
+# if ( $new_dest =~ /\"/ ) { return; }
+ rdb_remove_generated( $old_dest );
+ rdb_add_generated( $new_dest );
+ if ($flag) {
+ print "rdb_change_dest: fixing dependencies\n";
+ rdb_for_all( sub{ if ( rdb_file_exists( $rule, $old_dest ) ) {
+ rdb_ensure_file( $rule, $new_dest );
+ rdb_remove_files( $rule, $old_dest );
+ }
+ }
+ );
+ }
+ $$Pdest = $new_dest;
+ # ??? Do I need to fix from_rule setting?
+ #&rdb_make_links;
+ return;
+} #END rdb_change_dest
+
+#************************************************************
+
sub rdb_rule_exists {
# Call rdb_rule_exists($rule): Returns whether rule exists.
my $rule = shift;
@@ -8337,16 +8466,12 @@ sub get_checksum_md5 {
#&traceback;
#warn "======= GETTING MD5: $source\n";
- if ( $source eq "" ) {
- # STDIN:
- open( $input, '-' );
- }
- elsif ( -d $source ) {
+ if ( -d $source ) {
# We won't use checksum for directory
return 0;
}
else {
- open( $input, '<', $source )
+ open( $input, '<:bytes', $source )
or return 0;
my ($base, $path, $ext) = fileparseA( $source );
$ext =~ s/^\.//;
@@ -8354,7 +8479,6 @@ sub get_checksum_md5 {
$ignore_pattern = $hash_calc_ignore_pattern{$ext};
}
}
-
if ( defined $ignore_pattern ) {
while (<$input>) {
if ( ! /$ignore_pattern/ ){