summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-09-14 20:39:49 +0000
committerKarl Berry <karl@freefriends.org>2020-09-14 20:39:49 +0000
commitbe357e6a36038773cbb85136eaa8a55a6a1b28f4 (patch)
treed49908fad3947e71b39910bdfac07a5128c5f44c
parente1dfc6620923c10a348546ebe7add8e2d8707a6a (diff)
latexmk (14sep20)
git-svn-id: svn://tug.org/texlive/trunk@56344 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/latexmk/latexmk.pl103
-rw-r--r--Master/texmf-dist/doc/man/man1/latexmk.1193
-rw-r--r--Master/texmf-dist/doc/man/man1/latexmk.man1.pdfbin215231 -> 213929 bytes
-rw-r--r--Master/texmf-dist/doc/support/latexmk/CHANGES12
-rw-r--r--Master/texmf-dist/doc/support/latexmk/INSTALL2
-rw-r--r--Master/texmf-dist/doc/support/latexmk/README6
-rw-r--r--Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc71
-rw-r--r--Master/texmf-dist/doc/support/latexmk/example_rcfiles/fix-aux.latexmkrc20
-rw-r--r--Master/texmf-dist/doc/support/latexmk/latexmk.pdfbin192813 -> 192124 bytes
-rw-r--r--Master/texmf-dist/doc/support/latexmk/latexmk.txt2662
-rwxr-xr-xMaster/texmf-dist/scripts/latexmk/latexmk.pl103
-rwxr-xr-xMaster/texmf-dist/source/support/latexmk/latexmk.bat21
12 files changed, 1710 insertions, 1483 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl b/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
index efe984e9dd4..0f5c35988f5 100755
--- a/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
+++ b/Build/source/texk/texlive/linked_scripts/latexmk/latexmk.pl
@@ -162,6 +162,34 @@ use warnings;
##
## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
##
+## 13 Sep 2020 John Collins V. 4.70a. Updates in comments about bibtex.
+## 28 Aug 2020 John Collins Correct $biber and $bibtex to use %S not %B
+## 24 Aug 2020 John Collins Make sure bibtex/biber rules when created for
+## missing bbl file have correct path for source
+## and destination when out/aux dir used.
+## 16 Jun 2020 John Collins Warning when bibtex fudge is used.
+## Change default $bibtex_fudge to 0. This is safe with
+## at least bibtex in TeXLive 2019 or later, and in current
+## MiKTeX. This version of latexmk is distributed in TeXLive
+## and MiKTeX with a recent enough version of bibtex.
+## Previously, there was a bug in bibtex that prevented it
+## working correctly when -output-directory is used. Latexmk
+## took special action to evade the bug, but at the expense
+## of problems when a .bib file is specified in a directory
+## relative to the document directory.
+## V. 4.69c
+## 9 Jun 2020 John Collins Fix problems with excess calls to parse_log, and messages
+## about changing rule structure when .fdb_latexmk file
+## does not exist.
+## Making quoting (or not) of output and aux directories
+## for option to *latex obey $quote_filenames.
+## 8 Jun 2020 John Collins Engine detection: note that recent lualatex
+## uses luaHBtex, not luatex. So I modified the one
+## place that the name of the $engine is used.
+## 6 May 2020 John Collins Add diagnostic for changed environment variables
+## 27 Apr 2020 John Collins Put ./ for latexmkrc files in current directory
+## V. 4.69b
+## Current version (4.69a, 17 Apr 2020) to CTAN
## 16 Apr 2020 John Collins Correct contents of "All targets (...) are up-to-date" message
## V. 4.69a.
## 12 Mar 2020 John Collins Version is 4.69
@@ -280,8 +308,8 @@ use warnings;
$my_name = 'latexmk';
$My_name = 'Latexmk';
-$version_num = '4.69a';
-$version_details = "$My_name, John Collins, 17 Apr. 2020";
+$version_num = '4.70a';
+$version_details = "$My_name, John Collins, 13 September 2020";
use Config;
use File::Basename;
@@ -623,11 +651,15 @@ foreach (
## Command to invoke biber & bibtex
-$biber = 'biber %O %B';
-$bibtex = 'bibtex %O %B';
+$biber = 'biber %O %S';
+$bibtex = 'bibtex %O %S';
# 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.
+$bibtex_fudge = 0; # Don't use hack to get bibtex working in old versions that
+ # don't handle output-directory. When this version of
+ # latexmk is part of a distribution of TeX, the
+ # accompanying bibtex should also be recent enough
+ # (e.g., TeXLive 2019 or later, current MiKTeX) not to
+ # need the hack/fudge.
$biber_silent_switch = '--onlylog';
$bibtex_silent_switch = '-terse';
$bibtex_use = 1; # Whether to actually run bibtex to update bbl files.
@@ -1739,7 +1771,7 @@ if ( $auto_rc_use && ($HOME ne "" ) ) {
}
if ( $auto_rc_use ) {
# Rc file in current directory:
- read_first_rc_file_in_list( "latexmkrc", ".latexmkrc" );
+ read_first_rc_file_in_list( "./latexmkrc", "./.latexmkrc" );
}
## Process command line args.
@@ -2213,15 +2245,16 @@ if ( $recorder ) {
# possible cd to the document directory, since the directories can be
# relative to the document.
+$q = $quote_filenames ? '"' : '';
if ( $out_dir ) {
- add_option( "-output-directory=\"$out_dir\"",
+ add_option( "-output-directory=$q$out_dir$q",
\$latex, \$pdflatex, \$lualatex, \$xelatex );
}
if ( $aux_dir && ($aux_dir ne $out_dir) ) {
# N.B. If $aux_dir and $out_dir are the same, then the -output-directory
# option is sufficient, especially because the -aux-directory exists
# only in MiKTeX, not in TeXLive.
- add_option( "-aux-directory=\"$aux_dir\"",
+ add_option( "-aux-directory=$q$aux_dir$q",
\$latex, \$pdflatex, \$lualatex, \$xelatex );
}
@@ -2666,7 +2699,7 @@ foreach $filename ( @file_list )
sub{ if ( $$Ptest_kind == 1 ) { $$Ptest_kind = 3;} }
);
if ( -e $log_name ) {
- rdb_for_some( [keys %possible_primaries], \&rdb_set_latex_deps );
+ rdb_for_some( [keys %current_primaries], \&rdb_set_latex_deps );
}
}
foreach $rule ( &rdb_accessible ) {
@@ -2897,6 +2930,9 @@ sub ensure_path {
else {
$ENV{$var} = $_ . $search_path_separator;
}
+ if (!$silent) {
+ print "Set environment variable $var='$ENV{$var}'\n";
+ }
}
}
@@ -4292,11 +4328,13 @@ sub run_bibtex {
local %ENV = %ENV;
my ( $base, $path, $ext ) = fileparseA( $$Psource );
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
- # fix search paths for .bib and .bst, since they may be specified
- # relative to the document directory.
+ # Up to TeXLive 2018, the following was true; situation has changed since.
+ # When an output directory is specified and with a bibtex from 2018 or
+ # earlier, running 'bibtex output/main.aux' doesn't find subsidiary .aux
+ # files, as from \@include{chap.aux}. To evade the bug, we change
+ # directory to the directory of the top-level .aux file to run bibtex.
+ # But we have to fix search paths for .bib and .bst, since they may be
+ # specified relative to the document directory.
my $cwd = good_cwd();
foreach ( 'BIBINPUTS', 'BSTINPUTS' ) {
if ( exists $ENV{$_} ) {
@@ -4308,7 +4346,16 @@ sub run_bibtex {
}
pushd( $path );
if (!$silent) {
- print "$My_name: changed directory to '$path'\n",
+ print "$My_name: ==========WARNING:=================\n",
+ "I am taking action to evade a bug/feature in older versions of bibtex\n",
+ "This may give problems under some situations, symptomized by bibtex not\n",
+ "finding a .bib file or an aux file.\n",
+ "Provided you have a recent version of bibtex (about 2019 or later) you\n",
+ "can avoid the problems by putting '\$bibtex_fudge = 0;' in an\n",
+ "initialization file (a latexmrc file for $my_name.\n",
+ "\n",
+ "Here my bug-evading action:\n",
+ "I temporarily changed directory to '$path'\n",
"Set BIBINPUTS='$ENV{BIBINPUTS}'\n",
"Set BSTINPUTS='$ENV{BSTINPUTS}'\n";
}
@@ -4568,6 +4615,8 @@ sub parse_log {
if ( ! open( $log_file, "<$log_name" ) ) {
return 0;
}
+ print "$My_name: Examining '$log_name'\n"
+ if not $silent;
if ($log_file_binary) { binmode $log_file; }
# Collect lines of log file
my @lines = ();
@@ -4608,6 +4657,7 @@ sub parse_log {
# LuaTeX sometimes at 80. Xetex 80 or longer with non-ascii characters.
while ( ( ($len == $log_wrap)
|| ( ($engine eq 'LuaTeX') && ($len == $log_wrap+1) )
+ || ( ($engine eq 'LuaHBTeX') && ($len == $log_wrap+1) )
|| ( ($engine eq 'XeTeX') && ($len >= $log_wrap+1) )
)
&& !eof($log_file) ) {
@@ -4867,10 +4917,15 @@ LINE:
next LINE;
}
elsif ( /^No file (.*?\.bbl)./ ) {
- # When (pdf)latex is run with an -output-directory
- # or an -aux_directory, the file name does not contain
- # the output path; fix this, after removing quotes:
- my $bbl_file = normalize_force_directory( $aux_dir1, $1 );
+ my $bbl_file = clean_filename($1);
+ my $aux_file = $bbl_file;
+ $aux_file =~ s/\.bbl$/\.aux/;
+ # When aux dir used (may equal out dir), name of missing file fails
+ # to have correct directory. If corresponding aux file exists,
+ # with name prefixed by aux dir, then apply prefix to bbl_file.
+ if (-e $aux_dir1 . $aux_file) {
+ $bbl_file = $aux_dir1 . $bbl_file;
+ }
warn "$My_name: Non-existent bbl file '$bbl_file'\n $_\n";
$dependents{$bbl_file} = 0;
push @bbl_files, $bbl_file;
@@ -7720,6 +7775,7 @@ sub rdb_run1 {
# Find any internal command
my @int_args = @$PAint_cmd;
+
my $int_cmd = shift @int_args;
my @int_args_for_printing = @int_args;
foreach (@int_args_for_printing) {
@@ -8993,7 +9049,12 @@ sub show_array {
# Then print rest of @_, one item per line preceeded by some space
warn "$_[0]\n";
shift;
- if ($#_ >= 0) { foreach (@_){ warn " $_\n";} }
+ if ($#_ >= 0) {
+ foreach (@_){
+ if (defined $_ ) { warn " $_\n"; }
+ else { warn " undef\n"; }
+ }
+ }
else { warn " NONE\n"; }
}
diff --git a/Master/texmf-dist/doc/man/man1/latexmk.1 b/Master/texmf-dist/doc/man/man1/latexmk.1
index 2266b4df6e7..98264b7aa9f 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 "17 April 2020" ""
+.TH LATEXMK 1 "13 September 2020" ""
.SH NAME
latexmk \- generate LaTeX document
.SH SYNOPSIS
@@ -15,7 +15,8 @@ commands to generate a .dvi, .ps, .pdf and/or hardcopy version of the
document.
.PP
By default \fIlatexmk\fR will run the commands necessary to generate
-a .dvi file.
+a .dvi file, which copies the behavior of earlier versions when only
+\fIlatex\fR was available.
.PP
\fILatexmk\fR can also be set to run continuously with a suitable
previewer. In that case the \fIlatex\fR program (or one of its
@@ -26,7 +27,7 @@ updates the on-screen view of the compiled document.
\fILatexmk\fR determines which are the source files by examining the
log file. (Optionally, it also examines the list of input and output
files generated by the \fB-recorder\fR option of modern versions of
-\fIlatex\fR (and \fIpdflatex\fR, \fIxelatex\fR, \fIlualatex\fR, etc).
+\fIlatex\fR (and \fIpdflatex\fR, \fIxelatex\fR, \fIlualatex\fR).
See the documentation for the \fB-recorder\fR option of \fIlatexmk\fR
below.) When \fIlatexmk\fR is run, it examines properties of the
source files, and if any have been changed since the last document
@@ -73,7 +74,7 @@ leftover from older versions of \fIlatexmk\fR, but \fBare currently
non-functional\fR.
More flexibility can
be obtained in current versions, since the command strings for running
-\fIlatex\fR, \fIpdflatex\fR, etc can now be configured to run multiple
+\fI*latex\fR can now be configured to run multiple
commands.
This also extends the possibility of postprocessing generated files.
.PP
@@ -111,34 +112,39 @@ In general the command line to invoke \fIlatexmk\fR has the form
All options can be introduced by single or double "-" characters,
e.g., "latexmk -help" or "latexmk --help".
-\fBNote 1\fR: \fBIn addition to the options in the list below,
+\fBNote 1\fR: In the documentation, '\fI*latex\fR' means any of the
+supported engines, i.e., currently \fIlatex\fR, \fIlualatex\fR,
+\fIpdflatex\fR, \fIxelatex\fR. Mention of a specific one of these normally
+refers that specific engines. Earlier versions of this documentation
+weren't so consistent.
+
+\fBNote 2\fR: \fBIn addition to the options in the list below,
\fIlatexmk\fR recognizes almost all the options recognized by the
-\fIlatex\fR, \fIpdflatex\fR programs (and their relatives) in their
+\fI*latex\fR in their
current TeXLive and MiKTeX implementations. Some of the options for
these programs also trigger special action or behavior by
\fIlatexmk\fR, in which case they have specific explanations in this
document. Otherwise, they
-are just passed through to a called \fIlatex\fR or \fIpdflatex\fR
+are just passed through to a called \fI*latex\fR
program. Run \fIlatexmk\fR with the \fB-showextraoptions\fR to get a
list of the options that \fIlatexmk\fR accepts and that are simply
-passed through to \fIlatex\fR or \fIpdflatex\fR (etc). See also the
+passed through to \fI*latex\fR. See also the
explanation of the \fB-showextraoptions\fR option for more
information.
-\fBNote 2\fR: In this documentation, the program \fIpdflatex\fR is often
-referred to. Users of programs like \fIlualatex\fR and \fIxelatex\fR
-should know that from \fIlatexmk\fR's point of view, these other
-programs behave very like \fIpdflatex\fR, i.e., they make a pdf file from a
-tex file, etc. So whenever \fIpdflatex\fR is mentioned without
-mention of the other programs, the statements apply equally to
-\fIlualatex\fR, \fIxelatex\fR, and any other similar programs.
-\fILatexmk\fR can be easily configured to use whichever of these
-programs is needed. See the documentation for the following options:
-\fB-pdflua\fR, \fB-pdfxe\fR, \fB-lualatex\fR, and \fB-xelatex\fR,
-and also see the documentation for the
-\fI$pdflatex\fR, \fI$lualatex\fR, and \fI$xelatex\fR configuration variables.
-At present \fIlatexmk\fR does not do automatic detection of which
-program is to be used.
+\fBNote 3\fR: In this documentation, the term \fI*latex\fR is often
+referred to, which refers to all the supported \fIlatex\fR-like programs,
+whether the original \fIlatex\fR, or the later \fIpdflatex\fR,
+\fIxelatex\fR, and \fIlualatex\fR. Users should know that from
+\fIlatexmk\fR's point of view, all of these programs behave very much
+alike, with the sole exception that by default \fIlatex\fR produces a dvi
+file and all the others produce a pdf file. \fILatexmk\fR can be easily
+configured to use whichever of these programs is needed. See the
+documentation for the following options: \fB-pdflua\fR, \fB-pdfxe\fR,
+\fB-lualatex\fR, and \fB-xelatex\fR, and also see the documentation for the
+\fI$latex\fR, \fI$pdflatex\fR, \fI$lualatex\fR, and \fI$xelatex\fR
+configuration variables. At present \fIlatexmk\fR does not do automatic
+detection of which program is to be used.
\fBDefinitions of options and arguments\fR
@@ -179,11 +185,11 @@ Windows, and is accepted by \fIlatex\fR etc.
.TP
.B -auxdir=FOO or -aux-directory=FOO
-Sets the directory for auxiliary output files of (pdf)latex
+Sets the directory for auxiliary output files of *latex
(.aux, .log etc). This
-achieves its effect by the \fB-aux-directory\fR option of (pdf)latex,
+achieves its effect by the \fB-aux-directory\fR option of *latex,
which currently is only implemented on the MiKTeX version of
-(pdf)latex.
+*latex.
See also the \fB-outdir\fR/\fB-output-directory\fR options, and the
\fI$aux_dir\fR, \fI$out_dir\fR, and \fI$search_path_separator\fR
@@ -373,7 +379,7 @@ 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
-\fIlatex\fR and \fIpdflatex\fR programs. However, it is not desirable
+\fI*latex\fR programs. However, it is not desirable
behavior when \fIlatexmk\fR is invoked by a GUI configured to invoke
\fIlatexmk\fR with a full pathname for the source file. See the
\fB-cd\fR option.
@@ -569,7 +575,7 @@ which is the basename of the specified TeX file. (At present, STRING
should not contain spaces.)
This is like the same option for current implementations of the
-\fIlatex\fR, \fIpdflatex\fR, etc, and the passing of this option to
+\fI*latex\fR, and the passing of this option to
these programs is part of \fIlatexmk\fR's implementation of
\fB-jobname\fR.
@@ -579,7 +585,7 @@ file. The primary purpose is when multiple files are specified on the
command line to \fIlatexmk\fR, and you wish to use a jobname with a
different file-dependent value for each file. For example, suppose
you had .tex files test1.tex and test2.tex, and you wished to compare
-the results of compilation by \fIpdflatex\fR and those with
+the results of compilation by \fI*latex\fR and those with
\fIxelatex\fR. Then under a unix-type operating system you could use
the command line
@@ -640,7 +646,7 @@ To set the command for running \fIpdflatex\fR (rather than the command for
.TP
.B -logfilewarninglist
.B -logfilewarnings
-After a run of \fI(pdf)latex\fR, give a list of warnings about
+After a run of \fI*latex\fR, give a list of warnings about
undefined citations and references (unless silent mode is on).
See also the \fI$silence_logfile_warnings\fR configuration variable.
@@ -648,7 +654,7 @@ See also the \fI$silence_logfile_warnings\fR configuration variable.
.TP
.B -logfilewarninglist-
.B -logfilewarnings-
-After a run of \fI(pdf)latex\fR, do not give a list of warnings about
+After a run of \fI*latex\fR, do not give a list of warnings about
undefined citations and references. (Default)
See also the \fI$silence_logfile_warnings\fR configuration variable.
@@ -751,10 +757,10 @@ no matter where it occurs on the command line.
.TP
.B -outdir=FOO or -output-directory=FOO
-Sets the directory for the output files of (pdf)latex. This achieves
-its effect by the \fB-output-directory\fR option of (pdf)latex, which
+Sets the directory for the output files of *latex. This achieves
+its effect by the \fB-output-directory\fR option of *latex, which
currently (Dec. 2011 and later) is implemented on the common versions of
-(pdf)latex, i.e., MiKTeX and TeXLive. It may not be present in other
+*latex, i.e., MiKTeX and TeXLive. It may not be present in other
versions.
See also the \fB-auxdir\fR/\fB-aux-directory\fR options, and the
@@ -1049,12 +1055,12 @@ the order they appear on the command line.
.TP
.B -recorder
-Give the -recorder option with \fIlatex\fR and \fIpdflatex\fR. In
+Give the -recorder option with \fI*latex\fR. In
(most) modern versions of these programs, this results in a file of
extension \fI.fls\fR containing a list of the files that these
programs have read and written. \fILatexmk\fR will then use this file
to improve its detection of source files and generated files after a
-run of \fIlatex\fR or \fIpdflatex\fR. This is the default setting of
+run of \fI*latex\fR. This is the default setting of
\fIlatexmk\fR, unless overridden in an initialization file.
For further information, see the documentation for the \fI$recorder\fR
@@ -1062,7 +1068,7 @@ configuration variable.
.TP
.B -recorder-
-Do not supply the -recorder option with \fIlatex\fR and \fIpdflatex\fR.
+Do not supply the -recorder option with \fI*latex\fR.
.TP
.B -rules
@@ -1075,14 +1081,14 @@ processing. (This is the default.)
.TP
.B -showextraoptions
-Show the list of extra \fIlatex\fR and \fIpdflatex\fR options that
+Show the list of extra \fI*latex\fR options that
\fIlatexmk\fR recognizes, but that it simply passes
-through to the programs \fIlatex\fR, \fIpdflatex\fR, etc when they
+through to the programs \fI*latex\fR 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 \fIlatexmk\fR
-but is not handled by the particular implementation of \fIlatex\fR or
-\fIpdflatex\fR that is being used, that program will probably give an
+but is not handled by the particular implementation of \fI*latex\fR
+that is being used, that program will probably give an
error message.) These options are very numerous, but are not listed
in this documentation because they have no effect on \fIlatexmk\fR's
actions.
@@ -1097,10 +1103,10 @@ There are also options that are accepted by \fIlatex\fR etc, but
instead trigger actions by \fIlatexmk\fR: \fB-help\fR,
\fB-version\fR.
-Finally, there are certain options for \fIlatex\fR and \fIpdflatex\fR
+Finally, there are certain options for \fI*latex\fR
(e.g., \fB-recorder\fR) that trigger special actions or behavior by
\fIlatexmk\fR itself as well as being passed in some form to the
-called \fIlatex\fR and \fIpdflatex\fR program, or that affect other
+called \fI*latex\fR program, or that affect other
programs as well. These options do have entries in this
documentation. These options are:
\fB-jobname=STRING\fR, \fB-aux-directory=dir\fR,
@@ -1150,7 +1156,7 @@ See also the configuration variable \fI$show_time\fR.
.TP
.B -use-make
-When after a run of \fIlatex\fR or \fIpdflatex\fR, there are warnings
+When after a run of \fI*latex\fR, there are warnings
about missing files (e.g., as requested by the LaTeX \\input, \\include,
and \\includgraphics commands), \fIlatexmk\fR tries to make them by a custom
dependency. If no relevant custom dependency with an appropriate
@@ -1162,7 +1168,7 @@ Note that the filename may be specified without an extension, e.g.,
by \\includegraphics{drawing} in a LaTeX file. In that case,
\fIlatexmk\fR will try making drawing.ext with ext set in turn to the
possible extensions that are relevant for \fIlatex\fR (or as
-appropriate \fIpdflatex\fR).
+appropriate \fIpdflatex\fR, \fIlualatex\fR, \fIxelatex\fR).
See also the documentation for the \fI$use_make_for_missing_files\fR
configuration variable.
@@ -1217,7 +1223,7 @@ references (i.e., undefined citations or references or about multiply
defined references). This is \fBafter\fR \fIlatexmk\fR has completed
all the runs it needs to try and resolve references and citations.
Thus \fB-Werror\fR causes \fIlatexmk\fR to treat such warnings as
-errors, but only when they occur on the last run of (pdf)latex and
+errors, but only when they occur on the last run of *latex and
only after processing is complete. Also can be set by the
configuration variable \fI$warnings_as_errors\fR.
@@ -1528,7 +1534,7 @@ files". (See the earlier section "Configuration/Initialization (rc)
Files" for the files where the configurations are done.) Syntax for
setting these variables is of the following forms:
.PP
- $bibtex = 'bibtex %O %B';
+ $bibtex = 'bibtex %O %S';
.PP
for the setting of a string variable,
.PP
@@ -1659,19 +1665,6 @@ 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.
.PP
-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
-document with several bibliographies, the bibliography files will have
-a variety of names. Since bibtex is invoked with the basename of the
-bibliography file, the setting for the bibtex command should therefore
-be
-.PP
- $bibtex = 'bibtex %O %B';
-.PP
-Generally, you should use %B rather than %R. Similarly for most
-purposes, the name %T of the primary texfile is not a useful
-placeholder.
See the default values in the section "List of configuration variables
usable in initialization files" for what is normally the most
@@ -1898,15 +1891,15 @@ command line by the \fB-r\fR option.
.TP
.B $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
+written by a run of *latex. If this variable is not set, but
\fI$out_dir\fR is set, then \fI$aux_dir\fR is set to \fI$out_dir\fR,
which is the directory to which general output files are to be
written.
\fBImportant note\fR: The effect of \fI$aux_dir\fR, if different from
-\fI$out_dir\fR, is achieved by giving \fI(pdf)latex\fR the
+\fI$out_dir\fR, is achieved by giving \fI*latex\fR the
\fB-aux-directory\fR. Currently (Dec. 2011 and later) this only works on the
-MiKTeX version of \fI(pdf)latex\fR.
+MiKTeX version of \fI*latex\fR.
See also the documentation of \fI$out_dir\fR for some complications on
what directory names are suitable.
@@ -1980,11 +1973,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.
+.B $bibtex_fudge [0]
+When using bibtex, whether to take special action to allow older
+versions of bibtex to
+work when $out_dir or $aux_dir is specified. With bibtex from about 2019,
+this special action is longer be required; hence the default is not to do
+it.
.TP
.B $bibtex_silent_switch ["-terse"]
Switch(es) for the BibTeX processing program when silent mode is on.
@@ -2037,7 +2031,7 @@ generation generated files.
This operation is somewhat dangerous, and can have unintended
consequences, since the files to be deleted are determined from a file
-created by (pdf)latex, which can contain erroneous
+created by *latex, which can contain erroneous
information. Therefore this variable is turned off by default, and
then files to be deleted are restricted to those explictly specified
by patterns configured in the variables \fIclean_ext\fR,
@@ -2238,8 +2232,8 @@ then the dependency list is set to stdout (i.e., normally the screen).
.B $do_cd [0]
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 \fIlatex\fR and
-\fIpdflatex\fR programs. This variable is set by the \fB-cd\fR and
+do this, which is the same as the behavior of \fI*latex\fR
+programs. This variable is set by the \fB-cd\fR and
\fB-cd-\fR options on \fIlatexmk\fR's command line.
.TP
.B $dvi_filter [empty]
@@ -2364,7 +2358,7 @@ worry about these settings, and can ignore the following explanation.
In almost all situations, \fIlatexmk\fR 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., \fI(pdf)latex\fR) or is a leftover
+the current run of a program (e.g., \fI*latex\fR) 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 earlier than when the program was
@@ -2416,11 +2410,11 @@ 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 specifies files known to be generated by latex (and
-pdflatex, etc). It is used in two ways:
+This list specifies files known to be generated by \fI*latex\fR.
+It is used in two ways:
(a) The specified files are deleted in a cleanup operation (with the
\fB-c\fR, \fB-C\fR, \fB-CA\fR, \fB-g\fR and \fB-gg\fR options), and
-(b) It affects the determination of whether a rerun of (pdf)LaTeX is
+(b) It affects the determination of whether a rerun of *latex is
needed after a run that gives an error.
(Concerning item (b): Normally, a change of a source file during a run
@@ -2693,13 +2687,13 @@ The index processing program.
\fBSwitch(es)\fR for the index processing program when silent mode is on.
.TP
.B $max_repeat [5]
-The maximum number of times \fIlatexmk\fR will run latex/pdflatex
+The maximum number of times \fIlatexmk\fR will run \fI*latex\fR
before deciding that there may be an infinite loop and that it needs
-to bail out, rather than rerunning latex/pdflatex again to resolve
+to bail out, rather than rerunning \fI*latex\fR again to resolve
cross-references, etc. The default value covers all normal cases.
(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.)
+\fI*latex\fR generates files to be read in on a later run.)
.TP
.B $MSWin_back_slash [1]
This configuration variable only has an effect when \fIlatexmk\fR is
@@ -2735,10 +2729,10 @@ same file, and if one is running will not start a new one. If
.B $out_dir [""]
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 \fI$aux_dir\fR.
+*latex. See also the variable \fI$aux_dir\fR.
The effect of this variable (when non-blank) is achieved by using the
-\fB-output-directory\fR option of (pdf)latex. This exists in the
+\fB-output-directory\fR option of *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.
@@ -3046,26 +3040,26 @@ true), then quoting is done. Otherwise quoting is omitted.
The quoting method used by \fIlatexmk\fR 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 \fIlatex\fR and \fIpdflatex\fR cannot
+spaces. (But note that many versions of \fI*latex\fR cannot
correctly deal with TeX files whose names contain spaces. \fILatexmk\fR's
quoting only ensures that such filenames are correctly treated by the
operating system in passing arguments to programs.)
.TP
.B $recorder [1]
-Whether to use the \fB-recorder\fR option to \fIlatex\fR and
-\fIpdflatex\fR. Use of this option results in a file of extension
+Whether to use the \fB-recorder\fR option to \fI(latex\fR
+Use of this option results in a file of extension
\fI.fls\fR containing a list of the files that these programs have
read and written. \fILatexmk\fR will then use this file to improve
its detection of source files and generated files after a run of
-\fIlatex\fR or \fIpdflatex\fR.
+\fI*latex\fR.
It is generally recommended to use this option (or to configure the
\fI$recorder\fR variable to be on.) But it only works if
-\fI(pdf)latex\fR supports the -recorder option, which is true for most
+\fI*latex\fR supports the -recorder option, which is true for most
current implementations
\fINote about the name of the .fls file:\fR Most implementations of
-\fI(pdf)latex\fR produce an .fls file with the same basename as the
+\fI*latex\fR 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
@@ -3079,9 +3073,9 @@ BIBINPUTS, and BSTINPUTS. This variable is mainly used by
\fB-auxdir\fR, and/or \fB-aux-directory\fR options are used. In that
case \fIlatexmk\fR needs to communicate appropriately modified search
paths to \fIbibtex\fR, \fIdvipdf\fR, \fIdvips\fR, and
-\fI(pdf)latex\fR.
+\fI*latex\fR.
-[Comment to technically savvy readers: \fI(pdf)latex\fR doesn't
+[Comment to technically savvy readers: \fI*latex\fR doesn't
actually need the modified search path. But, surprisingly,
\fIdvipdf\fR and \fIdvips\fR do,
because sometimes graphics files get generated in the output or aux
@@ -3101,12 +3095,12 @@ Unix collection.)
Whether to show CPU time used.
.TP
.B $silence_logfile_warnings [0]
-Whether after a run of (pdf)latex to summarize warnings in the log
+Whether after a run of *latex to summarize warnings in the log
file about undefined citations and references. Setting
$silence_logfile_warnings=0 gives the summary of warnings (provided
silent mode isn't also set), and this is useful to locate undefined
citations and references without searching through the much more
-verbose log file or the screen output of (pdf)latex. But the summary
+verbose log file or the screen output of *latex. But the summary
can also be excessively annoying. The default is not to give these
warnings. The command line options
\fB-silence_logfile_warning_list\fR and
@@ -3152,7 +3146,7 @@ variable TMPDIR if it exists, otherwise "/tmp".
.TP
.B $use_make_for_missing_files [0]
Whether to use \fImake\fR to try and make files that are missing after
-a run of \fIlatex\fR or \fIpdflatex\fR, and for which a custom
+a run of \fI*latex\fR, and for which a custom
dependency has not been found. This is generally useful only when
\fIlatexmk\fR is used as part of a bigger project which is built by
using the \fImake\fR program.
@@ -3185,7 +3179,7 @@ defined references). This is \fBafter\fR \fIlatexmk\fR has completed
all the runs it needs to try and resolve references and citations.
Thus \fI$warnings_as_errors\fR being nonzero causes \fIlatexmk\fR 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
+run of *latex and only after processing is complete. A non-zero
value \fI$warnings_as_errors\fR can be set by the command-line option
\fB-Werror\fR.
@@ -3195,7 +3189,7 @@ 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 warnings as
errors that require the overall build process to be aborted. Of
-course, since multiple runs of (pdf)latex are generally needed to
+course, since multiple runs of *latex are generally needed to
resolve references and citations, what matters is \fInot\fR the
warnings on the first run, but the warnings on the \fIlast\fR run;
\fIlatexmk\fR takes this into account appropriately.
@@ -3325,7 +3319,7 @@ output.
.SS How custom dependencies are used:
An instance of a custom dependency rule is created whenever
-\fIlatexmk\fR detects that a run of latex/pdflatex needs to read a
+\fIlatexmk\fR detects that a run of \fI*latex\fR 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
@@ -3399,7 +3393,8 @@ the return value is the value returned by the last (and only)
statement, i.e., the invocation of system, which returns the value 0
on success.
-If you use \fIpdflatex\fR instead of latex, then you will probably prefer to
+If you use \fIpdflatex\fR, \fIlualatex\fR or \fIxelatex\fR instead of
+\fIlatex\fR, then you will probably prefer to
convert your graphics files to pdf format, in which case you would
replace the above code in an initialization file by
@@ -3475,7 +3470,7 @@ Examples of their use is given in the following examples, concerning
multiple index files and glossaries.
The only index-file conversion built-in to \fIlatexmk\fR is from an
-".idx" file written on one run of latex/pdflatex to an ".ind" file to
+".idx" file written on one run of \fI*latex\fR to an ".ind" file to
be read in on a subsequent run. But with the index.sty package, for
example, you can create extra indexes with extensions that you
configure. \fILatexmk\fR does not know how to deduce the extensions
@@ -3527,7 +3522,7 @@ Similar techniques can be applied for glossaries.
Those of you with experience with Makefiles, may get
concerned that the \fI.ndx\fR file is written during a run of
-latex/pdflatex and is always later than the \fI.nnd\fR last read in.
+\fI*latex\fR and is always later than the \fI.nnd\fR last read in.
Thus the \fI.nnd\fR appears to be perpetually out-of-date. This
situation, of circular dependencies, is endemic to latex, and is one
of the issues that \fIlatexmk\fR is programmed to overcome. It
@@ -3536,7 +3531,7 @@ does a remake when the file contents have actually changed.
Of course if you choose to write random data to the \fI.nnd\fR (or the
\fI.aux\fR file, etc) that changes on each new run, then you will have
-a problem. For real experts: See the \fI%hash_cal_ignore_pattern\fR
+a problem. For real experts: See the \fI%hash_calc_ignore_pattern\fR
if you have to deal with such problems.
.SS Old Method of Defining Custom Dependencies:
@@ -3595,7 +3590,7 @@ Example:
ensure_path( 'TEXINPUTS', './custom_cls_sty_files//' );
(In this example, the trailing '//' is documented by TeX systems to
-mean that latex, pdflatex, etc search for files in the specified
+mean that \fI*latex\fR search for files in the specified
directory and in all subdirectories.)
Technically \fIensure_path\fR works by setting Perl's variable
@@ -3874,7 +3869,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.69a).
+(Version 4.70a).
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 64953b74f1d..15ba2e728ae 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 2321117b533..ac91892ccb9 100644
--- a/Master/texmf-dist/doc/support/latexmk/CHANGES
+++ b/Master/texmf-dist/doc/support/latexmk/CHANGES
@@ -723,3 +723,15 @@ From v. 4.67 to 4.69a
document directory. (Bug is caused by problem in perl module
Cwd.)
Report rc files read
+
+From v. 4.69a to 4.70a
+ Improved compatibility with chapterbib.sty, provided that the configuration
+ given in file example_rcfiles/chapterbib-latexmkrc is used.
+ Correction of default values of $biber and $bibtex.
+ Improved handling of location of bbl and aux files on an intial run.
+ Change of default: running bibtex no longer uses temporary change of
+ directory, since the bug in bibtex that it evades isn't present in
+ recent versions.
+ Small bug corrections, and changes to some diagnostic messages.
+ Documentation corrections.
+
diff --git a/Master/texmf-dist/doc/support/latexmk/INSTALL b/Master/texmf-dist/doc/support/latexmk/INSTALL
index d4a99339922..33acea5cb17 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.69a, 17 April 2020)
+ (Version 4.70a, 13 September 2020)
John Collins
Physics Department
diff --git a/Master/texmf-dist/doc/support/latexmk/README b/Master/texmf-dist/doc/support/latexmk/README
index d86c3e196ca..414814d1835 100644
--- a/Master/texmf-dist/doc/support/latexmk/README
+++ b/Master/texmf-dist/doc/support/latexmk/README
@@ -1,5 +1,5 @@
-Latexmk, version 4.69a, 17 April 2020
--------------------------------------
+Latexmk, version 4.70a, 13 September 2020
+-----------------------------------------
Latexmk completely automates the process of generating a LaTeX
document. Essentially, it is a highly specialized cousin of the
@@ -88,7 +88,7 @@ NOTES:-
John Collins
---------------------------- "latexmk -h" ----------------------------
------ TO STDOUT from JCC's latexmkrc
-Latexmk 4.69a: Automatic LaTeX document generation routine
+Latexmk 4.70a: Automatic LaTeX document generation routine
Usage: latexmk [latexmk_options] [filename ...]
diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc
new file mode 100644
index 00000000000..403cbd6ef5f
--- /dev/null
+++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc
@@ -0,0 +1,71 @@
+# This file gives a configuration suitable when chapterbib is being used.
+# Latexmk without special configuration works with chapterbib only if
+# chapter bibliographies are used, but not when an overall consolidated
+# document-level bibliography is used. (This is because one of the runs of
+# bibtex gives an error of a kind that causes latexmk to stop further
+# processing. The chapterbib documentation mentions this problem
+# explicitly and says the error is to be ignored.)
+
+# The configuration in this file allows the use of a document level
+# bibliographys without any errors. It works equally when there is no
+# document level bibliography and when chapterbib is not used.
+
+
+$bibtex = 'bibtex %O %S';
+$bibtex_save = $bibtex;
+$bibtex = 'internal bibtex_fix %R %D %S';
+
+# MUST NOT use bibtex_fudge (i.e., change of directory before running bibtex).
+# That's not needed in post-2019 versions of bibtex, and messes up
+# things with chapterbib. So turn it off:
+$bibtex_fudge = 0;
+
+$clean_ext .= " %R-mod.blg %R-mod.aux %R-mod.bbl";
+
+sub bibtex_fix {
+ my ($root, $dest, $source) = @_;
+ local ($base_tex, $path, $ext) = fileparse( $source, '\.[^\.]*' );
+ my $ret = 0;
+ if ( $base_tex eq $root ) {
+ print "--- Will run bibtex on modified '$root.aux' file\n";
+ my $aux_mod_base = $path.$base_tex."-mod";
+ local $out_fh = new FileHandle "> $aux_mod_base$ext";
+ if (!$out_fh) { die "Cannot write to '$aux_mod_base$ext'\n"; }
+ local $level = 0;
+ fix_aux( $source );
+ close $out_fh;
+ $ret = Run_subst( $bibtex_save, 2, undef, "$aux_mod_base.aux", undef, $aux_mod_base );
+ foreach ( 'bbl', 'blg' ) {
+ copy "$aux_mod_base.$_", "$path$root.$_";
+ }
+ }
+ else {
+ $ret = Run_subst( $bibtex_save );
+ }
+ return $ret;
+}
+
+sub fix_aux {
+ # Read aux file, outputting flattened version to file handle $out_fh and
+ # removing \bibdata and \bibstyle lines that were in included .aux files.
+ my $aux_file = $_[0];
+ print "Processing '$aux_file'\n";
+ my $aux_fh = new FileHandle $aux_file;
+ if (!$aux_fh) { die "$My_name: Couldn't read aux file '$aux_file'\n"; }
+ $level++;
+ while (<$aux_fh>) {
+ if ( ($level > 1) &&
+ ( /^\\bibdata\{(.*)\}/ || /^\\bibstyle\{(.*)\}/ )
+ )
+ { next; }
+ elsif ( /^\\\@input\{(.*)\}/ ) {
+ fix_aux( $path.$1 );
+ next;
+ }
+ else {
+ print $out_fh $_;
+ }
+ }
+ close($aux_fh);
+ $level--;
+}
diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/fix-aux.latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/fix-aux.latexmkrc
index 9b01210a142..aefa206d5a8 100644
--- a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/fix-aux.latexmkrc
+++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/fix-aux.latexmkrc
@@ -28,8 +28,8 @@ sub latex_fix_aux {
# command line.
# 3. Run the command.
# 4. If the aux and output directories are different, move any of the dvi,
- # fls, ps and pdf files that are present in the intended aux directory
- # to the intended output directory.
+ # fls, pdf, ps and synctex.gz files that are present in the intended aux
+ # directory to the intended output directory.
# N.B. It might seem more appropriate to keep the fls file in the aux
# directory. But MiKTeX puts it in the output directory, so we must do
# the same to copy its behavior.
@@ -37,6 +37,8 @@ sub latex_fix_aux {
# directory, like a dvi file. But xelatex under MiKTeX puts it in the
# aux directory, so we must copy that behavior.
+ my @move_exts = ('dvi', 'fls', 'pdf', 'ps', 'synctex.gz' );
+
# Determine aux and output directories from command line:
my $auxD = '';
my $outD = '';
@@ -85,9 +87,17 @@ sub latex_fix_aux {
print "Running: '@args_act'\n";
my $ret = system @args_act;
if ($auxD ne $outD) {
- print "Moving dvi, fls, ps, pdf files from '$auxD' to '$outD'\n";
- foreach my $ext ('dvi', 'fls', 'ps', 'pdf' ) {
- rename "$auxD1$root_filename.$ext", "$outD1$root_filename.$ext",;
+ print "Move @move_exts files from '$auxD' to '$outD'\n";
+ # Use copy and unlink, not rename, since some viewers appear to keep the
+ # viewed file open. So if rename were used, such viewers would see the
+ # old version of the file, rather than the new one. With copy, the
+ # contents of the old file are normally overwritten by the new contents.
+ #
+ # In addition, copy works across file system boundaries, but rename
+ # doesn't.
+ foreach my $ext (@move_exts) {
+ copy "$auxD1$root_filename.$ext", "$outD1$root_filename.$ext";
+ unlink "$auxD1$root_filename.$ext";
}
}
return $ret;
diff --git a/Master/texmf-dist/doc/support/latexmk/latexmk.pdf b/Master/texmf-dist/doc/support/latexmk/latexmk.pdf
index 5c4112aa78a..8d7107f7a2a 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 5cd73ef9916..cb25edab853 100644
--- a/Master/texmf-dist/doc/support/latexmk/latexmk.txt
+++ b/Master/texmf-dist/doc/support/latexmk/latexmk.txt
@@ -20,29 +20,29 @@ DESCRIPTION
.pdf and/or hardcopy version of the document.
By default latexmk will run the commands necessary to generate a .dvi
- file.
+ file, which copies the behavior of earlier versions when only latex was
+ available.
- Latexmk can also be set to run continuously with a suitable previewer.
- In that case the latex program (or one of its relatives), etc, are re-
+ Latexmk can also be set to run continuously with a suitable previewer.
+ In that case the latex program (or one of its relatives), etc, are re-
run whenever one of the source files is modified, and the previewer au-
tomatically updates the on-screen view of the compiled document.
- Latexmk determines which are the source files by examining the log
+ Latexmk determines which are the source files by examining the log
file. (Optionally, it also examines the list of input and output files
- generated by the -recorder option of modern versions of latex (and
- pdflatex, xelatex, lualatex, etc). See the documentation for the
- -recorder option of latexmk below.) When latexmk is run, it examines
- properties of the source files, and if any have been changed since the
- last document generation, latexmk will run the various LaTeX processing
- programs as necessary. In particular, it will repeat the run of latex
- (or a related program)) often enough to resolve all cross references;
- depending on the macro packages used. With some macro packages and
- document classes, four, or even more, runs may be needed. If necessary,
- latexmk will also run bibtex, biber, and/or makeindex. In addition,
- latexmk can be configured to generate other necessary files. For exam-
- ple, from an updated figure file it can automatically generate a file
- in encapsulated postscript or another suitable format for reading by
- LaTeX.
+ generated by the -recorder option of modern versions of latex (and
+ pdflatex, xelatex, lualatex). See the documentation for the -recorder
+ option of latexmk below.) When latexmk is run, it examines properties
+ of the source files, and if any have been changed since the last docu-
+ ment generation, latexmk will run the various LaTeX processing programs
+ as necessary. In particular, it will repeat the run of latex (or a re-
+ lated program)) often enough to resolve all cross references; depending
+ on the macro packages used. With some macro packages and document
+ classes, four, or even more, runs may be needed. If necessary, latexmk
+ will also run bibtex, biber, and/or makeindex. In addition, latexmk
+ can be configured to generate other necessary files. For example, from
+ an updated figure file it can automatically generate a file in encapsu-
+ lated postscript or another suitable format for reading by LaTeX.
Latexmk has two different previewing options. With the simple -pv op-
tion, a dvi, postscript or pdf previewer is automatically run after
@@ -61,7 +61,7 @@ DESCRIPTION
- 17 April 2020 1
+ 13 September 2020 1
@@ -84,9 +84,9 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
tion for the $dvi_filter and $ps_filter configuration variables.)
These capabilities are leftover from older versions of latexmk, but are
currently non-functional. More flexibility can be obtained in current
- versions, since the command strings for running latex, pdflatex, etc
- can now be configured to run multiple commands. This also extends the
- possibility of postprocessing generated files.
+ versions, since the command strings for running *latex can now be con-
+ figured to run multiple commands. This also extends the possibility of
+ postprocessing generated files.
Latexmk is highly configurable, both from the command line and in con-
figuration files, so that it can accommodate a wide variety of user
@@ -122,12 +122,12 @@ LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE
All options can be introduced by single or double "-" characters, e.g.,
"latexmk -help" or "latexmk --help".
- Note 1: In addition to the options in the list below, latexmk recog-
- nizes almost all the options recognized by the latex, pdflatex programs
+ Note 1: In the documentation, '*latex' means any of the supported en-
+ gines, i.e., currently latex, lualatex, pdflatex, xelatex. Mention of
- 17 April 2020 2
+ 13 September 2020 2
@@ -136,64 +136,64 @@ LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE
LATEXMK(1) General Commands Manual LATEXMK(1)
- (and their relatives) in their current TeXLive and MiKTeX implementa-
- tions. Some of the options for these programs also trigger special ac-
- tion or behavior by latexmk, in which case they have specific explana-
- tions in this document. Otherwise, they are just passed through to a
- called latex or pdflatex program. Run latexmk with the -showextraop-
- tions to get a list of the options that latexmk accepts and that are
- simply passed through to latex or pdflatex (etc). See also the expla-
- nation of the -showextraoptions option for more information.
-
- Note 2: In this documentation, the program pdflatex is often referred
- to. Users of programs like lualatex and xelatex should know that from
- latexmk's point of view, these other programs behave very like pdfla-
- tex, i.e., they make a pdf file from a tex file, etc. So whenever
- pdflatex is mentioned without mention of the other programs, the state-
- ments apply equally to lualatex, xelatex, and any other similar pro-
- grams. Latexmk can be easily configured to use whichever of these pro-
- grams is needed. See the documentation for the following options:
- -pdflua, -pdfxe, -lualatex, and -xelatex, and also see the documenta-
- tion for the $pdflatex, $lualatex, and $xelatex configuration vari-
- ables. At present latexmk does not do automatic detection of which
- program is to be used.
+ a specific one of these normally refers that specific engines. Earlier
+ versions of this documentation weren't so consistent.
+
+ Note 2: In addition to the options in the list below, latexmk recog-
+ nizes almost all the options recognized by the *latex in their current
+ TeXLive and MiKTeX implementations. Some of the options for these pro-
+ grams also trigger special action or behavior by latexmk, in which case
+ they have specific explanations in this document. Otherwise, they are
+ just passed through to a called *latex program. Run latexmk with the
+ -showextraoptions to get a list of the options that latexmk accepts and
+ that are simply passed through to *latex. See also the explanation of
+ the -showextraoptions option for more information.
+
+ Note 3: In this documentation, the term *latex is often referred to,
+ which refers to all the supported latex-like programs, whether the
+ original latex, or the later pdflatex, xelatex, and lualatex. Users
+ should know that from latexmk's point of view, all of these programs
+ behave very much alike, with the sole exception that by default latex
+ produces a dvi file and all the others produce a pdf file. Latexmk can
+ be easily configured to use whichever of these programs is needed. See
+ the documentation for the following options: -pdflua, -pdfxe, -luala-
+ tex, and -xelatex, and also see the documentation for the $latex,
+ $pdflatex, $lualatex, and $xelatex configuration variables. At present
+ latexmk does not do automatic detection of which program is to be used.
Definitions of options and arguments
- file One or more files can be specified. If no files are specified,
- latexmk will, by default, run on all files in the current work-
- ing directory with a ".tex" extension. This behavior can be
+ file One or more files can be specified. If no files are specified,
+ latexmk will, by default, run on all files in the current work-
+ ing directory with a ".tex" extension. This behavior can be
changed: see the description concerning the @default_files vari-
- able in the section "List of configuration variables usable in
+ able in the section "List of configuration variables usable in
initialization files".
If a file is specified without an extension, then the ".tex" ex-
- tension is automatically added, just as LaTeX does. Thus, if
+ tension is automatically added, just as LaTeX does. Thus, if
you specify:
latexmk foo
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: "$",
+ 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
+ acters null, tab, form feed, carriage return, line feed, and
+ delete. In addition "&" is prohibited when it is the first
character of a filename.
- Latexmk gives a fatal error when it detects any of the above
+ 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
- 17 April 2020 3
+ 13 September 2020 3
@@ -202,19 +202,21 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- occasionally result from filenames that have been incorrectly
- quoted on the command line. In addition, under Microsoft Win-
- dows, 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.
+ 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 di-
+ rectory separator in Windows, and is accepted by latex etc.
-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.
+ Sets the directory for auxiliary output files of *latex (.aux,
+ .log etc). This achieves its effect by the -aux-directory op-
+ tion of *latex, which currently is only implemented on the MiK-
+ TeX version of *latex.
See also the -outdir/-output-directory options, and the
$aux_dir, $out_dir, and $search_path_separator configuration
@@ -254,12 +256,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
- 17 April 2020 4
+ 13 September 2020 4
@@ -268,6 +268,8 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
+ 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-
@@ -320,12 +322,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
sumed.
- -bi <intensity>
- How dark to print the banner message. A decimal number between
- 17 April 2020 5
+ 13 September 2020 5
@@ -334,6 +334,8 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
+ -bi <intensity>
+ 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.
@@ -386,12 +388,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
dition 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
- if you want to do a cleanup than a make.
- 17 April 2020 6
+ 13 September 2020 6
@@ -400,6 +400,9 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
+ 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
files are treated as non-regeneratable or regeneratable.
@@ -433,31 +436,28 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
rather than the source file.
This is the default behavior and corresponds to the behavior of
- the latex and pdflatex programs. However, it is not desirable
- behavior when latexmk is invoked by a GUI configured to invoke
- latexmk with a full pathname for the source file. See the -cd
- option.
+ the *latex programs. However, it is not desirable behavior when
+ latexmk is invoked by a GUI configured to invoke latexmk with a
+ full pathname for the source file. See the -cd option.
- This option works by setting the $do_cd configuration variable
- to zero. See the documentation for that variable for more in-
+ This option works by setting the $do_cd configuration variable
+ to zero. See the documentation for that variable for more in-
formation.
- -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
-
- 17 April 2020 7
+ 13 September 2020 7
@@ -466,27 +466,29 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- Note that if the -d option is specified, the -ps option is as-
+ latexmk -bm DRAFT
+
+ Note that if the -d option is specified, the -ps option is as-
sumed.
-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,
+ 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.)
@@ -494,7 +496,7 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
Equivalent to -deps.
- -deps- Do not show a list of dependent files after processing. (This
+ -deps- Do not show a list of dependent files after processing. (This
is the default.)
@@ -503,27 +505,25 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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 de-
+ Use of this option also turns on the output of the list of de-
pendent 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
- the dvi file:
-
- 17 April 2020 8
+ 13 September 2020 8
@@ -532,64 +532,64 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
+ the dvi file:
+
latexmk -dF "dviselect even" foo.tex
-diagnostics
- Print detailed diagnostics during a run. This may help for de-
- bugging problems or to understand latexmk's behavior in diffi-
+ Print detailed diagnostics during a run. This may help for de-
+ bugging problems or to understand latexmk's behavior in diffi-
cult situations.
-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-
+ Execute the specified initialization code before processing.
+ The code is Perl code of the same form as is used in latexmk's
+ initialization files. For more details, see the information on
+ the -r option, and the section about "Configuration/initializa-
+ tion (RC) files". The code is typically a sequence of assign-
ment statements separated by semicolons.
- The code is executed when the -e option is encountered during
- latexmk's parsing of its command line. See the -r option for a
- way of executing initialization code from a file. An error re-
- sults in latexmk stopping. Multiple instances of the -r and -e
+ 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 re-
+ sults in latexmk stopping. Multiple instances of the -r and -e
options can be used, and they are executed in the order they ap-
pear 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 op-
+ acters in the code on the command line. For example, suppose
+ you want to set the latex command to use its -shell-escape op-
tion, 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
-
- 17 April 2020 9
+ 13 September 2020 9
@@ -598,41 +598,43 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
+ latexmk -e "$latex=q/latex %O -shell-escape %S/" file.tex
+
or
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,
+ Note: "Further processing" means the running of other programs
+ or the rerunning of latex (etc) that would be done if no errors
+ had occurred. If instead, or additionally, you want the latex
+ (etc) program not to pause for user input after an error, you
+ should arrange this by an option that is passed to the program,
e.g., by latexmk's option -interaction=nonstopmode.
-f- Turn off the forced processing-past-errors such as is set by the
- -f option. This could be used to override a setting in a con-
+ -f option. This could be used to override a setting in a con-
figuration file.
- -g Force latexmk to process document fully, even under situations
- where latexmk would normally decide that no changes in the
- source files have occurred since the previous run. This option
- is useful, for example, if you change some options and wish to
+ -g Force latexmk to process document fully, even under situations
+ where latexmk would normally decide that no changes in the
+ source files have occurred since the previous run. This option
+ is useful, for example, if you change some options and wish to
reprocess the files.
@@ -648,14 +650,12 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-jobname=STRING
- Set the basename of output files(s) to STRING, instead of the
- default, which is the basename of the specified TeX file. (At
- present, STRING should not contain spaces.)
-
+ Set the basename of output files(s) to STRING, instead of the
+ default, which is the basename of the specified TeX file. (At
- 17 April 2020 10
+ 13 September 2020 10
@@ -664,30 +664,32 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- 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.
+ present, STRING should not contain spaces.)
+
+ This is like the same option for current implementations of the
+ *latex, and the passing of this option to these programs is part
+ of latexmk's implementation of -jobname.
There is one enhancement, that the STRING may contain the place-
holder '%A'. This will be substituted by the basename of the TeX
- file. The primary purpose is when multiple files are specified
- on the command line to latexmk, and you wish to use a jobname
- with a different file-dependent value for each file. For exam-
+ file. The primary purpose is when multiple files are specified
+ on the command line to latexmk, and you wish to use a jobname
+ with a different file-dependent value for each file. For exam-
ple, suppose you had .tex files test1.tex and test2.tex, and you
- wished to compare the results of compilation by pdflatex and
- those with xelatex. Then under a unix-type operating system you
- could use the command line
+ wished to compare the results of compilation by *latex and those
+ with xelatex. Then under a unix-type operating system you could
+ use the command line
latexmk -pdf -jobname=%A-pdflatex *.tex
latexmk -pdfxe -jobname=%A-xelatex *.tex
- Then the .aux, .log, and .pdf files from the use of pdflatex
- would have basenames test1-pdflatex and test2-pdflatex, while
+ Then the .aux, .log, and .pdf files from the use of pdflatex
+ would have basenames test1-pdflatex and test2-pdflatex, while
from xelatex, the basenames would be test1-xelatex and test2-xe-
latex.
Under MS-Windows with cmd.exe, you would need to double the per-
- cent sign, so that the percent character is passed to latexmk
+ cent sign, so that the percent character is passed to latexmk
rather than being used to substitute an environment variable:
latexmk -pdf -jobname=%%A-pdflatex *.tex
@@ -695,33 +697,31 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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 de-
+ ers and the dvi to postscript converters. This option is not
+ normally needed nowadays, since current previewers normally de-
termine this information automatically.
-l- Turn off -l.
- -latex This sets the generation of dvi files by latex, and turns off
+ -latex This sets the generation of dvi files by latex, and turns off
the generation of pdf and ps files.
- Note: to set the command used when latex is specified, see the
+ Note: to set the command used when latex is specified, see the
-latex="COMMAND" option.
-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
-
- 17 April 2020 11
+ 13 September 2020 11
@@ -730,14 +730,15 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- for the $latex configuration variable. Depending on your oper-
- ating system and the command-line shell you are using, you may
- need to change the single quotes to double quotes (or something
+ The specification of the contents of the string are the same as
+ for the $latex configuration variable. Depending on your oper-
+ ating system and the command-line shell you are using, you may
+ need to change the single quotes to double quotes (or something
else).
- Note: This option when provided with the COMMAND argument only
+ Note: This option when provided with the COMMAND argument only
sets the command for invoking latex; it does not turn on the use
- of latex. That is done by other options or in an initialization
+ of latex. That is done by other options or in an initialization
file.
To set the command for running pdflatex (rather than the command
@@ -745,31 +746,31 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-logfilewarninglist
- -logfilewarnings After a run of (pdf)latex, give a list of warn-
- ings about undefined citations and references (unless silent
- mode is on).
+ -logfilewarnings After a run of *latex, give a list of warnings
+ about undefined citations and references (unless silent mode is
+ on).
See also the $silence_logfile_warnings configuration variable.
-logfilewarninglist-
- -logfilewarnings- After a run of (pdf)latex, do not give a list
- of warnings about undefined citations and references. (Default)
+ -logfilewarnings- After a run of *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.)
@@ -778,16 +779,15 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
behaves like the -pdflatex option, but sets the variable $luala-
tex.
- Note: This option when provided with the COMMAND argument only
- sets the command for invoking lualatex; it does not turn on the
+ Note: This option when provided with the COMMAND argument only
+ sets the command for invoking lualatex; it does not turn on the
use of lualatex. That is done by other options or in an initial-
ization file.
-
- 17 April 2020 12
+ 13 September 2020 12
@@ -796,17 +796,17 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- -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
+ source file. If you use the dependents list in a Makefile, the
dummy rules work around errors the program make gives if you re-
move header files without updating the Makefile to match.
@@ -814,21 +814,21 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-MSWinBackSlash
This option only has an effect when latexmk is running under MS-
Windows. This is that when latexmk runs a command under MS-Win-
- dows, the Windows standard directory separator "\" is used to
- separate directory components in a file name. Internally, la-
- texmk uses "/" for the directory separator character, which is
+ dows, the Windows standard directory separator "\" is used to
+ separate directory components in a file name. Internally, la-
+ texmk uses "/" for the directory separator character, which is
the character used by Unix-like systems.
This is the default behavior. However the default may have been
- overridden by a configuration file (latexmkrc file) which sets
+ overridden by a configuration file (latexmkrc file) which sets
$MSWin_back_slash=0.
-MSWinBackSlash-
This option only has an effect when latexmk is running under MS-
Windows. This is that when latexmk runs a command under MS-Win-
- dows, the substitution of "\" for the separator character be-
- tween directory components of a file name is not done. Instead
+ dows, the substitution of "\" for the separator character be-
+ tween directory components of a file name is not done. Instead
the forward slash "/" is used, the same as on Unix-like systems.
This is acceptable in most situations under MS-Windows, provided
that filenames are properly quoted, as latexmk does by default.
@@ -838,22 +838,22 @@ 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
+ When in continuous-preview mode, always start a new viewer to
+ view the generated file. By default, latexmk will, in continu-
+ ous-preview mode, test for a previously running previewer for
the same file and not start a new one if a previous previewer is
running. However, its test sometimes fails (notably if there is
- an already-running previewer that is viewing a file of the same
- name as the current file, but in a different directory). This
+ an already-running previewer that is viewing a file of the same
+ name as the current file, but in a different directory). This
option turns off the default behavior.
-new-viewer-
- The inverse of the -new-viewer option. It puts latexmk in its
+ The inverse of the -new-viewer option. It puts latexmk in its
- 17 April 2020 13
+ 13 September 2020 13
@@ -872,43 +872,43 @@ 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 en-
- countered. But -norc is an exception to this rule: it is acted
+ N.B. Normally the initialization files are read and obeyed, and
+ then command line options are obeyed in the order they are en-
+ countered. 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 (pdf)la-
- tex, which currently (Dec. 2011 and later) is implemented on the
- common versions of (pdf)latex, i.e., MiKTeX and TeXLive. It may
- not be present in other versions.
+ Sets the directory for the output files of *latex. This
+ achieves its effect by the -output-directory option of *latex,
+ which currently (Dec. 2011 and later) is implemented on the com-
+ mon versions of *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
+ 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, un-
- der 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,
+ der 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.
@@ -919,7 +919,7 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
- 17 April 2020 14
+ 13 September 2020 14
@@ -928,15 +928,15 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- -pdf Generate pdf version of document using pdflatex. (If you wish
+ -pdf Generate pdf version of document using pdflatex. (If you wish
to use lualatex or xelatex, you can use whichever of the options
- -pdflua, -pdfxe, -lualatex or -xelatex applies.) To configure
- latexmk to have such behavior by default, see the section on
+ -pdflua, -pdfxe, -lualatex or -xelatex applies.) To configure
+ latexmk to have such behavior by default, see the section on
"Configuration/initialization (rc) files".
-pdfdvi
- Generate pdf version of document from the dvi file, by default
+ Generate pdf version of document from the dvi file, by default
using dvipdf.
@@ -944,35 +944,35 @@ 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 file does la-
+ -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 la-
texmk then call xdvipdfmx to generate the final .pdf file.
- (Note: The reason why latexmk arranges for xelatex to make an
- .xdv file instead of the xelatex's default of a .pdf file is as
- follows: When the document includes large graphics files, espe-
- cially .png files, the production of a .pdf file can be quite
+ (Note: The reason why latexmk arranges for xelatex to make an
+ .xdv file instead of the xelatex's default of a .pdf file is as
+ follows: When the document includes large graphics files, espe-
+ cially .png files, the production of a .pdf file can be quite
time consuming, even when the creation of the .xdv file by xela-
- tex is fast. So the use of the intermediate .xdv file can re-
+ tex is fast. So the use of the intermediate .xdv file can re-
sult 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
+ 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 la-
- tex (or, more precisely, whatever program is configured to be
+ tex (or, more precisely, whatever program is configured to be
used in the $latex configuration variable).
@@ -980,12 +980,12 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
This sets the generation of pdf files by pdflatex, and turns off
the generation of dvi and ps files.
- Note: to set the command used when pdflatex is specified, see
+ Note: to set the command used when pdflatex is specified, see
the -pdflatex="COMMAND" option.
- 17 April 2020 15
+ 13 September 2020 15
@@ -1002,19 +1002,19 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S"
foo.tex
- The specification of the contents of the string are the same as
+ The specification of the contents of the string are the same as
for the $pdflatex configuration variable. (The option -pdflatex
in fact sets the variable $pdflatex.) Depending on your operat-
- ing system and the command-line shell you are using, you may
- need to change the single quotes to double quotes (or something
+ ing system and the command-line shell you are using, you may
+ need to change the single quotes to double quotes (or something
else).
- Note: This option when provided with the COMMAND argument only
- sets the command for invoking pdflatex; it does not turn on the
+ Note: This option when provided with the COMMAND argument only
+ sets the command for invoking pdflatex; it does not turn on the
use of pdflatex. That is done by other options or in an initial-
ization file.
- 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.
@@ -1029,10 +1029,10 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-pretex=CODE
Given that CODE is some TeX code, this options sets that code to
- be executed before inputting source file. This only works if
+ be executed before inputting source file. This only works if
the command for invoking the relevant *latex is suitably config-
- ured. See the documentation of the variable $pre_tex_code, and
- the substitution strings %P and %U for more details. This op-
+ ured. See the documentation of the variable $pre_tex_code, and
+ the substitution strings %P and %U for more details. This op-
tion works by setting the variable $pre_tex_code.
See also the -usepretex option.
@@ -1051,7 +1051,7 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
- 17 April 2020 16
+ 13 September 2020 16
@@ -1064,12 +1064,12 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-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.
@@ -1077,13 +1077,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.
@@ -1096,15 +1096,15 @@ 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
+ 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 se-
+ -pv Run file previewer. If the -view option is used, this will se-
lect 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
+ 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
previewer will be used. This option is incompatible with the -p
and -pvc options, so it turns them off.
@@ -1112,12 +1112,12 @@ 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
- 17 April 2020 17
+ 13 September 2020 17
@@ -1126,41 +1126,41 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- 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 in-
- compatible with the -p and -pv options, so it turns these op-
+ 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 in-
+ compatible with the -p and -pv options, so it turns these op-
tions 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 ap-
+ (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 ap-
parent 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-
+ 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.)
@@ -1168,9 +1168,9 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-pvctimeout
- Do timeout in pvc mode after period of inactivity, which is 30
+ Do timeout in pvc mode after period of inactivity, which is 30
min. by default. Inactivity means a period when latexmk has de-
- tected no file changes and hence has not taken any actions like
+ tected no file changes and hence has not taken any actions like
compiling the document.
@@ -1183,7 +1183,7 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
- 17 April 2020 18
+ 13 September 2020 18
@@ -1196,60 +1196,60 @@ 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
+ 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 ex-
ecuted 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 ex-
- tension .fls containing a list of the files that these programs
- have read and written. Latexmk will then use this file to im-
- prove its detection of source files and generated files after a
- run of latex or pdflatex. This is the default setting of la-
- texmk, unless overridden in an initialization file.
+ Give the -recorder option with *latex. In (most) modern ver-
+ sions of these programs, this 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. This is the default setting of latexmk, unless overrid-
+ den 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.
+ Do not supply the -recorder option with *latex.
-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
+ 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
+ Show the list of extra *latex options that latexmk recognizes,
- 17 April 2020 19
+ 13 September 2020 19
@@ -1258,15 +1258,14 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- 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 la-
- texmk but is not handled by the particular implementation of la-
- tex or pdflatex that is being used, that program will probably
- 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.
+ but that it simply passes through to the programs *latex 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 that is being used, that
+ program will probably 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
@@ -1277,13 +1276,13 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
There are also options that are accepted by latex etc, but in-
stead 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 op-
- tions are: -jobname=STRING, -aux-directory=dir, -output-direc-
- tory=DIR, -quiet, and -recorder.
+ Finally, there are certain options for *latex (e.g., -recorder)
+ that trigger special actions or behavior by latexmk itself as
+ well as being passed in some form to the called *latex program,
+ or that affect other programs as well. These options do have
+ entries in this documentation. These options are: -job-
+ name=STRING, -aux-directory=dir, -output-directory=DIR, -quiet,
+ and -recorder.
-silent
@@ -1312,10 +1311,11 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
ones. This is useful to override special configurations.
The result is that $latex = 'latex %O %S', and similarly for
+ $pdflatex, $lualatex, and $xelatex. (The option -no-pdf needed
- 17 April 2020 20
+ 13 September 2020 20
@@ -1324,7 +1324,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- $pdflatex, $lualatex, and $xelatex. (The option -no-pdf needed
for $xelatex is provided automatically, given that %O appears in
the definition.)
@@ -1338,19 +1337,19 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-use-make
- 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 ap-
- propriate 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.
+ When after a run of *latex, 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 cus-
+ tom dependency. If no relevant custom dependency with an appro-
+ priate source file is found, and if the -use-make option is set,
+ then as a last resort latexmk will try to use the make program
+ to try to make the missing files.
Note that the filename may be specified without an extension,
e.g., by \includegraphics{drawing} in a LaTeX file. In that
case, latexmk will try making drawing.ext with ext set in turn
to the possible extensions that are relevant for latex (or as
- appropriate pdflatex).
+ appropriate pdflatex, lualatex, xelatex).
See also the documentation for the $use_make_for_missing_files
configuration variable.
@@ -1381,7 +1380,8 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
- 17 April 2020 21
+
+ 13 September 2020 21
@@ -1418,9 +1418,9 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
about multiply defined references). This is after latexmk has
completed all the runs it needs to try and resolve references
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
- set by the configuration variable $warnings_as_errors.
+ ings as errors, but only when they occur on the last run of *la-
+ tex and only after processing is complete. Also can be set by
+ the configuration variable $warnings_as_errors.
-xelatex
@@ -1447,7 +1447,7 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
- 17 April 2020 22
+ 13 September 2020 22
@@ -1513,7 +1513,7 @@ DEALING WITH ERRORS, PROBLEMS, ETC
- 17 April 2020 23
+ 13 September 2020 23
@@ -1579,7 +1579,7 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
- 17 April 2020 24
+ 13 September 2020 24
@@ -1645,7 +1645,7 @@ ALLOWING FOR CHANGE OF OUTPUT FILE TYPE
- 17 April 2020 25
+ 13 September 2020 25
@@ -1711,7 +1711,7 @@ CONFIGURATION/INITIALIZATION (RC) FILES
- 17 April 2020 26
+ 13 September 2020 26
@@ -1772,12 +1772,12 @@ HOW TO SET VARIABLES IN INITIALIZATION FILES
Files" for the files where the configurations are done.) Syntax for
setting these variables is of the following forms:
- $bibtex = 'bibtex %O %B';
+ $bibtex = 'bibtex %O %S';
- 17 April 2020 27
+ 13 September 2020 27
@@ -1843,7 +1843,7 @@ FORMAT OF COMMAND SPECIFICATIONS
- 17 April 2020 28
+ 13 September 2020 28
@@ -1909,7 +1909,7 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
- 17 April 2020 29
+ 13 September 2020 29
@@ -1928,62 +1928,38 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
- bibliography file, the setting for the bibtex command should therefore
- be
-
- $bibtex = 'bibtex %O %B';
-
- Generally, you should use %B rather than %R. Similarly for most pur-
- poses, the name %T of the primary texfile is not a useful placeholder.
-
- See the default values in the section "List of configuration variables
+ See the default values in the section "List of configuration variables
usable in initialization files" for what is normally the most appropri-
ate usage.
If you omit to supply any placeholders whatever in the specification of
- a command, latexmk will supply what its author thinks are appropriate
+ a command, latexmk will supply what its author thinks are appropriate
defaults. This gives compatibility with configuration files for previ-
ous versions of latexmk, which didn't use placeholders.
- "Detaching" a command: Normally when latexmk runs a command, it waits
+ "Detaching" a command: Normally when latexmk runs a command, it waits
for the command to run to completion. This is appropriate for commands
like latex, of course. But for previewers, the command should normally
- run detached, so that latexmk gets the previewer running and then re-
- turns 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
+ run detached, so that latexmk gets the previewer running and then re-
+ turns 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
command name with "start ", as in
$dvi_previewer = 'start xdvi %O %S';
- This will be translated to whatever is appropriate for your operating
+ This will be translated to whatever is appropriate for your operating
system.
Notes: (1) In some circumstances, latexmk will always run a command de-
- tached. This is the case for a previewer in preview continuous mode,
- since otherwise previewing continuously makes no sense. (2) This pre-
- cludes the possibility of running a command named start. (3) If the
- word start occurs more than once at the beginning of the command
- string, that is equivalent to having just one. (4) Under cygwin, some
- complications happen, since cygwin amounts to a complicated merging of
- UNIX and MS-Windows. See the source code for how I've handled the
+ tached. This is the case for a previewer in preview continuous mode,
+ since otherwise previewing continuously makes no sense. (2) This pre-
+ cludes the possibility of running a command named start. (3) If the
+ word start occurs more than once at the beginning of the command
+ string, that is equivalent to having just one. (4) Under cygwin, some
+ complications happen, since cygwin amounts to a complicated merging of
+ UNIX and MS-Windows. See the source code for how I've handled the
problem.
-
-
- 17 April 2020 30
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
Command names containing spaces: Under MS-Windows it is common that the
name of a command includes spaces, since software is often installed in
a subdirectory of "C:\Program Files". Such command names should be en-
@@ -1993,35 +1969,46 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
%S';
$pdf_previewer = 'start "c:/Program Files/SumatraPDF/Suma-
traPDF.exe" %O %S';
- $pdf_previewer = 'start "c:/Program Files/SumatraPDF (x86)/Suma-
+ $pdf_previewer = 'start "c:/Program Files/SumatraPDF (x86)/Suma-
traPDF.exe" %O %S';
- (Note about the above example: Under MS-Windows forward slashes are
+
+
+ 13 September 2020 30
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
+ (Note about the above example: Under MS-Windows forward slashes are
equivalent to backslashes in a filename under almost all circumstances,
- provided that the filename is inside double quotes. It is easier to
+ provided that the filename is inside double quotes. It is easier to
use forward slashes in examples like the one above, since then one does
- not have to worry about the rules for dealing with forward slashes in
+ not have to worry about the rules for dealing with forward slashes in
strings in the Perl language.)
- Command names under Cygwin: If latexmk is executed by Cygwin's Perl,
+ Command names under Cygwin: If latexmk is executed by Cygwin's Perl,
be particularly certain that pathnames in commands have forward slashes
- not the usual backslashes for the separator of pathname components.
- See the above examples. Backslashes often get misinterpreted by the
+ not the usual backslashes for the separator of pathname components.
+ See the above examples. Backslashes often get misinterpreted by the
Unix shell used by Cygwin's Perl to execute external commands. Forward
slashes don't suffer from this problem, and (when quoted, as above) are
equally acceptable to MS-Windows.
- Using MS-Windows file associations: A useful trick under modern ver-
+ Using MS-Windows file associations: A useful trick under modern ver-
sions of MS-Windows (e.g., WinXP) is to use just the command 'start' by
itself:
$dvi_previewer = 'start %S';
Under MS-Windows, this will cause to be run whatever program the system
- has associated with dvi files. (The same applies for a postscript
+ has associated with dvi files. (The same applies for a postscript
viewer and a pdf viewer.) But note that this trick is not always suit-
- able for the pdf previwer, if your system has acroread for the default
+ able for the pdf previwer, if your system has acroread for the default
pdf viewer. As explained elsewhere, acroread under MS-Windows does not
work well with latex and latexmk, because acroread locks the pdf file.
@@ -2030,62 +2017,63 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$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-
+ tion starting with "internal", as in
- 17 April 2020 31
+ $latex = 'internal mylatex %O %S';
+ sub mylatex {
+ my @args = @_;
+ # Possible preprocessing here
+ return system 'latex', @args;
+ }
+ 13 September 2020 31
-LATEXMK(1) General Commands Manual LATEXMK(1)
- $latex = 'latex --src-specials %O %S';
- Running a subroutine instead of an external command: Use a specifica-
- tion starting with "internal", as in
- $latex = 'internal mylatex %O %S';
- sub mylatex {
- my @args = @_;
- # Possible preprocessing here
- return system 'latex', @args;
- }
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
- For some of the more exotic possibilities that then become available,
- see the section "ADVANCED CONFIGURATION: Some extra resources and ad-
- vanced tricks". Also see some of the examples in the directory exam-
+ For some of the more exotic possibilities that then become available,
+ see the section "ADVANCED CONFIGURATION: Some extra resources and ad-
+ vanced 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 ad-
- ditional processing you need to do in your special situation, you can
+ Advanced tricks: Normally one specifies a single command for the com-
+ mands invoked by latexmk. Naturally, if there is some complicated ad-
+ ditional processing you need to do in your special situation, you can
write a script (or batch file) to do the processing, and then configure
latexmk to use your script in place of the standard program.
- You can also use a Perl subroutine instead of a script -- see above.
+ You can also use a Perl subroutine instead of a script -- see above.
This is generally the most flexible and portable solution.
It is also possible to configure latexmk to run multiple commands. For
- example, if when running pdflatex to generate a pdf file from a tex
+ 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 ex-
tra processing, you could do something like:
- $pdflatex = 'pdflatex --shell-escape %O %S; pst2pdf_for_latexmk
+ $pdflatex = 'pdflatex --shell-escape %O %S; pst2pdf_for_latexmk
%B';
- This definition assumes you are using a UNIX-like system (which in-
- cludes 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 in-
+ cludes 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
@@ -2093,47 +2081,48 @@ 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.
LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES
- In this section are specified the variables whose values can be ad-
- justed to configure latexmk. (See the earlier section "Configura-
- tion/Initialization (rc) Files" for the files where the configurations
+ In this section are specified the variables whose values can be ad-
+ justed to configure latexmk. (See the earlier section "Configura-
+ tion/Initialization (rc) Files" for the files where the configurations
are done.)
+ Default values are indicated in brackets. Note that for variables that
+ are boolean in character, concerning whether latexmk does or does not
+ behave in a certain way, a non-zero value, normally 1, indicates true,
+ i.e., the behavior occurs, while a zero value indicates a false value,
+ i.e., the behavior does not occur.
+
+ $allow_switch [1]
- 17 April 2020 32
+ This controls what happens when the output extension of latex,
+ pdflatex, lualatex or xelatex differs from what is expected.
+ 13 September 2020 32
-LATEXMK(1) General Commands Manual LATEXMK(1)
- Default values are indicated in brackets. Note that for variables that
- are boolean in character, concerning whether latexmk does or does not
- behave in a certain way, a non-zero value, normally 1, indicates true,
- i.e., the behavior occurs, while a zero value indicates a false value,
- i.e., the behavior does not occur.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $allow_switch [1]
- This controls what happens when the output extension of latex,
- pdflatex, lualatex or xelatex differs from what is expected.
(The possible extensions are .dvi, .pdf, .xdv.) This can happen
- with the use of the \pdfoutput macro in a document compiled un-
- der latex or pdflatex, or with the use of the \outputmode macro
+ with the use of the \pdfoutput macro in a document compiled un-
+ der latex or pdflatex, or with the use of the \outputmode macro
under lualatex. It can also happen with certain kinds of incor-
rect configuration.
- In such a case, latexmk can appropriately adjust its network of
+ In such a case, latexmk can appropriately adjust its network of
rules. The adjustment is made if $allow_switch is on, and if no
request for a dvi or ps file has been made.
@@ -2141,11 +2130,11 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$always_view_file_via_temporary [0]
- Whether .ps and .pdf files are initially to be made in a tempo-
- rary directory and then moved to the final location. (This ap-
+ Whether .ps and .pdf files are initially to be made in a tempo-
+ rary directory and then moved to the final location. (This ap-
plies to dvips, dvipdf, and ps2pdf operations, and the filtering
operators on .dvi and .ps files. It does not apply to pdflatex,
- unfortunately, since pdflatex provides no way of specifying a
+ unfortunately, since pdflatex provides no way of specifying a
chosen name for the output file.)
This use of a temporary file solves a problem that the making of
@@ -2155,79 +2144,77 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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.
+ applies only if preview-continuous mode (-pvc option) is used.
See $tmpdir for the setting of the directory where the temporary
file is created.
$analyze_input_log_always [1]
- After a run of latex (etc), always analyze .log for input files
- in the <...> and (...) constructions. Otherwise, only do the
+ After a run of latex (etc), always analyze .log for input files
+ in the <...> and (...) constructions. Otherwise, only do the
analysis when fls file doesn't exist or is out of date.
- Under normal circumstances, the data in the fls file is reli-
+ Under normal circumstances, the data in the fls file is reli-
able, and the test of the log file gets lots of false positives;
- usually $analyze_input_log_always is best set to zero. But the
- test of the log file is needed at least in the following
-
-
+ 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.)
- 17 April 2020 33
+ To keep backward compatibility with older versions of latexmk,
+ the default is to set $analyze_input_log_always to 1.
+ 13 September 2020 33
-LATEXMK(1) General Commands Manual LATEXMK(1)
- situation: 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,
- the default is to set $analyze_input_log_always to 1.
+LATEXMK(1) General Commands Manual LATEXMK(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
- the directory to which general output files are to be written.
+ written by a run of *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
- version of (pdf)latex.
+ Important note: The effect of $aux_dir, if different from
+ $out_dir, is achieved by giving *latex the -aux-directory. Cur-
+ rently (Dec. 2011 and later) this only works on the MiKTeX ver-
+ sion of *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
+ If you also use the -cd option, and $out_dir (or $aux_dir) con-
+ tains a relative path, then the path is interpreted relative to
the document directory.
$banner [0]
- If nonzero, the banner message is printed across each page when
- 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
@@ -2236,40 +2223,40 @@ 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
+ black, 1 is white. The default is just right if your toner car-
+ tridge isn't running too low.
+ $banner_message ["DRAFT"]
+ The banner message to print across each page when converting the
+ dvi file to postscript. This is equivalent to the -bm option.
+ $banner_scale [220.0]
+ A decimal number that specifies how large the banner message
+ will be printed. Experimentation is necessary to get the right
+ scale for your message, as a rule of thumb the scale should be
+ about equal to 1100 divided by the number of characters in the
- 17 April 2020 34
+ 13 September 2020 34
-LATEXMK(1) General Commands Manual LATEXMK(1)
- 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.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $banner_message ["DRAFT"]
- The banner message to print across each page when converting the
- dvi file to postscript. This is equivalent to the -bm option.
- $banner_scale [220.0]
- A decimal number that specifies how large the banner message
- will be printed. Experimentation is necessary to get the right
- scale for your message, as a rule of thumb the scale should be
- about equal to 1100 divided by the number of characters in the
- message. The Default is just right for 5 character messages.
+ 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 de-
- fault 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.
+ This is an array variable, now mostly obsolete, that specifies
+ directories where latexmk should look for .bib files. By de-
+ fault 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.
The format of the directory names depends on your operating sys-
tem, of course. Examples for setting this variable are:
@@ -2279,57 +2266,55 @@ 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
+ 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.
$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 [0]
+ When using bibtex, whether to take special action to allow older
+ versions of bibtex to work when $out_dir or $aux_dir is speci-
+ fied. With bibtex from about 2019, this special action is
+ longer be required; hence the default is not to do it.
+ $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
- 17 April 2020 35
-
+ 13 September 2020 35
-LATEXMK(1) General Commands Manual LATEXMK(1)
- $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 re-
- quired.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $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
+ whenever 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
@@ -2368,32 +2353,32 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
This operation is somewhat dangerous, and can have unintended
consequences, since the files to be deleted are determined from
+ a file created by *latex, which can contain erroneous informa-
+ tion. Therefore this variable is turned off by default, and then
+ files to be deleted are restricted to those explictly specified
+ by patterns configured in the variables clean_ext,
+ clean_full_ext, and @generated_exts, together with those very
+ standard cases that are hardwired into latexmk (e.g., .log
+ 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 ex-
+ cept for dep and aux files. (There is also extra cleaning as
+ specified by the $clean_ext, $clean_full_ext and @generated_exts
+ variables.)
- 17 April 2020 36
+ 13 September 2020 36
-LATEXMK(1) General Commands Manual LATEXMK(1)
- a file created by (pdf)latex, which can contain erroneous infor-
- mation. Therefore this variable is turned off by default, and
- then files to be deleted are restricted to those explictly spec-
- ified by patterns configured in the variables clean_ext,
- clean_full_ext, and @generated_exts, together with those very
- standard cases that are hardwired into latexmk (e.g., .log
- files).
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $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 ex-
- cept 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
@@ -2434,18 +2419,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$clean_ext = "pythontex-files-%R pythontex-files-%R";
-
-
-
- 17 April 2020 37
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
See also the variable @generated_exts.
$clean_full_ext [""]
@@ -2462,6 +2435,17 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$compiling_cmd [""], $failure_cmd [""], $warning_cmd [""], $success_cmd
[""]
+
+
+ 13 September 2020 37
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
These variables specify commands that are executed at certain
points of compilations. One motivation for their existance is
to allow very useful convenient visual indications of compila-
@@ -2500,18 +2484,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
-
-
-
- 17 April 2020 38
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
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".
@@ -2529,6 +2501,17 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
be invoked. (See the section "Format of Command Specifications"
for how to do this.)
+
+
+ 13 September 2020 38
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
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
@@ -2567,17 +2550,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
@default_files [("*.tex")]
Default list of files to be processed.
-
-
- 17 April 2020 39
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
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-
@@ -2594,6 +2566,18 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
@default_files = ("paper_current");
+
+
+
+ 13 September 2020 39
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
@default_files = ("paper1", "paper2.tex");
@default_files = ("*.tex", "*.dtx");
@@ -2627,326 +2611,325 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
Whether to change working directory to the directory specified
for the main source file before processing it. The default be-
havior is not to do this, which is the same as the behavior of
- latex and pdflatex programs. This variable is set by the -cd
- and -cd- options on latexmk's command line.
+ *latex programs. This variable is set by the -cd and -cd- op-
+ tions on latexmk's command line.
$dvi_filter [empty]
- The dvi file filter to be run on the newly produced dvi file
+ The dvi file filter to be run on the newly produced dvi file be-
+ fore 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 re-
+ quests 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.
- 17 April 2020 40
+ $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
+ 13 September 2020 40
-LATEXMK(1) General Commands Manual LATEXMK(1)
- before other processing. Equivalent to specifying the -dF op-
- tion.
- $dvi_mode [See below for default]
- If nonzero, generate a dvi version of the document. Equivalent
- to the -dvi option.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- The variable $dvi_mode defaults to 0, but if no explicit re-
- quests 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.
- $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
+ 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.
$dvi_previewer_landscape ["start xdvi %O %S"]
The command to invoke a dvi-previewer in landscape mode. [Under
- MS-Windows the default is "start"; then latexmk arranges to use
- the MS-Windows start program, which will cause to be run what-
+ MS-Windows the default is "start"; then latexmk arranges to use
+ the MS-Windows start program, which will cause to be run what-
ever command the system has associated with .dvi files.]
$dvipdf ["dvipdf %O %S %D"]
- Command to convert .dvi to .pdf file. A common reconfiguration
- is to use the dvipdfm command, which needs its arguments in a
+ Command to convert .dvi to .pdf file. A common reconfiguration
+ is to use the dvipdfm command, which needs its arguments in a
different order:
$dvipdf = "dvipdfm %O -o %D %S";
- WARNING: The default dvipdf script generates pdf files with
+ WARNING: The default dvipdf script generates pdf files with
bitmapped fonts, which do not look good when viewed by acroread.
- That script should be modified to give dvips the options "-P
+ That script should be modified to give dvips the options "-P
pdf" to ensure that type 1 fonts are used in the pdf file.
$dvipdf_silent_switch ["-q"]
Switch(es) for dvipdf program when silent mode is on.
- N.B. The standard dvipdf program runs silently, so adding the
- silent switch has no effect, but is actually innocuous. But if
- an alternative program is used, e.g., dvipdfmx, then the silent
- switch has an effect. The default setting is correct for
+ N.B. The standard dvipdf program runs silently, so adding the
+ silent switch has no effect, but is actually innocuous. But if
+ an alternative program is used, e.g., dvipdfmx, then the silent
+ switch has an effect. The default setting is correct for
+ dvipdfm and dvipdfmx.
+ $dvips ["dvips %O -o %D %S"]
+ The program to used as a filter to convert a .dvi file to a .ps
+ file. If pdf is going to be generated from pdf, then the value
+ of the $dvips_pdf_switch variable -- see below -- will be in-
+ cluded 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.
- 17 April 2020 41
+ $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)
+ 13 September 2020 41
- 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 in-
- cluded 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
+ 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 $pdf_up-
+ How the dvi viewer updates its display when the dvi file has
+ changed. The values here apply equally to the $pdf_up-
date_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 ap-
+ 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 ap-
propriate 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 is-
+ sue, which can affect the use of files that are on a remote
+ filesystem (network share) instead of being on a file system lo-
+ cal to the computer running latexmk. Almost users will not have
+ to worry about these settings, and can ignore the following ex-
+ planation.
- 17 April 2020 42
+ In almost all situations, latexmk does not need to use the time
+ 13 September 2020 42
-LATEXMK(1) General Commands Manual LATEXMK(1)
- $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 is-
- sue, which can affect the use of files that are on a remote
- filesystem (network share) instead of being on a file system lo-
- cal to the computer running latexmk. Almost users will not have
- to worry about these settings, and can ignore the following ex-
- planation.
- 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 be-
- fore 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 as-
- sumed 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
+ 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., *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 earlier
+ than when the program was started, the file is a leftover file,
+ which latexmk treats as if it were not created. If the filetime
+ is at least the program start time, then it can be assumed that
+ the file was created in the current run.
+
+ Unfortunately, this test can fail if the file is on a remote
+ system, since its system time is not necessarily synchronized
+ with that of the local system; the timestamps on the remote
+ files are set by the remote system, not the local system. Gen-
+ erally, modern operating systems regularly synchronize their
+ time with a server, so the non-synchronization is mostly small
(a second or so, or a few seconds). But even a small difference
can mess up latexmk's test.
Latexmk measures the time difference between the time on the two
- systems and compensates for this. But the measurement (in a
+ systems and compensates for this. But the measurement (in a
system-independent way) is only accurate to a second or two. So
- latexmk allows for a threshold on the difference between file
- and system time before it concludes that a file is a leftover
- file from a previous run. The configuration variable $file-
- time_causality_theshhold, which in units of seconds, specifies
+ latexmk allows for a threshold on the difference between file
+ and system time before it concludes that a file is a leftover
+ file from a previous run. The configuration variable $file-
+ time_causality_theshhold, which in units of seconds, specifies
this threshold. Luckily high precision is not needed. The pre-
- vious run is normally the previous run in a human run-edit-run
- cycle, and is at least many seconds back. A few seconds is
- therefore appropriate for the threshold, $filetime_causal-
- ity_theshhold; it should be non-negative always, and should be
+ vious run is normally the previous run in a human run-edit-run
+ cycle, and is at least many seconds back. A few seconds is
+ therefore appropriate for the threshold, $filetime_causal-
+ ity_theshhold; it should be non-negative always, and should be
bigger than 2 if a remote filesystem or network share is used.
- If the difference in system times on the two systems is large,
- it normally indicates that at least one of the systems is mis-
- configured. The variable $filetime_offset_report_threshold
- specifies the smallest size of the difference (or offset) in
-
+ 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.
- 17 April 2020 43
+ $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.
+ 13 September 2020 43
-LATEXMK(1) General Commands Manual LATEXMK(1)
- 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.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- @generated_exts [( aux , bbl , idx , ind , lof , lot , out , toc ,
- $fdb_ext )]
- This contains a list of extensions for files that are generated
- during a LaTeX run and that are read in by LaTeX in later runs,
- either directly or indirectly.
- This list specifies files known to be generated by latex (and
- pdflatex, etc). It is used in two ways: (a) The specified files
- are deleted in a cleanup operation (with the -c, -C, -CA, -g and
- -gg options), and (b) It affects the determination of whether a
- rerun of (pdf)LaTeX is needed after a run that gives an error.
+ This list specifies files known to be generated by *latex. It
+ is used in two ways: (a) The specified files are deleted in a
+ cleanup operation (with the -c, -C, -CA, -g and -gg options),
+ and (b) It affects the determination of whether a rerun of *la-
+ tex is needed after a run that gives an error.
(Concerning item (b): 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 not
- 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
+ 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 not
+ 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 au-
- tomatically generated files; it determines the automatically
- generated files as those with extensions in the list in @gener-
+ tomatically generated files; it determines the automatically
+ generated files as those with extensions in the list in @gener-
ated_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 ex-
- tensions. (This extension is used by the RevTeX package, for
+ tensions. (This extension is used by the RevTeX package, for
example.)
$go_mode [0]
- If nonzero, process files regardless of timestamps, and is then
+ If nonzero, process files regardless of timestamps, and is then
equivalent to the -g option.
%hash_calc_ignore_pattern
!!!This variable is for experts only!!!
- The general rule latexmk uses for determining when an extra run
- of some program is needed is that one of the source files has
- changed. But consider for example a latex package that causes
+ 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: ';
- 17 April 2020 44
+ 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
+ 13 September 2020 44
-LATEXMK(1) General Commands Manual LATEXMK(1)
- 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:
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: ';
- This creates a rule for files with extension .eps about lines to
- ignore. The left-hand side is a Perl idiom for setting an item
- in a hash. Note that the file extension is specified without a
- period. The value, on the right-hand side, is a string contain-
- ing a regular expresssion. (See documentation on Perl for how
- they are to be specified in general.) This particular regular
- expression specifies that lines beginning with "%%CreationDate:
- " are to be ignored in deciding whether a file of the given ex-
- tension .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 ex-
- pression. The simplest method is separate the different simple
- patterns by a vertical bar character (indicating "alternation"
+ containing 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 "%%Cre-
+ ationDate: " 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 ex-
+ pression. The simplest method is separate the different simple
+ patterns by a vertical bar character (indicating "alternation"
in the jargon of regular expressions). For example,
- $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: |^%%Ti-
+ $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: |^%%Ti-
tle: ';
causes lines starting with either "^%%CreationDate: " or "^%%Ti-
tle: " 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'};
@@ -2954,127 +2937,127 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$jobname [""]
- This specifies the jobname, i.e., the basename that is used for
- generated files (.aux, .log, .dvi, .ps, .pdf, etc). If this
- variable is a null string, then the basename is the basename of
- the main tex file. (At present, the string in $jobname should
+ This specifies the jobname, i.e., the basename that is used for
+ generated files (.aux, .log, .dvi, .ps, .pdf, etc). If this
+ variable is a null string, then the basename is the basename of
+ the main tex file. (At present, the string in $jobname should
not contain spaces.)
- The placeholder '%A' is permitted. This will be substituted by
- the basename of the TeX file. The primary purpose is when a
+ The placeholder '%A' is permitted. This will be substituted by
+ the basename of the TeX file. The primary purpose is when a va-
+ riety of tex files are to be processed, and you want to use a
+ different jobname for each but one that is distinct for each.
+ Thus if you wanted to compare compilations of a set of files on
+ different operating systems, with distinct filenames for all the
+ cases, you could set
+ $jobname = "%A-$^O";
+ in an initialization file. (Here $^O is a variable provided by
+ perl that contains perl's name for the operating system.)
- 17 April 2020 45
+ Suppose you had .tex files test1.tex and test2.tex. Then when
+ you run
+ latexmk -pdf *.tex
+ both files will be compiled. The .aux, .log, and .pdf files
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ 13 September 2020 45
- variety of tex files are to be processed, and you want to use a
- different jobname for each but one that is distinct for each.
- Thus if you wanted to compare compilations of a set of files on
- different operating systems, with distinct filenames for all the
- cases, you could set
- $jobname = "%A-$^O";
- in an initialization file. (Here $^O is a variable provided by
- perl that contains perl's name for the operating system.)
- Suppose you had .tex files test1.tex and test2.tex. Then when
- you run
+LATEXMK(1) General Commands Manual LATEXMK(1)
- latexmk -pdf *.tex
- both files will be compiled. The .aux, .log, and .pdf files
- will have basenames test1-MSWin32 ante test2-MSWin32 on a MS-
+ will have basenames test1-MSWin32 ante test2-MSWin32 on a MS-
Windows system, test1-darwin and test2-darwin on an OS-X system,
and a variety of similar cases on linux systems.
$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-
+ 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, no-
tably 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,
+ 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 la-
+ (For advanced users: Because of the different way in which la-
texmk uses the command specified in $kpsewhich, some of the pos-
sibilities listed in the FORMAT OF COMMAND SPECIFICATIONS do not
- apply. The internal and start keywords are not available. A
+ apply. The internal and start keywords are not available. A
simple command specification with possible options and then "%S"
- is all that is guaranteed to work. Note that for other com-
+ is all that is guaranteed to work. Note that for other com-
mands, "%S" is substituted by a single source file. In contrast,
for $kpsewhich, "%S" may be substituted by a long list of space-
- separated filenames, each of which is quoted. The result on
+ separated filenames, each of which is quoted. The result on
STDOUT of running the command is then piped to latexmk.)
- See also the @BIBINPUTS variable for another way that latexmk
+ See also the @BIBINPUTS variable for another way that latexmk
also uses to try to locate files; it applies only in the case of
.bib files.
$kpsewhich_show [0]
- Whether to show diagnostics about invocations of kpsewhich: the
- command line use to invoke it and the results. These diagnos-
- tics are shown if $kpsewhich_show is non-zero or if diagnostics
- mode is on. (But in the second case, lots of other diagnostics
- are also shown.) Without these diagnostics there is nothing
- visible in latexmk's screen output about invocations of kpse-
+ 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.
+ $landscape_mode [0]
+ If nonzero, run in landscape mode, using the landscape mode pre-
+ viewers and dvi to postscript converters. Equivalent to the -l
+ option. Normally not needed with current previewers.
+ $latex ["latex %O %S"]
+ Specifies the command line for the LaTeX processing program.
+ Note that as with other programs, you can use this variable not
+ just to change the name of the program used, but also specify
+ options to the program. E.g.,
- 17 April 2020 46
+ $latex = "latex --src-specials %O %S";
+ To do a coordinated setting of all of $latex, $pdflatex, $luala-
+ tex, and $xelatex, see the section "Advanced Configuration".
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ 13 September 2020 46
- $landscape_mode [0]
- If nonzero, run in landscape mode, using the landscape mode pre-
- viewers and dvi to postscript converters. Equivalent to the -l
- option. Normally not needed with current previewers.
- $latex ["latex %O %S"]
- Specifies the command line for the LaTeX processing program.
- Note that as with other programs, you can use this variable not
- just to change the name of the program used, but also specify
- options to the program. E.g.,
- $latex = "latex --src-specials %O %S";
- To do a coordinated setting of all of $latex, $pdflatex, $luala-
- tex, and $xelatex, see the section "Advanced Configuration".
+LATEXMK(1) General Commands Manual LATEXMK(1)
%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_in-
- put_ext. They are used as in the following examples are possi-
+ (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_in-
+ put_ext. They are used as in the following examples are possi-
ble lines in an initialization file:
remove_input_ext( 'latex', 'tex' );
@@ -3083,31 +3066,19 @@ 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.
-
-
-
- 17 April 2020 47
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
- 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-er-
@@ -3117,19 +3088,30 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
$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-
+
+
+ 13 September 2020 47
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
+ 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.
@@ -3139,60 +3121,58 @@ 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 in-
+ Under MS-Windows you could set this to use gsview, if it is in-
stalled, e.g.,
$lpr = '"c:/Program Files/Ghostgum/gsview/gsview32.exe" /p';
- If gsview is installed in a different directory, you will need
- to make the appropriate change. Note the double quotes around
+ If gsview is installed in a different directory, you will need
+ to make the appropriate change. Note the double quotes around
the name: this is necessary because one part of the command name
("Program Files") contains a space which would otherwise be mis-
interpreted.
$lualatex ["lualatex %O %S"]
Specifies the command line for the LaTeX processing program that
- is to be used when the lualatex program is called for (e.g., by
+ is to be used when the lualatex program is called for (e.g., by
the option -lualatex.
To do a coordinated setting of all of $latex, $pdflatex, $luala-
tex, and $xelatex, see the section "Advanced Configuration".
+ %lualatex_input_extensions
+ This variable specifies the extensions tried by latexmk when it
+ finds that a lualatex run resulted in an error that a file has
+ not been found, and the file is given without an extension.
+ This typically happens when LaTeX commands of the form \in-
+ put{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 de-
+ fault extensions are 'tex', 'pdf', 'jpg, and 'png'.
+ See details of the %latex_input_extensions for other information
+ that equally applies to %lualatex_input_extensions.
-
- 17 April 2020 48
-
+ $lualatex_silent_switch ["-interaction=batchmode"]
+ Switch(es) for the lualatex program (specified in the variable
+ $lualatex) when silent mode is on.
+ 13 September 2020 48
-LATEXMK(1) General Commands Manual LATEXMK(1)
- %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 \in-
- put{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 de-
- fault extensions are 'tex', 'pdf', 'jpg, and 'png'.
- See details of the %latex_input_extensions for other information
- that equally applies to %lualatex_input_extensions.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $lualatex_silent_switch ["-interaction=batchmode"]
- 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"]
@@ -3202,18 +3182,17 @@ 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 be-
- fore 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
- normal cases.
+ The maximum number of times latexmk will run *latex before de-
+ ciding that there may be an infinite loop and that it needs to
+ bail out, rather than rerunning *latex again to resolve cross-
+ references, etc. The default value covers all normal cases.
- (Note that the "etc" covers a lot of cases where one run of la-
- tex/pdflatex generates files to be read in on a later run.)
+ (Note that the "etc" covers a lot of cases where one run of *la-
+ tex generates files to be read in on a later run.)
$MSWin_back_slash [1]
This configuration variable only has an effect when latexmk is
@@ -3225,24 +3204,12 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
Unix-like systems.
For almost all programs and for almost all filenames under MS-
- Windows, both "\" and "/" are acceptable as the directory
-
-
-
- 17 April 2020 49
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
- separator character, provided at least that filenames are prop-
- erly quoted. But it is possible that programs exist that only
- accept "\" on the command line, since that is the standard di-
- rectory separator for MS-Windows. So for safety latexmk makes
- the substitution from "/" to "\", by default.
+ Windows, both "\" and "/" are acceptable as the directory sepa-
+ rator character, provided at least that filenames are properly
+ quoted. But it is possible that programs exist that only accept
+ "\" on the command line, since that is the standard directory
+ separator for MS-Windows. So for safety latexmk makes the sub-
+ stitution from "/" to "\", by default.
However there are also programs on MS-Windows for which a back
slash "\" is interpreted differently than as a directory separa-
@@ -3259,16 +3226,28 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
+
+
+
+ 13 September 2020 49
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
no viewer is running.
$out_dir [""]
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.
+ output files are to be written by a run of *latex. See also the
+ variable $aux_dir.
The effect of this variable (when non-blank) is achieved by us-
- ing the -output-directory option of (pdf)latex. This exists in
- the usual current (Dec. 2011 and later) implementations of TeX,
+ ing the -output-directory option of *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.
@@ -3292,18 +3271,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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
-
-
-
- 17 April 2020 50
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
variable openout_any to "a" (as in "all"), to override the de-
fault "paranoid" setting.
@@ -3325,6 +3292,18 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
made. In $pdf_mode=3, it is ensured that a .dvi file is also
made. But this may be overridden by the document.
+
+
+
+ 13 September 2020 50
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
$pdflatex ["pdflatex %O %S"]
Specifies the command line for the LaTeX processing program in a
version that makes a pdf file instead of a dvi file.
@@ -3359,17 +3338,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
See details of the %latex_input_extensions for other information
that equally applies to %pdflatex_input_extensions.
-
-
- 17 April 2020 51
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
$pdflatex_silent_switch ["-interaction=batchmode"]
Switch(es) for the pdflatex program (specified in the variable
$pdflatex) when silent mode is on.
@@ -3391,6 +3359,17 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
file. By default, for pdf files this association is to OS-X's
preview, which is quite satisfactory.
+
+
+ 13 September 2020 51
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
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
@@ -3425,17 +3404,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
Note that acroread under MS-Windows (but not UNIX) locks the pdf
file, so the default value is then 3.
-
-
- 17 April 2020 52
-
-
-
-
-
-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:
@@ -3456,6 +3424,18 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
variable $pdf_update_method. The default value is the one ap-
propriate for gv on a UNIX system.
+
+
+
+ 13 September 2020 52
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
$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.
@@ -3491,17 +3471,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
- 17 April 2020 53
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
$preview_continuous_mode [0]
If nonzero, run a previewer to view the document, and continue
running latexmk to keep .dvi up-to-date. Equivalent to the -pvc
@@ -3520,6 +3489,19 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
mended not to be set from an RC file, otherwise you could waste
lots of paper.
+
+
+
+
+ 13 September 2020 53
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
$print_type = ["auto"]
Type of file to printout: possibilities are "auto", "dvi",
"none", "pdf", or "ps". See the option -print= for the meaning
@@ -3556,18 +3538,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
Note that gv could be used with the -watch option updates its
display whenever the postscript file changes, whereas ghostview
-
-
-
- 17 April 2020 54
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
does not. However, different versions of gv have slightly dif-
ferent ways of writing this option. You can configure this
variable appropriately.
@@ -3587,6 +3557,17 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
in yourself, whenever it is needed.
+
+
+ 13 September 2020 54
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
$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.
@@ -3623,17 +3604,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
The period of inactivity, in minutes, after which pvc mode times
out. This is used if $pvc_timeout is nonzero.
-
-
- 17 April 2020 55
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
$pvc_view_file_via_temporary [1]
The same as $always_view_file_via_temporary, except that it only
applies in preview-continuous mode (-pvc option).
@@ -3647,51 +3617,81 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
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 la-
- tex 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.)
+ characters, notably spaces. (But note that many versions of
+ *latex 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 passing 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)la-
- tex supports the -recorder option, which is true for most cur-
- rent implementations
- 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.
+ 13 September 2020 55
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
+ $recorder [1]
+ Whether to use the -recorder option to (latex 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.
+
+ It is generally recommended to use this option (or to configure
+ the $recorder variable to be on.) But it only works if *latex
+ supports the -recorder option, which is true for most current
+ implementations
+
+ Note about the name of the .fls file: Most implementations of
+ *latex produce an .fls file with the same basename as the main
+ document's LaTeX, e.g., for Document.tex, the .fls file is Docu-
+ ment.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 pdflatex.fls to a
+ file with the basename of the main LaTeX document, e.g., Docu-
+ ment.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.
+ dvipdf, dvips, and *latex.
+
+ [Comment to technically savvy readers: *latex doesn't actually
+ 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 op-
+ erating 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.)
- [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.]
+ $show_time [0]
+ Whether to show CPU time used.
+ $silence_logfile_warnings [0]
+ Whether after a run of *latex to summarize warnings in the log
+ file about undefined citations and references. Setting $si-
+ lence_logfile_warnings=0 gives the summary of warnings (provided
+ silent mode isn't also set), and this is useful to locate unde-
+ fined citations and references without searching through the
+ much more verbose log file or the screen output of *latex. But
- 17 April 2020 56
+ 13 September 2020 56
@@ -3700,179 +3700,158 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
LATEXMK(1) General Commands Manual LATEXMK(1)
- The default under MSWin and Cygwin is ';' and under UNIX-like
- operating systems (including Linux and OS-X) is ':'. Normally
- the defaults give correct behavior. But there can be difficul-
- ties if your operating system is of one kind, but some of your
- software is running under an emulator for the other kind of op-
- erating 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 $si-
- lence_logfile_warnings=0 gives the summary of warnings (provided
- silent mode isn't also set), and this is useful to locate unde-
- fined citations and references without searching through the
- 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 -si-
- lence_logfile_warning_list and -silence_logfile_warning_list-
+ the summary can also be excessively annoying. The default is
+ not to give these warnings. The command line options -si-
+ lence_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 ef-
+ Whether to run silently. Setting $silent to 1 has the same ef-
fect 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 al-
+ minimum of one second delay, except that zero delay is also al-
lowed.
- A value of exactly 0 gives no delay, and typically results in
+ 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".
$success_cmd [undefined]
See the documentation for $compiling_cmd.
+ $tmpdir [See below for default]
+ Directory to store temporary files that latexmk may generate
+ while running.
+ The default under MSWindows (including cygwin), is to set $tm-
+ pdir to the value of the first of whichever of the system envi-
+ ronment variables TMPDIR or TEMP exists, otherwise to the cur-
+ rent 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, 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 pro-
+ gram.
- 17 April 2020 57
+ Note that once a missing file has been made, no further calls to
+ 13 September 2020 57
-LATEXMK(1) General Commands Manual LATEXMK(1)
- $tmpdir [See below for default]
- Directory to store temporary files that latexmk may generate
- while running.
- The default under MSWindows (including cygwin), is to set $tm-
- pdir to the value of the first of whichever of the system envi-
- ronment variables TMPDIR or TEMP exists, otherwise to the cur-
- rent 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".
+LATEXMK(1) General Commands Manual LATEXMK(1)
- $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
- 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
+ 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
+ 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).
$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-
+ 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 la-
+ pleted all the runs it needs to try and resolve references and
+ citations. Thus $warnings_as_errors being nonzero causes la-
texmk to treat such warnings as errors, but only when they occur
- on the last run of (pdf)latex and only after processing is com-
- plete. A non-zero value $warnings_as_errors can be set by the
- command-line option -Werror.
+ on the last run of *latex and only after processing is 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
-
-
+ 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 *latex are generally
+ 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-
+ 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
+ is rather complicated, because latexmk has to deal with the case
+ that one or more of the commands isn't set.)
- 17 April 2020 58
+ 13 September 2020 58
-LATEXMK(1) General Commands Manual LATEXMK(1)
- as part of a build process for some bigger project, e.g., for
- creating documentation in the build of a software application.
- Then it is often sensible to treat citation and reference warn-
- 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-
- 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
- is rather complicated, because latexmk has to deal with the case
- that one or more of the commands isn't set.)
+LATEXMK(1) General Commands Manual LATEXMK(1)
$xdvipdfmx ["xdvipdfmx -E -o %D %O %S"]
- The program to make a pdf file from an xdv file (used in con-
+ 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 %O %S"]
- Specifies the command line for the LaTeX processing program of
- when the xelatex program is called for. See the documentation
- of the -xelatex option for some special properties of latexmk's
+ Specifies the command line for the LaTeX processing program of
+ when the xelatex program is called for. See the documentation
+ of the -xelatex option for some special properties of latexmk's
use of xelatex.
- Note about xelatex: latexmk uses xelatex to make an .xdv rather
- than .pdf file, with the .pdf file being created in a separate
+ Note about xelatex: latexmk uses xelatex to make an .xdv rather
+ than .pdf file, with the .pdf file being created in a separate
step. This is enforced by the use of the -no-pdf option. If %O
- is part of the command for invoking xelatex, then latexmk will
+ is part of the command for invoking xelatex, then latexmk will
insert the -no-pdf option automatically, otherwise you must pro-
- vide the option yourself. See the documentation for the -pdfxe
+ vide the option yourself. See the documentation for the -pdfxe
option for why latexmk makes a .xdv file rather than a .pdf file
when xelatex is used.
@@ -3881,45 +3860,46 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
%xelatex_input_extensions
- This variable specifies the extensions tried by latexmk when it
- finds that an xelatex run resulted in an error that a file has
- not been found, and the file is given without an extension.
- This typically happens when LaTeX commands of the form \in-
- put{file} or \includegraphics{figure}, when the relevant source
+ This variable specifies the extensions tried by latexmk when it
+ finds that an xelatex run resulted in an error that a file has
+ not been found, and the file is given without an extension.
+ This typically happens when LaTeX commands of the form \in-
+ put{file} or \includegraphics{figure}, when the relevant source
+ file does not exist.
+ In this situation, latexmk searches for custom dependencies to
+ make the missing file(s), but restricts it to the extensions
+ specified by the variable %xelatex_input_extensions. The de-
+ fault extensions are 'tex', 'pdf', 'jpg, and 'png'.
+ See details of the %latex_input_extensions for other information
+ that equally applies to %xelatex_input_extensions.
- 17 April 2020 59
+ $xelatex_silent_switch ["-interaction=batchmode"]
+ Switch(es) for the xelatex program (specified in the variable
+ $xelatex) when silent mode is on.
+ See details of the $latex_silent_switch for other information
+ that equally applies to $xelatex_silent_switch.
-LATEXMK(1) General Commands Manual LATEXMK(1)
- file does not exist.
- In this situation, latexmk searches for custom dependencies to
- make the missing file(s), but restricts it to the extensions
- specified by the variable %xelatex_input_extensions. The de-
- fault extensions are 'tex', 'pdf', 'jpg, and 'png'.
- See details of the %latex_input_extensions for other information
- that equally applies to %xelatex_input_extensions.
+ 13 September 2020 59
- $xelatex_silent_switch ["-interaction=batchmode"]
- Switch(es) for the xelatex program (specified in the variable
- $xelatex) when silent mode is on.
- See details of the $latex_silent_switch for other information
- that equally applies to $xelatex_silent_switch.
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
CUSTOM DEPENDENCIES
- In any RC file a set of custom dependencies can be set up to convert a
+ In any RC file a set of custom dependencies can be set up to convert a
file with one extension to a file with another. An example use of this
would be to allow latexmk to convert a .fig file to .eps to be included
in the .tex file.
@@ -3927,9 +3907,9 @@ CUSTOM DEPENDENCIES
Defining a custom dependency:
The old method of configuring latexmk to use a custom dependency was to
- directly manipulate the @cus_dep_list array that contains information
- defining the custom dependencies. (See the section "Old Method of
- Defining Custom Dependencies" for details.) This method still works,
+ directly manipulate the @cus_dep_list array that contains information
+ defining the custom dependencies. (See the section "Old Method of
+ Defining Custom Dependencies" for details.) This method still works,
but is no longer preferred.
A better method is to use the subroutines that allow convenient manipu-
@@ -3942,106 +3922,92 @@ CUSTOM DEPENDENCIES
The arguments are as follows:
from extension:
- The extension of the file we are converting from (e.g. "fig").
+ The extension of the file we are converting from (e.g. "fig").
It is specified without a period.
to extension:
The extension of the file we are converting to (e.g. "eps"). It
is specified without a period.
- must: If non-zero, the file from which we are converting must exist,
- if it doesn't exist latexmk will give an error message and exit
+ must: If non-zero, the file from which we are converting must exist,
+ if it doesn't exist latexmk will give an error message and exit
unless the -f option is specified. If must is zero and the file
+ we are converting from doesn't exist, then no action is taken.
+ Generally, the appropriate value of must is zero.
+ function:
+ The name of the subroutine that latexmk should call to perform
+ the file conversion. The first argument to the subroutine is
+ the 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
+ if it failed.
- 17 April 2020 60
-
-
+ 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 show_cus_dep causes a list of the currently defined cus-
+ tom dependencies to be sent to the screen output.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ 13 September 2020 60
- 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 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
- 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
- new one.
- 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.
+LATEXMK(1) General Commands Manual LATEXMK(1)
How custom dependencies are used:
An instance of a custom dependency rule is created whenever latexmk de-
- tects that a run of latex/pdflatex needs to read a file, like a graph-
- ics 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 corresponding from-extension, as specified in the custom-de-
- pendency. If it does, then a corresponding instance of the custom de-
- pendency is created, after which the rule is invoked whenever the des-
- tination file (the one with the to-extension) is out-of-date with re-
- spect to the corresponding source file.
-
- To make the new destination file, the Perl subroutine specified in the
+ tects that a run of *latex needs to read a file, like a graphics file,
+ whose extension is the to-extension of a custom dependency. Then la-
+ texmk 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 cor-
+ responding 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,
+ question. Simple cases just involve a subroutine invoking an external
+ program; this can be done by following the templates below, even by
+ those without knowledge of the Perl programming language. Of course,
experts could do something much more elaborate.
- One item in the specification of each custom-dependency rule, labeled
- "must" above, specifies how the rule should be applied when the source
+ One item in the specification of each custom-dependency rule, labeled
+ "must" above, specifies how the rule should be applied when the source
file fails to exist.
- When latex reports that an input file (e.g., a graphics file) does not
+ When latex reports that an input file (e.g., a graphics file) does not
exist, latexmk tries to find a source file and a custom dependency that
can be used to make it. If it succeeds, then it creates an instance of
- the custom dependency and invokes it to make the missing file, after
+ the custom dependency and invokes it to make the missing file, after
which the next pass of latex etc will be able to read the newly created
file.
- Note for advanced usage: The operating system's environment variable
+ Note for advanced usage: The operating system's environment variable
TEXINPUTS can be used to specify a search path for finding files by la-
- tex etc. Correspondingly, when a missing file is reported, latexmk
-
-
-
- 17 April 2020 61
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
- 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-
+ tex etc. Correspondingly, when a missing file is reported, latexmk
+ looks in the directories specified in TEXINPUTS as well as in the cur-
+ rent directory, to find a source file from which an instance of a cus-
tom dependency can be used to make the missing file.
Function to implement custom dependency, traditional method:
- The function that implements a custom dependency gets the information
+ The function that implements a custom dependency gets the information
on the files to be processed in two ways. The first is through its one
- argument; the argument contains the base name of the source and desti-
+ argument; the argument contains the base name of the source and desti-
nation files. The second way is described later.
- A simple and typical example of code in an initialization rcfile using
+ A simple and typical example of code in an initialization rcfile using
the first method is:
add_cus_dep( 'fig', 'eps', 0, 'fig2eps' );
@@ -4049,57 +4015,58 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
system( "fig2dev -Leps \"$_[0].fig\" \"$_[0].eps\"" );
}
- The first line adds a custom dependency that converts a file with ex-
+ The first line adds a custom dependency that converts a file with ex-
tension "fig", as created by the xfig program, to an encapsulated post-
- script file, with extension "eps". The remaining lines define a sub-
- routine that carries out the conversion. If a rule for converting
- "fig" to "eps" files already exists (e.g., from a previously read-in
- initialization file), the latexmk will delete this rule before making
- the new one.
+ script file, with extension "eps". The remaining lines define a
- Suppose latexmk is using this rule to convert a file "figure.fig" to
- "figure.eps". Then it will invoke the fig2eps subroutine defined in
- the above code with a single argument "figure", which is the basename
- of each of the files (possibly with a path component). This argument
- is referred to by Perl as $_[0]. In the example above, the subroutine
- uses the Perl command system to invoke the program fig2dev. The double
- quotes around the string are a Perl idiom that signify that each string
- of the form of a variable name, $_[0] in this case, is to be substi-
- tuted by its value.
- If the return value of the subroutine is non-zero, then latexmk will
- assume an error occurred during the execution of the subroutine. In
- the above example, no explicit return value is given, and instead the
- return value is the value returned by the last (and only) statement,
- i.e., the invocation of system, which returns the value 0 on success.
- If you use pdflatex instead of latex, then you will probably prefer to
- convert your graphics files to pdf format, in which case you would re-
- place the above code in an initialization file by
+ 13 September 2020 61
- add_cus_dep( 'fig', 'pdf, 0, 'fig2pdf' );
- sub fig2pdf {
- system( "fig2dev -Lpdf \"$_[0].fig\" \"$_[0].pdf\"" );
- }
- Note 1: In the command lines given in the system commands in the above
- examples, double quotes have been inserted around the file names
- 17 April 2020 62
+LATEXMK(1) General Commands Manual LATEXMK(1)
+ subroutine that carries out the conversion. If a rule for converting
+ "fig" to "eps" files already exists (e.g., from a previously read-in
+ initialization file), the latexmk will delete this rule before making
+ the new one.
+ Suppose latexmk is using this rule to convert a file "figure.fig" to
+ "figure.eps". Then it will invoke the fig2eps subroutine defined in
+ the above code with a single argument "figure", which is the basename
+ of each of the files (possibly with a path component). This argument
+ is referred to by Perl as $_[0]. In the example above, the subroutine
+ uses the Perl command system to invoke the program fig2dev. The double
+ quotes around the string are a Perl idiom that signify that each string
+ of the form of a variable name, $_[0] in this case, is to be substi-
+ tuted by its value.
+ If the return value of the subroutine is non-zero, then latexmk will
+ assume an error occurred during the execution of the subroutine. In
+ the above example, no explicit return value is given, and instead the
+ return value is the value returned by the last (and only) statement,
+ i.e., the invocation of system, which returns the value 0 on success.
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ If you use pdflatex, lualatex or xelatex instead of latex, then you
+ will probably prefer to convert your graphics files to pdf format, in
+ which case you would replace the above code in an initialization file
+ by
+ add_cus_dep( 'fig', 'pdf, 0, 'fig2pdf' );
+ sub fig2pdf {
+ system( "fig2dev -Lpdf \"$_[0].fig\" \"$_[0].pdf\"" );
+ }
- (implemented by '\"' in the Perl language). They immunize the running
- of the program against special characters in filenames. Very often
- these quotes are not necessary, i.e., they can be omitted. But it is
- normally safer to keep them in. Even though the rules for quoting vary
+ Note 1: In the command lines given in the system commands in the above
+ examples, double quotes have been inserted around the file names (im-
+ plemented by '\"' in the Perl language). They immunize the running of
+ the program against special characters in filenames. Very often these
+ quotes are not necessary, i.e., they can be omitted. But it is nor-
+ mally safer to keep them in. Even though the rules for quoting vary
between operating systems, command shells and individual pieces of
software, the quotes in the above examples do not cause problems in the
cases I have tested.
@@ -4117,6 +4084,18 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
Note 3: The subroutines implementing custom dependencies in the exam-
ples given just have a single line invoking an external program.
That's the usual situation. But since the subroutines are in the Perl
+
+
+
+ 13 September 2020 62
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
language, you can implement much more complicated processing if you
need it.
@@ -4149,40 +4128,40 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
texmk, and many examples can be found, e.g., on the web.
However in later versions of latexmk the internal structure of the im-
- plementation of its "rules" for the steps of processing, including
+ plementation of its "rules" for the steps of processing, including cus-
+ tom dependencies, became much more powerful. The function implementing
+ a custom dependency is executed within a special context where a number
+ of extra variables and subroutines are defined. Publicly documented
+ ones, intended to be long-term stable, are listed below, under the
+ heading "Variables and subroutines for processing a rule".
+ Examples of their use is given in the following examples, concerning
+ multiple index files and glossaries.
+ The only index-file conversion built-in to latexmk is from an ".idx"
+ file written on one run of *latex to an ".ind" file to be read in on a
+ subsequent run. But with the index.sty package, for example, you can
+ create extra indexes with extensions that you configure. Latexmk does
+ not know how to deduce the extensions from the information it has. But
+ you can easily write a custom dependency. For example if your latex
+ file uses the command "\newindex{special}{ndx}{nnd}{Special index}" you
+ will need to get latexmk to convert files with the extension .ndx to
+ .nnd. The most elementary method is to define a custom dependency as
+ follows:
- 17 April 2020 63
+ add_cus_dep( 'ndx', 'nnd', 0, 'ndx2nnd' );
+ 13 September 2020 63
-LATEXMK(1) General Commands Manual LATEXMK(1)
- custom dependencies, became much more powerful. The function imple-
- menting a custom dependency is executed within a special context where
- a number of extra variables and subroutines are defined. Publicly doc-
- umented ones, intended to be long-term stable, are listed below, under
- the heading "Variables and subroutines for processing a rule".
- Examples of their use is given in the following examples, concerning
- multiple index files and glossaries.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- The only index-file conversion built-in to latexmk is from an ".idx"
- file written on one run of latex/pdflatex to an ".ind" file to be read
- in on a subsequent run. But with the index.sty package, for example,
- you can create extra indexes with extensions that you configure. La-
- texmk does not know how to deduce the extensions from the information
- it has. But you can easily write a custom dependency. For example if
- your latex file uses the command "\newindex{special}{ndx}{nnd}{Special
- index}" you will need to get latexmk to convert files with the exten-
- sion .ndx to .nnd. The most elementary method is to define a custom
- dependency as follows:
- add_cus_dep( 'ndx', 'nnd', 0, 'ndx2nnd' );
sub ndx2nnd {
return system( "makeindex -o \"$_[0].nnd\" \"$_[0].ndx\"" );
}
@@ -4216,44 +4195,44 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
This last example uses the command specification in $makeindex, and so
any customization you have made for the standard index also applies to
+ your extra indexes.
+ Similar techniques can be applied for glossaries.
+ Those of you with experience with Makefiles, may get concerned that the
+ .ndx file is written during a run of *latex and is always later than
+ the .nnd last read in. Thus the .nnd appears to be perpetually out-of-
+ date. This situation, of circular dependencies, is endemic to latex,
+ and is one of the issues that latexmk is programmed to overcome. It
+ examines the contents of the files (by use of a checksum), and only
+ does a remake when the file contents have actually changed.
- 17 April 2020 64
+ Of course if you choose to write random data to the .nnd (or the .aux
+ file, etc) that changes on each new run, then you will have a problem.
+ For real experts: See the %hash_calc_ignore_pattern if you have to deal
+ with such problems.
+ Old Method of Defining Custom Dependencies:
+ In much older versions of latexmk, the only method of defining custom
+ dependencies was to directly manipulate the table of custom
-LATEXMK(1) General Commands Manual LATEXMK(1)
+ 13 September 2020 64
- your extra indexes.
- Similar techniques can be applied for glossaries.
- Those of you with experience with Makefiles, may get concerned that the
- .ndx file is written during a run of latex/pdflatex and is always later
- than the .nnd last read in. Thus the .nnd appears to be perpetually
- out-of-date. This situation, of circular dependencies, is endemic to
- latex, and is one of the issues that latexmk is programmed to overcome.
- It examines the contents of the files (by use of a checksum), and only
- does a remake when the file contents have actually changed.
- Of course if you choose to write random data to the .nnd (or the .aux
- file, etc) that changes on each new run, then you will have a problem.
- For real experts: See the %hash_cal_ignore_pattern if you have to deal
- with such problems.
+LATEXMK(1) General Commands Manual LATEXMK(1)
- Old Method of Defining Custom Dependencies:
- In much older versions of latexmk, the only method of defining custom
- dependencies was to directly manipulate the table of custom dependen-
- cies. This is contained in the @cus_dep_list array. It is an array of
- strings, and each string in the array has four items in it, each sepa-
- rated by a space, the from-extension, the to-extension, the "must"
- item, and the name of the subroutine for the custom dependency. These
- were all defined above.
+ dependencies. This is contained in the @cus_dep_list array. It is an
+ array of strings, and each string in the array has four items in it,
+ each separated by a space, the from-extension, the to-extension, the
+ "must" item, and the name of the subroutine for the custom dependency.
+ These were all defined above.
An example of the old method of defining custom dependencies is as fol-
lows. It is the code in an RC file to ensure automatic conversion of
@@ -4284,16 +4263,6 @@ ADVANCED CONFIGURATION: Some extra resources and advanced tricks
ful ideas
-
- 17 April 2020 65
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
Utility subroutines
ensure_path( var, values ...)
@@ -4311,8 +4280,19 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
ensure_path( 'TEXINPUTS', './custom_cls_sty_files//' );
(In this example, the trailing '//' is documented by TeX systems
- to mean that latex, pdflatex, etc search for files in the speci-
- fied directory and in all subdirectories.)
+ to mean that *latex search for files in the specified directory
+ and in all subdirectories.)
+
+
+
+ 13 September 2020 65
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
Technically ensure_path works by setting Perl's variable
$ENV{var}, where var is the name of the target variable. The
@@ -4348,18 +4328,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
This gives the name of the main output file if any. Note the
double dollar signs.
-
-
-
- 17 April 2020 66
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
rdb_ensure_file( $rule, file )
This a subroutine that ensures that the given file is among the
source files for the specified rule. It is typically used when,
@@ -4380,6 +4348,18 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
This subroutine removes one or more files from the dependency
list for the given rule.
+
+
+
+ 13 September 2020 66
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
rdb_list_source( $rule )
This subroutine returns the list of source files (i.e., the de-
pendency list) for the given rule.
@@ -4414,18 +4394,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
&std_tex_cmds;
-
-
-
- 17 April 2020 67
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
This results in $latex = 'latex %O %S', and similarly for $pdflatex,
$lualatex, and $xelatex. Note the ampersand in the invocation; this
indicates to Perl that a subroutine is being called.
@@ -4445,6 +4413,19 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
set_tex_cmds( '--interaction=batchmode %O %S' );
+
+
+
+
+ 13 September 2020 67
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
Advanced configuration: Using latexmk with make
This section is targeted only at advanced users who use the make pro-
gram for complex projects, as for software development, with the depen-
@@ -4480,18 +4461,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
current versions of GNU make, which is the default on both linux and
OS-X systems. They may need modifications for other versions of make.
-
-
-
- 17 April 2020 68
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
The simplest method is simply to delegate all the relevant tasks to la-
texmk, as is suitable for a straightforward LaTeX document. For this a
suitable Makefile is like
@@ -4511,6 +4480,18 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
The above example has a pattern rule for making a .pdf file from a .tex
file, and it is defined to use latexmk in the obvious way. There is a
+
+
+
+ 13 September 2020 68
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
conventional default target named "all", with a prerequisite of
try.pdf. So when make is invoked, by default it makes try.pdf. The
only complication is that there may be many source files beyond
@@ -4546,18 +4527,6 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
%.pdf : %.fig
fig2dev -Lpdf $< $@
-
-
-
- 17 April 2020 69
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
(Again, the lines containing the commands for the rules should be
started with tabs.) This example was inspired by how GNU automake han-
dles automatic dependency tracking of C source files.
@@ -4577,6 +4546,18 @@ LATEXMK(1) General Commands Manual LATEXMK(1)
tion, which improves its detection of files generated during a run of
pdflatex; such files should not be in the dependency list. The -e op-
tions are used to turn off all custom dependencies, and to document
+
+
+
+ 13 September 2020 69
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
this. Instead the -use-make is used to delegate the making of missing
files to make itself.
@@ -4613,17 +4594,6 @@ BUGS
pdf file cannot be updated. (Remedy: configure latexmk to use suma-
trapdf instead.)
-
-
- 17 April 2020 70
-
-
-
-
-
-LATEXMK(1) General Commands Manual LATEXMK(1)
-
-
THANKS TO
Authors of previous versions. Many users with their feedback, and es-
pecially David Coppit (username david at node coppit.org) who made many
@@ -4633,7 +4603,7 @@ THANKS TO
AUTHOR
Current version, by John Collins (username jcc8 at node psu.edu).
- (Version 4.69a).
+ (Version 4.70a).
Released version can be obtained from CTAN:
<http://www.ctan.org/pkg/latexmk/>, and from the author's website
@@ -4645,6 +4615,36 @@ AUTHOR
+ 13 September 2020 70
+
+
+
+
+
+LATEXMK(1) General Commands Manual LATEXMK(1)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -4681,6 +4681,6 @@ AUTHOR
- 17 April 2020 71
+ 13 September 2020 71
diff --git a/Master/texmf-dist/scripts/latexmk/latexmk.pl b/Master/texmf-dist/scripts/latexmk/latexmk.pl
index efe984e9dd4..0f5c35988f5 100755
--- a/Master/texmf-dist/scripts/latexmk/latexmk.pl
+++ b/Master/texmf-dist/scripts/latexmk/latexmk.pl
@@ -162,6 +162,34 @@ use warnings;
##
## 12 Jan 2012 STILL NEED TO DOCUMENT some items below
##
+## 13 Sep 2020 John Collins V. 4.70a. Updates in comments about bibtex.
+## 28 Aug 2020 John Collins Correct $biber and $bibtex to use %S not %B
+## 24 Aug 2020 John Collins Make sure bibtex/biber rules when created for
+## missing bbl file have correct path for source
+## and destination when out/aux dir used.
+## 16 Jun 2020 John Collins Warning when bibtex fudge is used.
+## Change default $bibtex_fudge to 0. This is safe with
+## at least bibtex in TeXLive 2019 or later, and in current
+## MiKTeX. This version of latexmk is distributed in TeXLive
+## and MiKTeX with a recent enough version of bibtex.
+## Previously, there was a bug in bibtex that prevented it
+## working correctly when -output-directory is used. Latexmk
+## took special action to evade the bug, but at the expense
+## of problems when a .bib file is specified in a directory
+## relative to the document directory.
+## V. 4.69c
+## 9 Jun 2020 John Collins Fix problems with excess calls to parse_log, and messages
+## about changing rule structure when .fdb_latexmk file
+## does not exist.
+## Making quoting (or not) of output and aux directories
+## for option to *latex obey $quote_filenames.
+## 8 Jun 2020 John Collins Engine detection: note that recent lualatex
+## uses luaHBtex, not luatex. So I modified the one
+## place that the name of the $engine is used.
+## 6 May 2020 John Collins Add diagnostic for changed environment variables
+## 27 Apr 2020 John Collins Put ./ for latexmkrc files in current directory
+## V. 4.69b
+## Current version (4.69a, 17 Apr 2020) to CTAN
## 16 Apr 2020 John Collins Correct contents of "All targets (...) are up-to-date" message
## V. 4.69a.
## 12 Mar 2020 John Collins Version is 4.69
@@ -280,8 +308,8 @@ use warnings;
$my_name = 'latexmk';
$My_name = 'Latexmk';
-$version_num = '4.69a';
-$version_details = "$My_name, John Collins, 17 Apr. 2020";
+$version_num = '4.70a';
+$version_details = "$My_name, John Collins, 13 September 2020";
use Config;
use File::Basename;
@@ -623,11 +651,15 @@ foreach (
## Command to invoke biber & bibtex
-$biber = 'biber %O %B';
-$bibtex = 'bibtex %O %B';
+$biber = 'biber %O %S';
+$bibtex = 'bibtex %O %S';
# 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.
+$bibtex_fudge = 0; # Don't use hack to get bibtex working in old versions that
+ # don't handle output-directory. When this version of
+ # latexmk is part of a distribution of TeX, the
+ # accompanying bibtex should also be recent enough
+ # (e.g., TeXLive 2019 or later, current MiKTeX) not to
+ # need the hack/fudge.
$biber_silent_switch = '--onlylog';
$bibtex_silent_switch = '-terse';
$bibtex_use = 1; # Whether to actually run bibtex to update bbl files.
@@ -1739,7 +1771,7 @@ if ( $auto_rc_use && ($HOME ne "" ) ) {
}
if ( $auto_rc_use ) {
# Rc file in current directory:
- read_first_rc_file_in_list( "latexmkrc", ".latexmkrc" );
+ read_first_rc_file_in_list( "./latexmkrc", "./.latexmkrc" );
}
## Process command line args.
@@ -2213,15 +2245,16 @@ if ( $recorder ) {
# possible cd to the document directory, since the directories can be
# relative to the document.
+$q = $quote_filenames ? '"' : '';
if ( $out_dir ) {
- add_option( "-output-directory=\"$out_dir\"",
+ add_option( "-output-directory=$q$out_dir$q",
\$latex, \$pdflatex, \$lualatex, \$xelatex );
}
if ( $aux_dir && ($aux_dir ne $out_dir) ) {
# N.B. If $aux_dir and $out_dir are the same, then the -output-directory
# option is sufficient, especially because the -aux-directory exists
# only in MiKTeX, not in TeXLive.
- add_option( "-aux-directory=\"$aux_dir\"",
+ add_option( "-aux-directory=$q$aux_dir$q",
\$latex, \$pdflatex, \$lualatex, \$xelatex );
}
@@ -2666,7 +2699,7 @@ foreach $filename ( @file_list )
sub{ if ( $$Ptest_kind == 1 ) { $$Ptest_kind = 3;} }
);
if ( -e $log_name ) {
- rdb_for_some( [keys %possible_primaries], \&rdb_set_latex_deps );
+ rdb_for_some( [keys %current_primaries], \&rdb_set_latex_deps );
}
}
foreach $rule ( &rdb_accessible ) {
@@ -2897,6 +2930,9 @@ sub ensure_path {
else {
$ENV{$var} = $_ . $search_path_separator;
}
+ if (!$silent) {
+ print "Set environment variable $var='$ENV{$var}'\n";
+ }
}
}
@@ -4292,11 +4328,13 @@ sub run_bibtex {
local %ENV = %ENV;
my ( $base, $path, $ext ) = fileparseA( $$Psource );
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
- # fix search paths for .bib and .bst, since they may be specified
- # relative to the document directory.
+ # Up to TeXLive 2018, the following was true; situation has changed since.
+ # When an output directory is specified and with a bibtex from 2018 or
+ # earlier, running 'bibtex output/main.aux' doesn't find subsidiary .aux
+ # files, as from \@include{chap.aux}. To evade the bug, we change
+ # directory to the directory of the top-level .aux file to run bibtex.
+ # But we have to fix search paths for .bib and .bst, since they may be
+ # specified relative to the document directory.
my $cwd = good_cwd();
foreach ( 'BIBINPUTS', 'BSTINPUTS' ) {
if ( exists $ENV{$_} ) {
@@ -4308,7 +4346,16 @@ sub run_bibtex {
}
pushd( $path );
if (!$silent) {
- print "$My_name: changed directory to '$path'\n",
+ print "$My_name: ==========WARNING:=================\n",
+ "I am taking action to evade a bug/feature in older versions of bibtex\n",
+ "This may give problems under some situations, symptomized by bibtex not\n",
+ "finding a .bib file or an aux file.\n",
+ "Provided you have a recent version of bibtex (about 2019 or later) you\n",
+ "can avoid the problems by putting '\$bibtex_fudge = 0;' in an\n",
+ "initialization file (a latexmrc file for $my_name.\n",
+ "\n",
+ "Here my bug-evading action:\n",
+ "I temporarily changed directory to '$path'\n",
"Set BIBINPUTS='$ENV{BIBINPUTS}'\n",
"Set BSTINPUTS='$ENV{BSTINPUTS}'\n";
}
@@ -4568,6 +4615,8 @@ sub parse_log {
if ( ! open( $log_file, "<$log_name" ) ) {
return 0;
}
+ print "$My_name: Examining '$log_name'\n"
+ if not $silent;
if ($log_file_binary) { binmode $log_file; }
# Collect lines of log file
my @lines = ();
@@ -4608,6 +4657,7 @@ sub parse_log {
# LuaTeX sometimes at 80. Xetex 80 or longer with non-ascii characters.
while ( ( ($len == $log_wrap)
|| ( ($engine eq 'LuaTeX') && ($len == $log_wrap+1) )
+ || ( ($engine eq 'LuaHBTeX') && ($len == $log_wrap+1) )
|| ( ($engine eq 'XeTeX') && ($len >= $log_wrap+1) )
)
&& !eof($log_file) ) {
@@ -4867,10 +4917,15 @@ LINE:
next LINE;
}
elsif ( /^No file (.*?\.bbl)./ ) {
- # When (pdf)latex is run with an -output-directory
- # or an -aux_directory, the file name does not contain
- # the output path; fix this, after removing quotes:
- my $bbl_file = normalize_force_directory( $aux_dir1, $1 );
+ my $bbl_file = clean_filename($1);
+ my $aux_file = $bbl_file;
+ $aux_file =~ s/\.bbl$/\.aux/;
+ # When aux dir used (may equal out dir), name of missing file fails
+ # to have correct directory. If corresponding aux file exists,
+ # with name prefixed by aux dir, then apply prefix to bbl_file.
+ if (-e $aux_dir1 . $aux_file) {
+ $bbl_file = $aux_dir1 . $bbl_file;
+ }
warn "$My_name: Non-existent bbl file '$bbl_file'\n $_\n";
$dependents{$bbl_file} = 0;
push @bbl_files, $bbl_file;
@@ -7720,6 +7775,7 @@ sub rdb_run1 {
# Find any internal command
my @int_args = @$PAint_cmd;
+
my $int_cmd = shift @int_args;
my @int_args_for_printing = @int_args;
foreach (@int_args_for_printing) {
@@ -8993,7 +9049,12 @@ sub show_array {
# Then print rest of @_, one item per line preceeded by some space
warn "$_[0]\n";
shift;
- if ($#_ >= 0) { foreach (@_){ warn " $_\n";} }
+ if ($#_ >= 0) {
+ foreach (@_){
+ if (defined $_ ) { warn " $_\n"; }
+ else { warn " undef\n"; }
+ }
+ }
else { warn " NONE\n"; }
}
diff --git a/Master/texmf-dist/source/support/latexmk/latexmk.bat b/Master/texmf-dist/source/support/latexmk/latexmk.bat
index f119082adac..bee3098c00e 100755
--- a/Master/texmf-dist/source/support/latexmk/latexmk.bat
+++ b/Master/texmf-dist/source/support/latexmk/latexmk.bat
@@ -1,5 +1,22 @@
-Rem Execute latexmk.pl, searching for it in the PATH
-Rem Assume perl is in the PATH. If not, you should replace 'perl' by
+Rem This batch file is only of interest to a small subset of Windows users.
+
+Rem Under modern TeX distributions, MiKTeX and TeXLive, you do **NOT**
+Rem need this batch file. Both distributions have a latexmk executable
+Rem that correctly run the latexmk Perl script itself. This file
+Rem is only useful if you need to bypass that for some reason, and you
+Rem will probably have to modify it for your needs.
+
+Rem Moreover if your system is suitably configured, the file latexmk.pl
+Rem is itself executable, without the need for going through this batch file.
+
+Rem ==============================
+
+Rem This batch file executes perl so as to run latexmk.pl. As written it
+Rem assumes that both latexmk.pl and perlexe are in the environment variable
+Rem PATH.
+Rem If perl.exe is not in PATH, you should replace 'perl' by
Rem the full pathname of the perl executable, e.g., 'C:\perl\bin\perl.exe'
+Rem or 'C:\Strawberry\perl\bin\perl.exe.
+Rem Similarly for latexmk.pl.
perl -S latexmk.pl %1 %2 %3 %4 %5 %6 %7 %8 %9