summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-12-30 23:42:15 +0000
committerKarl Berry <karl@freefriends.org>2010-12-30 23:42:15 +0000
commita56fd8ce52effcc0234a01e8d4a1a31527fc28bb (patch)
treeb8328ecaed4709398773ad46850a118f53b18904
parent23e10ea724490edf980413190b4a9ae00442ef40 (diff)
latexmk 4.21 (30dec10)
git-svn-id: svn://tug.org/texlive/trunk@20887 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/support/latexmk/CHANGES30
-rw-r--r--Master/texmf-dist/doc/support/latexmk/INSTALL48
-rw-r--r--Master/texmf-dist/doc/support/latexmk/README12
-rw-r--r--Master/texmf-dist/doc/support/latexmk/example_rcfiles/asymptote_latexmkrc21
-rw-r--r--Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc8
-rw-r--r--Master/texmf-dist/doc/support/latexmk/latexmk.pdfbin80419 -> 85963 bytes
-rw-r--r--Master/texmf-dist/doc/support/latexmk/latexmk.txt764
-rwxr-xr-xMaster/texmf-dist/scripts/latexmk/latexmk.pl312
-rw-r--r--Master/texmf/doc/man/man1/latexmk.168
-rw-r--r--Master/texmf/doc/man/man1/latexmk.man1.pdfbin91067 -> 92907 bytes
10 files changed, 805 insertions, 458 deletions
diff --git a/Master/texmf-dist/doc/support/latexmk/CHANGES b/Master/texmf-dist/doc/support/latexmk/CHANGES
index ed7ff495b2c..18bc1ea4857 100644
--- a/Master/texmf-dist/doc/support/latexmk/CHANGES
+++ b/Master/texmf-dist/doc/support/latexmk/CHANGES
@@ -185,3 +185,33 @@ From v. 4.17 to v. 4.18
warning.
Correct misprint in documentation.
+From v. 4.18 to v. 4.20
+ Fix problem that when bibtex finds no citations, this is treated
+ by bibtex as an error. Previously latexmk respected this and
+ did not continue processing. Now if the only bibtex error is
+ the finding of no citations, then latexmk now treats it as
+ only a warning and continues processing (by latex/pdflatex) as
+ appropriate.
+ Get .bst file in source file list for bibtex. (So an update to
+ the bst file provokes a rerun of the relevant programs.)
+ Allow clean-up to delete destination files of custom-dependencies
+ Configuration variable $cleanup_includes_cusdep_generated to
+ configure whether this is done. (Default is off, for backward
+ compatibility.)
+ Remove use of --width option on $pscmd on linux. It's no longer
+ needed.
+ Remove double quotes (if any) surrounding output filename read
+ from .log file, to avoid wrong diagnostic message.
+ Allow a more general pattern for files to clean up (when the -c,
+ or -C option is used). For details, see the explanation of
+ the $clean_ext variable in the latexmk documentation.
+ Options to set commands used for latex and pdflatex, as in
+ -latex=special_latex_replacement_command
+ -pdflatex=special_pdflatex_replacement_command
+ (This is not yet documented.)
+
+From v. 4.18 to v. 4.20
+ Fix some problems with parsing quoted filenames in log file.
+ These prevented latexmk working correctly with latest version
+ of asymptote.sty.
+ Corrected potential bug in locating graphics files.
diff --git a/Master/texmf-dist/doc/support/latexmk/INSTALL b/Master/texmf-dist/doc/support/latexmk/INSTALL
index d351b7165cd..d714fd99398 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.05, 11 April 2008)
+ (Version 4.20, 12 November 2010)
John Collins
Physics Department
@@ -10,7 +10,7 @@
U.S.A.
http://www.phys.psu.edu/~collins/
- http://www.phys.psu.edu/~collins/software/latexmk/
+ http://www.phys.psu.edu/~collins/latexmk/
username collins at node phys.psu.edu
(E-mail address obfuscated to avoid being harvested by worms and spammers)
@@ -36,18 +36,52 @@ systems with suitable customization.
On all systems, the prequisites are
a. A working installation of Perl. (See http://www.cpan.org/ if you
- don't have one.)
+ don't have one. Modern UNIX-like systems, particularly linux and
+ OS-X, normally have perl installed by default.)
b. A working installation of TeX and LaTeX. (See http://www.ctan.org/ if
you don't have one.)
+!!!! IMPORTANT NOTE: !!!!
+===========================
+
+If you have installed a modern distribution of TeX and friends, you
+may find that latexmk is installed on your computer. If not, it can
+be installed by using your distribution's package manager.
+
+This is definitely the case for TeXLive 2009 or later, which is also
+an essential component of MacTeX. I have also read that another major
+distribution MiKTeX also includes latexmk, but I have not checked this
+for myself.
+
+You can test whether latexmk is already installed by trying the
+command "latexmk -v" from the command line. If this succeeds, then
+latexmk is already installed. Otherwise, if you are using TeXLive or
+MacTeX, then you can simply use its package manager to get latexmk
+installed, the same as for any other missing package.
+
+If you are on MS-Windows and you are using TeXLive (2009, or later),
+this distribution also includes a distribution of Perl sufficient to
+run latexmk.pl, so you don't need to install Perl separately. It also
+includes an executable file latexmk.exe that runs latexmk, so you
+don't have to use the latexmk.bat that is part of the latexmk
+distribution.
+
+
+
Installing on UNIX/LINUX
========================
(Power users can modify these as appropriate.)
+NOTE: If you are using TeXLive 2009 or later, you can install latexmk
+simply by using the TeXLive package manager. In fact, depending on
+how much of TeXLive you have already installed, latexmk may already
+have been installed. In that case you don't normally need to bother
+with the manual installation explained below.
+
1. Make sure you have working installations of Perl and TeX/LaTeX.
2. Put the file latexmk.pl in a directory for executable files. For
@@ -142,6 +176,12 @@ Installing on MS-Windows
(Power users can modify these as appropriate.)
+NOTE: If you are using TeXLive 2009 or later, you can install latexmk
+simply by using the TeXLive package manager. In fact, depending on
+how much of TeXLive you have already installed, latexmk may already
+have been installed. In that case you don't normally need to bother
+with the manual installation explained below.
+
1. Make sure you have working installations of Perl and TeX/LaTeX,
complete with viewers for dvi and/or postscript files.
@@ -308,7 +348,7 @@ Version 2 was modified by Evan McLean.
The current version is by John Collins (username collins at node
phys.psu.edu) -- other contact details at the top. It is copyright
-1998-2009 by John Collins, and the previous authors; see the copyright
+1998-2010 by John Collins, and the previous authors; see the copyright
notice in the latexmk.pl file, which gives permission to use, copy,
modify, and distribute this software and its documentation under the
terms of the GNU Public License.
diff --git a/Master/texmf-dist/doc/support/latexmk/README b/Master/texmf-dist/doc/support/latexmk/README
index 7b4aa8583ff..3a19320f435 100644
--- a/Master/texmf-dist/doc/support/latexmk/README
+++ b/Master/texmf-dist/doc/support/latexmk/README
@@ -1,4 +1,4 @@
-Latexmk, version 4.18, 27 July 2010
+Latexmk, version 4.21, 28 Dec. 2010
-----------------------------------
Latexmk completely automates the process of generating a LaTeX document.
@@ -91,7 +91,7 @@ I hope you find this useful.
John Collins
---------------------------- "latexmk -h" ----------------------------
-Latexmk 4.18: Automatic LaTeX document generation routine
+Latexmk 4.21: Automatic LaTeX document generation routine
Usage: latexmk [latexmk_options] [filename ...]
@@ -134,12 +134,16 @@ Usage: latexmk [latexmk_options] [filename ...]
implementations of latex/pdflatex.)
-l - force landscape mode
-l- - turn off -l
+ -latex=<program> - set program used for latex.
+ (replace '<program>' by the program name)
-new-viewer - in -pvc mode, always start a new viewer
-new-viewer- - in -pvc mode, start a new viewer only if needed
-nobibtex - never use bibtex
-nodependents - Do not show list of dependent files after processing
-pdf - generate pdf by pdflatex
-pdfdvi - generate pdf by dvipdf
+ -pdflatex=<program> - set program used for pdflatex.
+ (replace '<program>' by the program name)
-pdfps - generate pdf by ps2pdf
-pdf- - turn off pdf
-ps - generate postscript
@@ -158,7 +162,9 @@ Usage: latexmk [latexmk_options] [filename ...]
-pvc- - turn off -pvc
-r <file> - Read custom RC file
-silent - silence progress messages from called programs
- -v - display program version
+ -time - show CPU time used
+ -time- - don't show CPU time used
+ -v - display program version
-verbose - display usual progress messages from called programs
-version - display program version
-view=default - viewer is default (dvi, ps, pdf)
diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/asymptote_latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/asymptote_latexmkrc
index cc3fa5d1d03..77a0078c9d2 100644
--- a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/asymptote_latexmkrc
+++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/asymptote_latexmkrc
@@ -7,16 +7,21 @@
# A standard method of using it is with the asymptote LaTeX style file
# (http://www.ctan.org/tex-archive/graphics/asymptote/doc/asymptote.sty)
# The graphics drawing code is in the tex file, and applying pdflatex to
-# the tex file produces a file with the same base name as the tex
-# file, but with the extension 'asy'. The .asy is processed by the
-# program asy (part of the asymptote software) to produce graphics
-# files (typically pdf files) that are used the next time pdflatex is
-# run on the main tex file.
+# the tex file produces one or more files with a base name the same as
+# or related to the main tex file, but with the extension 'asy'. The
+# .asy is processed by the program asy (part of the asymptote
+# software) to produce graphics files (which may be eps, tex, or pdf
+# files) that are used the next time pdflatex is run on the main tex
+# file.
#
# Latexmk can be arranged to run asymptote (i.e., the program asy)
# when needed, by defining the following custom dependency. (The code
# is to be put in one of latexmk's rc files, e.g., ~/.latexmkrc.)
+#
-
-add_cus_dep( "asy", "tex", 0, "asy2tex" );
-sub asy2tex { return system("asy $_[0].asy"); }
+# The following lines are taken from the documentation for V. 2.03 of
+# asymptote:
+sub asy {return system("asy '$_[0]'");}
+add_cus_dep("asy","eps",0,"asy");
+add_cus_dep("asy","pdf",0,"asy");
+add_cus_dep("asy","tex",0,"asy");
diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc
index 55edecba09c..be9f8d7343d 100644
--- a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc
+++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/glossary_latexmkrc
@@ -28,3 +28,11 @@ sub makeacr2acn {
# ===> 3. If you use the package glossaries rather than the package
# glossary, you need to EXCHANGE acn and acr in the above.
+# 4. If you use the glossaries package and have the makeglossaries
+# script installed, then you can do something simpler:
+
+ add_cus_dep('glo', 'gls', 0, 'makeglossaries');
+ sub makeglossaries {
+ system("makeglossaries $_[0]");
+ }
+
diff --git a/Master/texmf-dist/doc/support/latexmk/latexmk.pdf b/Master/texmf-dist/doc/support/latexmk/latexmk.pdf
index b414d48629c..0cb2e9bbe7f 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 f8d83547723..2a31fec47d7 100644
--- a/Master/texmf-dist/doc/support/latexmk/latexmk.txt
+++ b/Master/texmf-dist/doc/support/latexmk/latexmk.txt
@@ -1,4 +1,9 @@
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
NAME
latexmk - generate LaTeX document
@@ -53,15 +58,10 @@ DESCRIPTION
WYSIWYG, but usefully close.
For other previewers, the user may have to manually make the previewer
- update its display, which can be (some versions of xdvi and gsview) as
- simple as forcing a redraw of its display.
-
- Latexmk has the ability to print a banner in gray diagonally across
- each page when making the postscript file. It can also, if needed,
- 1
+ 28 December 2010 1
@@ -70,6 +70,11 @@ DESCRIPTION
LATEXMK(1L) LATEXMK(1L)
+ update its display, which can be (some versions of xdvi and gsview) as
+ simple as forcing a redraw of its display.
+
+ Latexmk has the ability to print a banner in gray diagonally across
+ each page when making the postscript file. It can also, if needed,
call an external program to do other postprocessing on the generated
files.
@@ -120,14 +125,9 @@ LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE
This property can also be configured by setting the $bibtex_use
variable to 2 in a configuration file
- -bibtex-
- Never run bibtex.
-
- A common use for this option is when a document comes from an
-
- 27 July 2010 2
+ 28 December 2010 2
@@ -136,6 +136,10 @@ LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE
LATEXMK(1L) LATEXMK(1L)
+ -bibtex-
+ Never run bibtex.
+
+ A common use for this option is when a document comes from an
external source, complete with its bbl file(s), and the user
does not have the corresponding bib files available. In this
situation use of the -bibtex- option will prevent latexmk from
@@ -163,8 +167,8 @@ LATEXMK(1L) LATEXMK(1L)
-bm <message>
A banner message to print diagonally across each page when con-
verting the dvi file to postscript. The message must be a sin-
- gle argument on the command line so be careful with quoting
- spaces and such.
+ gle argument on the command line so be careful with quoting spa-
+ ces and such.
Note that if the -bm option is specified, the -ps option is
assumed.
@@ -186,14 +190,10 @@ LATEXMK(1L) LATEXMK(1L)
List the commands used by latexmk for processing files, and then
exit.
- -c Clean up (remove) all regeneratable files generated by latex and
- bibtex except dvi, postscript and pdf. These files are a combi-
- nation of log files, aux files, latexmk's database file of
- source file information, and those with extensions specified in
- 27 July 2010 3
+ 28 December 2010 3
@@ -202,6 +202,10 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
+ -c Clean up (remove) all regeneratable files generated by latex and
+ bibtex except dvi, postscript and pdf. These files are a combi-
+ nation of log files, aux files, latexmk's database file of
+ source file information, and those with extensions specified in
the @generated_exts configuration variable. In addition, files
with extensions by the $clean_ext configuration variable are
removed.
@@ -212,25 +216,29 @@ LATEXMK(1L) LATEXMK(1L)
If $bibtex_use is set to 0 or 1, bbl files are counted as non-
regeneratable.
+ If $cleanup_includes_cusdep_generated is nonzero, regeneratable
+ files are considered as including those generated by custom
+ dependencies and are also deleted. Otherwise these files are
+ not deleted.
+
-C Clean up (remove) all regeneratable files generated by latex and
- bibtex. This is the same as the -c option with the addition of
- dvi, postscript and pdf files, and those with extensions in the
+ bibtex. This is the same as the -c option with the addition of
+ dvi, postscript and pdf files, and those with extensions in the
$clean_full_ext configuration variable.
- This cleanup is instead of a regular make. See the -gg option
+ This cleanup is instead of a regular make. See the -gg option
if you want to do a cleanup than a make.
- If $bibtex_use is set to 0 or 1, bbl files are counted as non-
+ If $bibtex_use is set to 0 or 1, bbl files are counted as non-
regeneratable.
- -CA Clean up (remove) absolutely all regeneratable files. It is now
- equivalent to the -C option
-
- This cleanup is instead of a regular make. See the -gg option
- if you want to do a cleanup then a make.
+ If $cleanup_includes_cusdep_generated is nonzero, regeneratable
+ files are considered as including those generated by custom
+ dependencies and are also deleted. Otherwise these files are
+ not deleted.
- If $bibtex_use is set to 0 or 1, bbl files are counted as non-
- regeneratable.
+ -CA Clean up (remove) absolutely all regeneratable files. It is now
+ equivalent to the -C option. See that option for details.
-CF Remove the file containing the database of source file informa-
tion, before doing the other actions requested.
@@ -248,25 +256,26 @@ LATEXMK(1L) LATEXMK(1L)
-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:
- latexmk -dF 'dviselect even' foo.tex
+ 28 December 2010 4
- 27 July 2010 4
+LATEXMK(1L) LATEXMK(1L)
-LATEXMK(1L) LATEXMK(1L)
+ ".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:
+ latexmk -dF 'dviselect even' foo.tex
-diagnostics
Print detailed diagnostics during a run. This may help for
@@ -314,25 +323,25 @@ LATEXMK(1L) LATEXMK(1L)
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
- or
- latexmk -e "$latex='latex %O -shell-escape %S'" file.tex
+ 28 December 2010 5
- The last two examples will NOT work with UNIX/LINUX command
- shells.
- 27 July 2010 5
+LATEXMK(1L) LATEXMK(1L)
+ latexmk -e "$latex=q/latex %O -shell-escape %S/" file.tex
+ or
-LATEXMK(1L) LATEXMK(1L)
+ latexmk -e "$latex='latex %O -shell-escape %S'" file.tex
+ The last two examples will NOT work with UNIX/LINUX command
+ shells.
-f Force latexmk to continue document processing despite errors.
Normally, when latexmk detects that LaTeX or another program has
@@ -379,19 +388,10 @@ LATEXMK(1L) LATEXMK(1L)
normal behavior that in preview-continuous mode it checks for an
already-running previewer.
- -nobibtex
- Never run bibtex.
-
- A common use for this option is when a document comes from an
- external source, complete with its bbl file(s), and the user
- does not have the corresponding bib files available. In this
- situation use of the -nobibtex option will prevent latexmk from
- trying to run bibtex, which would result in overwriting of the
- bbl files.
- 27 July 2010 6
+ 28 December 2010 6
@@ -400,8 +400,18 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- -p Print out the document. By default it is the generated
- postscript file that is printed. But you can use the -print=...
+ -nobibtex
+ Never run bibtex.
+
+ A common use for this option is when a document comes from an
+ external source, complete with its bbl file(s), and the user
+ does not have the corresponding bib files available. In this
+ situation use of the -nobibtex option will prevent latexmk from
+ trying to run bibtex, which would result in overwriting of the
+ bbl files.
+
+ -p Print out the document. By default it is the generated post-
+ script file that is printed. But you can use the -print=...
option to print the dvi or pdf files instead, and you can con-
figure this in a start up file (by setting the $print_type vari-
able).
@@ -445,26 +455,25 @@ LATEXMK(1L) LATEXMK(1L)
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
- extension ".psF". All extra processing (e.g. preview, printing)
- will then be performed on this filtered postscript file.
-
- Example of usage: Use psnup to print two pages on the one page:
- latexmk -ps -pF 'psnup -2' foo.tex
+ 28 December 2010 7
- 27 July 2010 7
+LATEXMK(1L) LATEXMK(1L)
+ -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.
-LATEXMK(1L) LATEXMK(1L)
+ Example of usage: Use psnup to print two pages on the one page:
+ latexmk -ps -pF 'psnup -2' foo.tex
or
@@ -512,18 +521,9 @@ LATEXMK(1L) LATEXMK(1L)
mode. It is better to use a dvi or ps viewer, as set by one of
the -view=dvi and -view=ps options.
- 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
- "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
-
- 27 July 2010 8
+ 28 December 2010 8
@@ -532,6 +532,14 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
+ 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
+ "forked" previewer will continue to run. Successive invocations
+ with the -pvc option will not fork new previewers, but latexmk
+ will normally use the existing previewer. (At least this will
happen when latexmk is running under an operating system where
it knows how to determine whether an existing previewer is run-
ning.)
@@ -578,27 +586,27 @@ LATEXMK(1L) LATEXMK(1L)
tex_silent_switch, $dvips_silent_switch, $latex_silent_switch,
and $pdflatex_silent_switch.
- -v, -version
- Print version number of latexmk.
- -verbose
- Opposite of -silent. This is the default setting.
- -view=default, -view=dvi, -view=ps, -view=pdf
- Set the kind of file used when previewing is requested (e.g., by
- the -pv or -pvc switches). The default is to view the "highest"
+ 28 December 2010 9
- 27 July 2010 9
+LATEXMK(1L) LATEXMK(1L)
-LATEXMK(1L) LATEXMK(1L)
+ -v, -version
+ Print version number of latexmk.
+ -verbose
+ Opposite of -silent. This is the default setting.
+ -view=default, -view=dvi, -view=ps, -view=pdf
+ Set the kind of file used when previewing is requested (e.g., by
+ the -pv or -pvc switches). The default is to view the "highest"
kind of requested file (in the order dvi, ps, pdf).
The preview-continuous option -pvc can only work with one file. So in
@@ -644,28 +652,28 @@ CONFIGURATION/INITIALIZATION (RC) FILES
On a cygwin system (i.e., a MS-Windows system in which perl is
that of cygwin), latexmk reads for the first it finds of
"/cygdrive/c/latexmk/LatexMk",
- "/opt/local/share/latexmk/LatexMk",
- "/usr/local/share/latexmk/LatexMk",
- "/usr/local/lib/latexmk/LatexMk".
- 2) The user's RC file, "$HOME/.latexmkrc", if it exists. Here $HOME is
- the value of the environment variable HOME. On UNIX and clones
- (including LINUX), this variable is set by the system; on MS-Windows,
- the user may choose to set it.
- 3) The RC file in the current working directory. This file can be
+ 28 December 2010 10
- 27 July 2010 10
+LATEXMK(1L) LATEXMK(1L)
-LATEXMK(1L) LATEXMK(1L)
+ "/opt/local/share/latexmk/LatexMk",
+ "/usr/local/share/latexmk/LatexMk",
+ "/usr/local/lib/latexmk/LatexMk".
+ 2) The user's RC file, "$HOME/.latexmkrc", if it exists. Here $HOME is
+ the value of the environment variable HOME. On UNIX and clones
+ (including LINUX), this variable is set by the system; on MS-Windows,
+ the user may choose to set it.
+ 3) The RC file in the current working directory. This file can be
named either "latexmkrc" or ".latexmkrc", and the first of these to be
found is used, if any.
@@ -710,27 +718,27 @@ HOW TO SET VARIABLES IN INITIALIZATION FILES
Each statement ends with a semicolon.
Strings should be enclosed in single quotes. (You could use double
- quotes, as in many programming languages. But then the Perl program-
- ming language brings into play some special rules for interpolating
- variables into strings. People not fluent in Perl will want to avoid
- these complications.)
- You can do much more complicated things, but for this you will need to
- consult a manual for the Perl programming language.
+ 28 December 2010 11
- 27 July 2010 11
+LATEXMK(1L) LATEXMK(1L)
+ quotes, as in many programming languages. But then the Perl program-
+ ming language brings into play some special rules for interpolating
+ variables into strings. People not fluent in Perl will want to avoid
+ these complications.)
+ You can do much more complicated things, but for this you will need to
+ consult a manual for the Perl programming language.
-LATEXMK(1L) LATEXMK(1L)
FORMAT OF COMMAND SPECIFICATIONS
@@ -776,30 +784,30 @@ FORMAT OF COMMAND SPECIFICATIONS
the command specification $ps_previewer = 'latex -ad=%%Sfile.ad %S',
the %%S will become %S when the command is executed, but the %S will be
replaced by the source filename, which in this case would be the name
- of a postscript file to be viewed.
- Appropriate quoting will be applied to the filename substitutions, so
- you mustn't supply them yourself even if you the names of your have
- spaces in them. (But if your TeX filenames have spaces in them, beware
- that many versions of the TeX program cannot correctly handle filenames
- containing spaces.) In case latexmk's quoting does not work correctly
- on your system, you can turn it off -- see the documentation for the
- variable $quote_filenames.
- 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
+ 28 December 2010 12
- 27 July 2010 12
+LATEXMK(1L) LATEXMK(1L)
-LATEXMK(1L) LATEXMK(1L)
+ of a postscript file to be viewed.
+ Appropriate quoting will be applied to the filename substitutions, so
+ you mustn't supply them yourself even if you the names of your have
+ spaces in them. (But if your TeX filenames have spaces in them, beware
+ that many versions of the TeX program cannot correctly handle filenames
+ containing spaces.) In case latexmk's quoting does not work correctly
+ on your system, you can turn it off -- see the documentation for the
+ variable $quote_filenames.
+ 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
@@ -843,6 +851,17 @@ LATEXMK(1L) LATEXMK(1L)
UNIX and MS-Windows. See the source code for how I've handled the
problem.
+
+
+ 28 December 2010 13
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
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
@@ -855,18 +874,6 @@ LATEXMK(1L) LATEXMK(1L)
slashes in filenames under MS-Windows, 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
-
-
-
- 27 July 2010 13
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
rules for dealing with forward slashes in strings in the Perl lan-
guage.)
@@ -909,32 +916,32 @@ LATEXMK(1L) LATEXMK(1L)
extra processing, you could do something like:
$pdflatex = 'pdflatex --shell-escape %O %S; pst2pdf_for_latexmk
- %B';
- This definition assumes you are using a UNIX-like system, so that the
- two commands to be run are separated by the semicolon in the middle of
- the string.
+ 28 December 2010 14
-LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES
- Default values are indicated in brackets.
- $always_view_file_via_temporary [0]
- Whether ps and pdf files are initially to be made in a temporary
- directory and then moved to the final location. (This applies
- 27 July 2010 14
+LATEXMK(1L) LATEXMK(1L)
+ %B';
+ This definition assumes you are using a UNIX-like system, so that the
+ two commands to be run are separated by the semicolon in the middle of
+ the string.
-LATEXMK(1L) LATEXMK(1L)
+LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES
+ Default values are indicated in brackets.
+ $always_view_file_via_temporary [0]
+ Whether ps and pdf files are initially to be made in a temporary
+ directory and then moved to the final location. (This applies
to dvips, dvipdf, and ps2pdf operations, and the filtering oper-
ators on dvi and ps files. It does not apply to pdflatex,
unfortunately.)
@@ -975,6 +982,18 @@ LATEXMK(1L) LATEXMK(1L)
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
+
+
+
+ 28 December 2010 15
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
about equal to 1100 divided by the number of characters in the
message. The Default is just right for 5 character messages.
This is equivalent to the -bs option.
@@ -991,18 +1010,6 @@ LATEXMK(1L) LATEXMK(1L)
@BIBINPUTS = ( ".", "C:\bibfiles" );
@BIBINPUTS = ( ".", "\\server\bibfiles" );
@BIBINPUTS = ( ".", "C:/bibfiles" );
-
-
-
- 27 July 2010 15
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
@BIBINPUTS = ( ".", "//server/bibfiles" );
@BIBINPUTS = ( ".", "/usr/local/texmf/bibtex/bib" );
@@ -1041,40 +1048,58 @@ LATEXMK(1L) LATEXMK(1L)
2: run BibTeX whenever it appears necessary to update the bbl
files, without testing for the existence of the bib files.
- $cleanup_includes_generated [0]
- If nonzero, specifies that cleanup also deletes files that are
- detected in log file as being generated (see the \openout lines
- in the log file). It will also include files made from these
- first generation generated files.
- $cleanup_mode [0]
- If nonzero, specifies cleanup mode: 1 for full cleanup, 2 for
- cleanup except for dvi, ps and pdf files, 3 for cleanup except
- for dep and aux files. (There is also extra cleaning as speci-
- fied by the $clean_ext, $clean_full_ext and @generated_exts
- variables.)
- This variable is equivalent to specifying one of the -c, -c1, or -C
- options. But there should be no need to set this variable from an RC
- file.
- $clean_ext [""]
- Extra extensions of files for latexmk to remove when any of the
- clean-up options (-c, -c1, or -C) is selected. The value of
+ 28 December 2010 16
- 27 July 2010 16
+LATEXMK(1L) LATEXMK(1L)
+ $cleanup_includes_cusdep_generated [0]
+ If nonzero, specifies that cleanup also deletes files that are
+ generated by custom dependencies. (When doing a clean up, e.g.,
+ by use of the -C option, custom dependencies are those listed in
+ the .fdb_latexmk file from a previous run.)
-LATEXMK(1L) LATEXMK(1L)
+ $cleanup_includes_generated [0]
+ If nonzero, specifies that cleanup also deletes files that are
+ detected in log file as being generated (see the \openout lines
+ in the log file). It will also include files made from these
+ first generation generated files.
+
+ $cleanup_mode [0]
+ If nonzero, specifies cleanup mode: 1 for full cleanup, 2 for
+ cleanup except for dvi, ps and pdf files, 3 for cleanup except
+ for dep and aux files. (There is also extra cleaning as speci-
+ fied by the $clean_ext, $clean_full_ext and @generated_exts
+ 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 an RC file.
+ $clean_ext [""]
+ Extra extensions of files for latexmk to remove when any of the
+ clean-up options (-c or -C) is selected. The value of this
+ variable is a string containing the extensions separated by spa-
+ ces.
+
+ It is also possible to specify a more general pattern of file to
+ be deleted, by using the place holder %R, as in commands. Thus
+ setting
+
+ $clean_ext = "out %R-blx.bib";
+
+ in an initialization file will imply that when a clean-up opera-
+ tion is specified, not only is the standard set of files
+ deleted, but also files of the form FOO.out and FOO-blx.bib,
+ where FOO stands for the basename of the file being processed
+ (as in FOO.tex).
- this variable is a string containing the extensions separated by
- spaces.
$clean_full_ext [""]
Extra extensions of files for latexmk to remove when the -C
@@ -1089,6 +1114,18 @@ LATEXMK(1L) LATEXMK(1L)
Normally, if no filenames are specified on the command line,
latexmk processes all tex files specified in the @default_files
+
+
+
+ 28 December 2010 17
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
variable, which by default is set to all tex files ("*.tex") in
the current directory. This is a convenience: just run latexmk
and it will process an appropriate set of files. But sometimes
@@ -1131,18 +1168,6 @@ LATEXMK(1L) LATEXMK(1L)
will cause to be run whatever command the system has associated
with .dvi files.]
-
-
-
- 27 July 2010 17
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
$dvi_previewer_landscape ["start xdvi %O %S"]
The command to invoke a dvi-previewer in landscape mode.
[Default is "start" under MS-WINDOWS; under more recent versions
@@ -1156,6 +1181,17 @@ LATEXMK(1L) LATEXMK(1L)
$dvipdf = "dvipdfm %O -o %D %S";
+
+
+ 28 December 2010 18
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
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
@@ -1200,27 +1236,27 @@ LATEXMK(1L) LATEXMK(1L)
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
+ 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
+ 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
+ appropriate for xdvi on a UNIX system.
- 27 July 2010 18
+ 28 December 2010 19
-LATEXMK(1L) LATEXMK(1L)
- example of updating by command.
+LATEXMK(1L) LATEXMK(1L)
- $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
- appropriate for xdvi on a UNIX system.
$fdb_ext ["fdb_latexmk"]
The extension of the file which latexmk generates to contain a
@@ -1271,10 +1307,15 @@ LATEXMK(1L) LATEXMK(1L)
!!!This variable is for experts only!!!
The general rule latexmk uses for determining when an extra run
+ of some program is needed is that one of the source files has
+ changed. But consider for example a latex package that causes
+ an encapsulated postscript file (an "eps" file) to be made that
+ is to be read in on the next run. The file contains a comment
+ line giving its creation date and time. On the next run the
- 27 July 2010 19
+ 28 December 2010 20
@@ -1283,15 +1324,10 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- 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, only
- exited becaues latexmk has a limit on the number of runs to
- guard against pathological situations.
+ therefore reruns latex. This causes an infinite loop, that is
+ only terminated becaues 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:
@@ -1308,6 +1344,27 @@ LATEXMK(1L) LATEXMK(1L)
" are to be ignored in deciding whether a file of the given
extension .eps has changed.
+ There is only one regular expression available for each exten-
+ sion. If you need more one pattern to specify lines to ignore,
+ then you need to combine the patterns into a single regular
+ expression. The simplest method is separate the different sim-
+ ple patterns by a vertical bar character (indicating "alterna-
+ tion" in the jargon of regular expressions). For example,
+
+ $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate:
+ |^%%Title: ';
+
+ causes lines starting with either "^%%CreationDate: " or
+ "^%%Title: " to be ignored.
+
+ It may happen that a pattern to be ignored is specified in, for
+ example, in a system or user initialization file, and you wish
+ to remove this in a file read later. To do this, you use perl's
+ delete function, e.g.,
+
+ delete $hash_calc_ignore_pattern{'eps'};
+
+
$kpsewhich ["kpsewhich %S"]
The program called to locate a source file when the name alone
is not sufficient. Most filenames used by latexmk have suffi-
@@ -1320,6 +1377,19 @@ LATEXMK(1L) LATEXMK(1L)
also uses to try to locate files; it applies only in the case of
.bib files.
+
+
+
+
+ 28 December 2010 21
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
$landscape_mode [0]
If nonzero, run in landscape mode, using the landscape mode pre-
viewers and dvi to postscript converters. Equivalent to the -l
@@ -1341,18 +1411,6 @@ LATEXMK(1L) LATEXMK(1L)
not exist.
In this situation, latexmk searches for custom dependencies to
-
-
-
- 27 July 2010 20
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
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'.
@@ -1386,6 +1444,18 @@ LATEXMK(1L) LATEXMK(1L)
the options to include -c-style-errors, e.g., by the following
line in an initialization file
+
+
+
+ 28 December 2010 22
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
$latex_silent_switch = "-interaction=batchmode -c-style-
errors";
@@ -1412,18 +1482,6 @@ LATEXMK(1L) LATEXMK(1L)
$lpr_dvi ["NONE lpr_dvi"]
The printing program to print dvi files.
-
-
-
- 27 July 2010 21
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
$lpr_pdf ["NONE lpr_pdf"]
The printing program to print pdf files.
@@ -1452,6 +1510,18 @@ LATEXMK(1L) LATEXMK(1L)
(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.)
+
+
+
+ 28 December 2010 23
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
$new_viewer_always [0]
This variable applies to latexmk only in continuous-preview
mode. If $new_viewer_always is 0, latexmk will check for a pre-
@@ -1483,18 +1553,6 @@ LATEXMK(1L) LATEXMK(1L)
\input{file} or \includegraphics{figure}, when the relevant
source file does not exist.
-
-
-
- 27 July 2010 22
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
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
@@ -1517,8 +1575,20 @@ LATEXMK(1L) LATEXMK(1L)
rally with such an extension, you should have made an appropri-
ate custom dependency for latexmk, and should also have done the
appropriate programming in the LaTeX source file to enable the
- file to be read. The standard extensions are handled by pdfla-
- tex and its graphics/graphicx packages.)
+ file to be read. The standard extensions are handled by
+
+
+
+ 28 December 2010 24
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
+ pdflatex and its graphics/graphicx packages.)
$pdflatex_silent_switch ["-interaction=batchmode"]
@@ -1554,18 +1624,6 @@ LATEXMK(1L) LATEXMK(1L)
$pdf_update_method [1 under UNIX, 3 under MS-Windows]
How the pdf viewer updates its display when the pdf file has
changed. See the information on the variable $dvi_update_method
-
-
-
- 27 July 2010 23
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
for the codes. (Note that information needs be changed slightly
so that for the value 4, to run a command to do the update, the
command is specified by the variable $pdf_update_command, and
@@ -1584,6 +1642,18 @@ LATEXMK(1L) LATEXMK(1L)
The first setting arranges for the xpdf program to be used in
its "remote server mode", with the server name specified as the
+
+
+
+ 28 December 2010 25
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
rootname of the TeX file. The second setting arranges for
updating to be done in response to a command, and the third set-
ting sets the update command.
@@ -1625,34 +1695,34 @@ LATEXMK(1L) LATEXMK(1L)
$printout_mode [0]
If nonzero, print the document using lpr. Equivalent to the -p
- option. This is recommended not to be set from an RC file,
+ option. This is recommended not to be set from an RC file, oth-
+ erwise you could waste lots of paper.
+ $print_type = ["ps"]
+ Type of file to printout: possibilities are "dvi", "none",
+ "pdf", or "ps".
+ $pscmd Command used to get all the processes currently run by the user.
+ The -pvc option uses the command specified by the variable
+ $pscmd to determine if there is an already running previewer,
+ and to find the process ID (needed if latexmk needs to signal
+ the previewer about file changes).
- 27 July 2010 24
+ 28 December 2010 26
-LATEXMK(1L) LATEXMK(1L)
- otherwise you could waste lots of paper.
- $print_type = ["ps"]
- Type of file to printout: possibilities are "dvi", "none",
- "pdf", or "ps".
+LATEXMK(1L) LATEXMK(1L)
- $pscmd Command used to get all the processes currently run by the user.
- The -pvc option uses the command specified by the variable
- $pscmd to determine if there is an already running previewer,
- and to find the process ID (needed if latexmk needs to signal
- the previewer about file changes).
Each line of the output of this command is assumed to correspond
- to one process. See the $pid_position variable for how the pro-
- cess number is determined.
+ to one process. See the $pid_position variable for how the
+ process number is determined.
The default for pscmd is "NONE" under MS-Windows and cygwin
(i.e., the command is not used), "ps --width 200 -f -u
@@ -1665,9 +1735,9 @@ LATEXMK(1L) LATEXMK(1L)
Command to convert ps to pdf file.
$ps_filter [empty]
- The postscript file filter to be run on the newly produced
- postscript file before other processing. Equivalent to specify-
- ing the -pF option.
+ The postscript file filter to be run on the newly produced post-
+ script file before other processing. Equivalent to specifying
+ the -pF option.
$ps_previewer ["start gv %O %S", but "start %O %S" under MS-WINDOWS]
The command to invoke a ps-previewer. (The default under MS-
@@ -1698,21 +1768,22 @@ LATEXMK(1L) LATEXMK(1L)
has changed. See the information on the variable
$dvi_update_method for the codes. (Note that information needs
be changed slightly so that for the value 4, to run a command to
+ do the update, the command is specified by the variable
+ $ps_update_command, and for the value 2, to specify update by
+ signal, the signal is specified by $ps_update_signal.)
- 27 July 2010 25
+ 28 December 2010 27
-LATEXMK(1L) LATEXMK(1L)
- do the update, the command is specified by the variable
- $ps_update_command, and for the value 2, to specify update by
- signal, the signal is specified by $ps_update_signal.)
+
+LATEXMK(1L) LATEXMK(1L)
$ps_update_signal [Under UNIX: SIGHUP, which is a system-dependent
@@ -1735,8 +1806,8 @@ LATEXMK(1L) LATEXMK(1L)
The quoting method used by latexmk is tested to work correctly under
UNIX systems (including Linux and Mac OS-X) and under MS-Windows. It
- allows the use of filenames containing special characters, notably
- spaces. (But note that many versions of LaTeX and PdfLaTeX cannot cor-
+ allows the use of filenames containing special characters, notably spa-
+ ces. (But note that many versions of LaTeX and PdfLaTeX cannot cor-
rectly deal with TeX files whose names contain spaces. Latexmk's quot-
ing only ensures that such filenames are correctly treated by the oper-
ating system in passing arguments to programs.)
@@ -1769,11 +1840,10 @@ LATEXMK(1L) LATEXMK(1L)
current directory. Under other operating systems (expected to
be UNIX/Linux, including OS-X), the default is the value of the
system environment variable TMPDIR if it exists, otherwise
- "/tmp".
- 27 July 2010 26
+ 28 December 2010 28
@@ -1782,6 +1852,8 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
+ "/tmp".
+
$view ["default"]
Which kind of file is to be previewed if a previewer is used.
The possible values are "default", "dvi", "ps", "pdf". The
@@ -1834,18 +1906,10 @@ CUSTOM DEPENDENCIES
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-dependency rule. If it does, then whenever
- the destination file (the one with the to-extension) is out-of-date
- with respect to the corresponding source file.
-
- To make the new destination file, the Perl subroutine specified in the
- rule is invoked, with an argument that is the base name of the files in
- question. Simple cases just involve a subroutine invoking an external
- program; this can be done by following the templates below, even by
- those without knowledge of the Perl programming language. Of course,
- 27 July 2010 27
+ 28 December 2010 29
@@ -1854,6 +1918,14 @@ CUSTOM DEPENDENCIES
LATEXMK(1L) LATEXMK(1L)
+ the destination file (the one with the to-extension) is out-of-date
+ with respect to the corresponding source file.
+
+ To make the new destination file, the Perl subroutine specified in the
+ rule is invoked, with an argument that is the base name of the files in
+ question. Simple cases just involve a subroutine invoking an external
+ program; this can be done by following the templates below, even by
+ those without knowledge of the Perl programming language. Of course,
experts could do something much more elaborate.
One other item in each custom-dependency rule labelled "must" above
@@ -1901,31 +1973,30 @@ LATEXMK(1L) LATEXMK(1L)
system("fig2dev -Lps '$_[0].fig' '$_[0].eps'");
}
- This causes the invocation of the fig2dev program to have quoted file-
- names; it should therefore work with filenames containing spaces. How-
- ever, not all software deals correctly with filenames that contain
- spaces. Moreover, the rules, if any, for quoting filenames vary
- between operating systems, command shells and individual pieces of
- software, so this code may not always work.
-
- If you use pdflatex instead of latex, then you will probably prefer to
- convert your graphics files to pdf format, in which case you would
- replace the above code in an initialization file by
- add_cus_dep( 'fig', 'pdf, 0, 'fig2pdf' );
- sub fig2pdf {
+ 28 December 2010 30
- 27 July 2010 28
+LATEXMK(1L) LATEXMK(1L)
-LATEXMK(1L) LATEXMK(1L)
+ This causes the invocation of the fig2dev program to have quoted file-
+ names; it should therefore work with filenames containing spaces. How-
+ ever, not all software deals correctly with filenames that contain spa-
+ ces. Moreover, the rules, if any, for quoting filenames vary between
+ operating systems, command shells and individual pieces of software, so
+ this code may not always work.
+ If you use pdflatex instead of latex, then you will probably prefer to
+ convert your graphics files to pdf format, in which case you would
+ replace the above code in an initialization file by
+ add_cus_dep( 'fig', 'pdf, 0, 'fig2pdf' );
+ sub fig2pdf {
system("fig2dev -Lpdf $_[0].fig $_[0].pdf");
}
@@ -1967,6 +2038,18 @@ LATEXMK(1L) LATEXMK(1L)
Those of you with experience with Makefiles, will undoubtedly be con-
cerned 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
+
+
+
+ 28 December 2010 31
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
be perpetually out-of-date. This situation, of circular dependencies,
is endemic to latex, and latexmk in its current version works correctly
with circular dependencies. It examines the contents of the files (by
@@ -1985,20 +2068,8 @@ OLD METHOD OF DEFINING CUSTOM DEPENDENCIES
In previous 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
-
-
-
- 27 July 2010 29
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
- separated by a space, the from-extension, the to-extension, the "must"
+ 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.
@@ -2033,6 +2104,18 @@ BUGS
manual update (reopen); it views postscript and pdf. Gsview under MS-
Windows works for both postscript and pdf, but only reads the updated
file when its screen is refreshed. Acroread under UNIX/LINUX views
+
+
+
+ 28 December 2010 32
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
pdf, but the file needs to be closed and reopened to view an updated
version. Under MS-Windows, acroread locks its input file and so the
pdf file cannot be updated. (Remedy: configure latexmk to use gsview
@@ -2047,10 +2130,10 @@ THANKS TO
AUTHOR
Current version, by John Collins (username collins at node
- phys.psu.edu). (Version 4.17).
+ phys.psu.edu). (Version 4.21).
- Released version can be obtained from CTAN: <http://www.tug.org/tex-
- archive/support/latexmk/>, and from the author's website
+ Released version can be obtained from CTAN: <http://www.tug.org/tex-ar-
+ chive/support/latexmk/>, and from the author's website
<http://www.phys.psu.edu/~collins/software/latexmk/>.
Modifications and enhancements by Evan McLean (Version 2.0)
Original script called "go" by David J. Musliner (RCS Version 3.2)
@@ -2061,49 +2144,6 @@ AUTHOR
- 27 July 2010 30
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2133,6 +2173,6 @@ LATEXMK(1L) LATEXMK(1L)
- 27 July 2010 31
+ 28 December 2010 33
diff --git a/Master/texmf-dist/scripts/latexmk/latexmk.pl b/Master/texmf-dist/scripts/latexmk/latexmk.pl
index b5e5fe77ff5..b03c9a58da6 100755
--- a/Master/texmf-dist/scripts/latexmk/latexmk.pl
+++ b/Master/texmf-dist/scripts/latexmk/latexmk.pl
@@ -24,7 +24,6 @@ use warnings;
#=======================================
-
#?? Force mode doesn't appear to do force (if error in latex file)
#??? Get banner back in.
#?? CORRECT DIAGNOSTICS ON CHANGED FILES IF THEY DIDN'T EXIST BEFORE
@@ -33,7 +32,7 @@ use warnings;
#?? logfile w/o fdb file: don't set changed file, perhaps for generated exts.
# Reconsider
#?? Do proper run-stuff for bibtex, makeindex, cus-deps. OK I think
-# Parse and correctly find bst and ist files
+# Parse and correctly find ist files
# ATTEMPT TO ALLOW FILENAMES WITH SPACES:
@@ -108,8 +107,8 @@ use warnings;
$my_name = 'latexmk';
$My_name = 'Latexmk';
-$version_num = '4.18';
-$version_details = "$My_name, John Collins, 27 July 2010";
+$version_num = '4.21';
+$version_details = "$My_name, John Collins, 28 December 2010";
use Config;
@@ -178,6 +177,41 @@ else {
##
## Modification log from 23 Jun 2010 onwards in detail
##
+## 28 Dec 2010, John Collins Version number to 4.21
+## 1. Improved handling of quotes in filenames in log file:
+## a. Clean double quotes in names from messages about files.
+## b. In ("..." construct, as in MiKTeX, the only character
+## prohibited is ". Previously I disallowed ( and ),
+## which are allowed special characters.
+## 2. Reversed deletion and reinsertion in dependents list
+## of name found by kpsewhich. Otherwise sometimes a name
+## could be deleted in error
+## 12 Nov 2010, John Collins Version number to 4.20
+## 11 Nov 2010, John Collins Fix problem that when bibtex finds no
+## citations, this is treated by bibtex as an
+## error, but latexmk should only treat it as
+## a warning but not an error
+## 8,9 Nov 2010, John Collins Get .bst file in source file list for bibtex
+## 30 Oct 2010, John Collins Allow clean-up to delete destination files of
+## custom-dependencies
+## Configuration variable $cleanup_includes_cusdep_generated to
+## whether this is done
+## 20 Sep 2010, John Collins First attempt to deal with no citations warning
+## Still have the problem that bibtex gives non-zero exit code
+## 19 Sep 2010, John Collins Orthogonalize option and command specification
+## a la Manuel Pegourie-Gonnard (email of 19 Sep 2010,
+## "[latexmk] latex engine and default options".)
+## Still needs documentation.
+## 19 Sep 2010, John Collins More general pattern for files to clean up,
+## Thanks to Manuel Pegourie-Gonnard for the code
+## Must check the use of %generated_exts_all in
+## sub rdb_file_change1.
+## 30 Aug 2010, John Collins Remove double quotes (if any) surrounding
+## output filename read from .log file.
+## (Avoids wrong diagnostic message.)
+## 19 Aug 2010, John Collins Remove use of --width option on $pscmd
+## on linux. It's no longer needed.
+## 30 Jul 2010, John Collins Timing information
## 27 Jul 2010, John Collins Clean up some comments.
## This is release version for 4.18.
## 23 Jul 2010, John Collins Only produce "Removing no-longer-needed
@@ -332,6 +366,11 @@ $log_wrap = 79;
## Commands to invoke latex, pdflatex
$latex = 'latex %O %S';
$pdflatex = 'pdflatex %O %S';
+
+## Default switches:
+$latex_default_switches = '';
+$pdflatex_default_switches = '';
+
## Switch(es) to make them silent:
$latex_silent_switch = '-interaction=batchmode';
$pdflatex_silent_switch = '-interaction=batchmode';
@@ -727,7 +766,10 @@ else {
# for SUSE 7.2).
# However the option is not available under other UNIX-type
# systems, e.g., Solaris 8.
- $pscmd = "ps --width 200 -f -u $ENV{USER}";
+ # But (19 Aug 2010), the truncation doesn't happen on RHEL4 and 5,
+ # unless the output is written to a terminal. So the --width
+ # option is now unnecessary
+ # $pscmd = "ps --width 200 -f -u $ENV{USER}";
}
elsif ( $^O eq "darwin" ) {
# OS-X on Macintosh
@@ -849,6 +891,9 @@ $cleanup_fdb = 0; # No removal of file for latexmk's file-database
$cleanup_only = 0; # When doing cleanup, do not go-on to making files
$cleanup_includes_generated = 0;
# Determines whether cleanup deletes files generated by
+ # custom dependencies
+$cleanup_includes_cusdep_generated = 0;
+ # Determines whether cleanup deletes files generated by
# (pdf)latex (found from \openout lines in log file).
$diagnostics = 0;
$dvi_filter = ''; # DVI filter command
@@ -861,6 +906,11 @@ $preview_mode = 0;
$preview_continuous_mode = 0;
$printout_mode = 0; # Don't print the file
+$show_time = 0;
+@timings = ();
+$processing_time1 = processing_time();
+
+
# Do we make view file in temporary then move to final destination?
# (To avoid premature updating by viewer).
$always_view_file_via_temporary = 0; # Set to 1 if viewed file is always
@@ -1210,6 +1260,12 @@ while ($_ = $ARGV[0])
}
elsif (/^-l$/) { $landscape_mode = 1; }
elsif (/^-l-$/) { $landscape_mode = 0; }
+ elsif (/^-latex=(.*)$/) {
+ $latex = $1;
+ }
+ elsif (/^-pdflatex=(.*)$/) {
+ $pdflatex = $1;
+ }
elsif (/^-new-viewer$/) {
$new_viewer_always = 1;
}
@@ -1249,6 +1305,8 @@ while ($_ = $ARGV[0])
}
elsif (/^-pvc-$/) { $preview_continuous_mode = 0; }
elsif (/^-silent$/ || /^-quiet$/ ){ $silent = 1; }
+ elsif (/^-time$/) { $show_time = 1;}
+ elsif (/^-time-$/) { $show_time = 0;}
elsif (/^-v$/ || /^-version$/) {
print "\n$version_details. Version $version_num\n";
exit;
@@ -1453,6 +1511,11 @@ if ( ($jobname ne '') && ($num_files > 1) ) {
# Normalize the commands, to have place-holders for source, dest etc:
&fix_cmds;
+# Add common options
+add_option( \$latex, $latex_default_switches );
+add_option( \$pdflatex, $pdflatex_default_switches );
+
+
# If landscape mode, change dvips processor, and the previewers:
if ( $landscape_mode )
{
@@ -1618,9 +1681,17 @@ foreach $filename ( @file_list )
local %conversions = (); # (pdf)latex-performed conversions.
# Maps output file created and read by (pdf)latex
# to source file of conversion.
+
print "$My_name: Examining log file for generated files...\n";
&parse_logB;
+ print "$My_name: Examining fdb file for rules ...\n";
+ # Needed for cleanup of files generated by custom dependencies
+ if ( -e $fdb_file ) {
+ $rdb_errors = rdb_read( $fdb_file );
+ $have_fdb = ($rdb_errors == 0);
+ }
+
my @index_bibtex_generated = ();
my @aux_files = ();
my %other_generated = %generated_log;
@@ -1665,6 +1736,9 @@ foreach $filename ( @file_list )
if ($cleanup_includes_generated) {
unlink( keys %other_generated );
}
+ if ( $cleanup_includes_cusdep_generated) {
+ &cleanup_cusdep_generated;
+ }
if ( $cleanup_mode == 1 ) {
&cleanup1( 'dvi', 'dviF', 'ps', 'psF', 'pdf',
split(' ', $clean_full_ext)
@@ -1796,6 +1870,16 @@ continue {
}
&ifcd_popd;
}
+
+if ($show_time) { show_timing();}
+
+sub show_timing {
+ my $processing_time = processing_time() - $processing_time1;
+ print @timings, "Accumulated processing time = $processing_time\n";
+ @timings = ();
+ $processing_time1 = processing_time();
+}
+
# If we get here without going through the continue section:
if ( $do_cd && ($#dir_stack > -1) ) {
# Just in case we did an abnormal exit from the loop
@@ -2403,6 +2487,7 @@ CHANGE:
" ==> You will need to change a source file before I do another run <==\n";
}
rdb_show_rule_errors();
+ if ($show_time && ! $first_time) { show_timing(); }
if ( $first_time || $updated || $failure ) {
print "\n=== Watching for updated files. Use ctrl/C to stop ...\n";
}
@@ -2419,6 +2504,8 @@ CHANGE:
}
last WAIT;
}
+ # Don't count waiting time in processing:
+ $processing_time1 = processing_time();
# Does this do this job????
local $new_files = 0;
rdb_for_some( [keys %current_primaries], sub{ $new_files += &rdb_find_new_filesB } );
@@ -2521,10 +2608,42 @@ sub execute_code_string {
sub cleanup1 {
# Usage: cleanup1( exts_without_period, ... )
- foreach (@_) { unlink("$root_filename.$_"); }
+ foreach (@_) {
+ (my $name = /%R/ ? $_ : "%R.$_") =~ s/%R/$root_filename/;
+ unlink("$name");
+ }
} #END cleanup1
#************************************************************
+
+sub cleanup_cusdep_generated {
+ # Remove files generated by custom dependencies
+ rdb_for_all( \&cleanup_one_cusdep_generated );
+} #END cleanup_cusdep_generated
+
+#************************************************************
+
+sub cleanup_one_cusdep_generated {
+ # Remove destination file generated by one custom dependency
+ # Assume rule context, but not that the rule is a custom dependency.
+ # Only delete destination file if source file exists (so destination
+ # file can be recreated)
+ if ( $$Pcmd_type ne 'cusdep' ) {
+ # NOT cusdep
+ return;
+ }
+ if ( (-e $$Pdest) && (-e $$Psource) ) {
+ unlink $$Pdest;
+ }
+ elsif ( (-e $$Pdest) && (!-e $$Psource) ) {
+ warn "$My_name: For custom dependency '$rule',\n",
+ " I won't delete destination file '$$Pdest'\n",
+ " because the source file '$$Psource' doesn't exist,\n",
+ " so the destination file may not be able to be recreated\n";
+ }
+} #END cleanup_one_cusdep_generated
+
+#************************************************************
#************************************************************
#************************************************************
@@ -2644,12 +2763,16 @@ sub print_help
" implementations of latex/pdflatex.)\n",
" -l - force landscape mode\n",
" -l- - turn off -l\n",
+ " -latex=<program> - set program used for latex.\n",
+ " (replace '<program>' by the program name)\n",
" -new-viewer - in -pvc mode, always start a new viewer\n",
" -new-viewer- - in -pvc mode, start a new viewer only if needed\n",
" -nobibtex - never use bibtex\n",
" -nodependents - Do not show list of dependent files after processing\n",
" -pdf - generate pdf by pdflatex\n",
" -pdfdvi - generate pdf by dvipdf\n",
+ " -pdflatex=<program> - set program used for pdflatex.\n",
+ " (replace '<program>' by the program name)\n",
" -pdfps - generate pdf by ps2pdf\n",
" -pdf- - turn off pdf\n",
" -ps - generate postscript\n",
@@ -2668,7 +2791,9 @@ sub print_help
" -pvc- - turn off -pvc\n",
" -r <file> - Read custom RC file\n",
" -silent - silence progress messages from called programs\n",
- " -v - display program version\n",
+ " -time - show CPU time used\n",
+ " -time- - don't show CPU time used\n",
+ " -v - display program version\n",
" -verbose - display usual progress messages from called programs\n",
" -version - display program version\n",
" -view=default - viewer is default (dvi, ps, pdf)\n",
@@ -2730,12 +2855,14 @@ sub view_file_via_temporary {
#************************************************************
#### Tex-related utilities
+#**************************************************
sub check_bibtex_log {
# Check for bibtex warnings:
# Usage: check_bibtex_log( base_of_bibtex_run )
# return 0: OK, 1: bibtex warnings, 2: bibtex errors,
# 3: could not open .blg file.
+ # 10: only error is missing \citation commands.
my $base = $_[0];
my $log_name = "$base.blg";
@@ -2744,17 +2871,35 @@ sub check_bibtex_log {
or return 3;
my $have_warning = 0;
my $have_error = 0;
+ my $missing_citations = 0;
+ my $error_count = 0;
while (<$log_file>) {
- if (/Warning--/) {
+ if (/^Warning--/) {
#print "Bibtex warning: $_";
$have_warning = 1;
}
- if (/error message/) {
- #print "Bibtex error: $_";
+ elsif ( /^I found no \\citation commands---while reading file/ ) {
+ $missing_citations++;
+ }
+ elsif (/There (were|was) (\d+) error message/) {
+ $error_count = $2;
+ #print "Bibtex error: count=$error_count $_";
$have_error = 1;
}
}
close $log_file;
+ #print "Bibtex errors = $error_count, missing citations = $missing_citations\n";
+ if ($have_error && ($error_count <= $missing_citations )
+ && ($missing_citations > 0) ) {
+ # If the only error is a missing citation line, that should only
+ # count as a warning.
+ # But have to deal with the problem that bibtex gives a non-zero
+ # exit code. So leave things as they are so that the user gets
+ # a better diagnostic ??????????????????????????
+# $have_error = 0;
+# $have_warning = 1;
+ return 10;
+ }
if ($have_error) {return 2;}
if ($have_warning) {return 1;}
return 0;
@@ -2762,18 +2907,23 @@ sub check_bibtex_log {
#**************************************************
-sub clean_file_name{
- # Convert filename found in log file to true filename.
- # Used normally only by parse_logB, below
- # 1. For names of form
- # `"string".ext', which arises e.g., from \jobname.bbl:
+sub clean_file_name {
+ # Convert quoted filename as found in log file to filename without quotes
+ # Allows arbitrarily embedded double-quoted substrings, includes the
+ # cases
+ # 1. `"string".ext', which arises e.g., from \jobname.bbl:
# when the base filename contains spaces, \jobname has quotes.
# and from \includegraphics with basename specified.
+ # Also deals with filenames written by asymptote.sty
# 2. Or "string.ext" from \includegraphcs with basename and ext specified.
+ # and from MiKTeX logfile for input files with spaces.
+ # Doubled quotes (e.g., A""B) don't get converted.
+ # Neither do unmatched quotes.
my $filename = $_[0];
- $filename =~ s/^\"([^\"]*)\"(.*)$/$1$2/;
+ while ( $filename =~ s/^([^\"]*)\"([^\"]+)\"(.*)$/$1$2$3/ ) {}
return $filename;
}
+
# ------------------------------
sub parse_logB {
@@ -2973,8 +3123,8 @@ LINE:
next LINE;
}
if ( /^Output written on\s+(.*)\s+\(\d+\s+page/ ) {
- $primary_out = $1;
- warn "$My_name: Log file says output to '$1'\n"
+ $primary_out = clean_file_name($1);
+ warn "$My_name: Log file says output to '$primary_out'\n"
unless $silent;
next LINE;
}
@@ -2987,15 +3137,15 @@ LINE:
next LINE;
}
if ( /^\\openout\d+\s*=\s*\`([^\']+)\'\.$/ ) {
- $generated_log{$1} = 1;
+ $generated_log{clean_file_name($1)} = 1;
next LINE;
}
# Test for conversion produced by package:
if ( /^Package (\S+) Info: Source file: <([^>]+)>/ ) {
# Info. produced by epstopdf (and possibly others)
# about file conversion
- $current_pkg = $1;
- $delegated_source = $2;
+ $current_pkg = clean_file_name($1);
+ $delegated_source = clean_file_name($2);
$block_type = 'conversion';
next LINE;
}
@@ -3064,9 +3214,9 @@ LINE:
next LINE;
}
}
- if ( /^File: ([^\s\[]*) Graphic file \(type / ) {
+ if ( /^File: (.+) Graphic file \(type / ) {
# First line of message from includegraphics/x
- $dependents{$1} = 1;
+ $dependents{clean_file_name($1)} = 1;
next LINE;
}
# Now test for generic lines to ignore, only after special cases!
@@ -3140,7 +3290,7 @@ LINE:
# Array of new candidate include files; sometimes more than one.
my @new_includes = ();
my $quoted = 0;
- if ( /^\"([^\(^\)^\"]+)\"/ ) {
+ if ( /^\"([^\"]+)\"/ ) {
# Quoted file name, as from MikTeX
$quoted = 1;
}
@@ -3254,8 +3404,8 @@ CANDIDATE:
# If the file still is not found, assume non-existent;
my @kpse_result = kpsewhich( $candidate );
if ($#kpse_result > -1) {
- $dependents{$kpse_result[0]} = 4;
delete $dependents{$candidate};
+ $dependents{$kpse_result[0]} = 4;
next CANDIDATE;
}
else {
@@ -3360,7 +3510,6 @@ CANDIDATE_PAIR:
foreach (@dependents) {
print " '$_' ";
if ( $dependents{$_} == 6 ) { print " written by (pdf)latex";}
- print "\n";
if ( $dependents{$_} == 7 ) { print " converted by (pdf)latex";}
print "\n";
}
@@ -3378,8 +3527,7 @@ CANDIDATE_PAIR:
}
if ( $misparse > 0 ) {
- print "$misparse\n";
- print "Apparent input files apparently from misunderstood lines in .log file:\n";
+ print "Possible input files, perhaps from misunderstood lines in .log file:\n";
foreach ( @misparse ) { print " $_\n"; }
}
}
@@ -3389,8 +3537,8 @@ CANDIDATE_PAIR:
#************************************************************
sub parse_aux {
- #Usage: parse_aux( $aux_file, \@new_bib_files, \@new_aux_files )
- # Parse aux_file (recursively) for bib files.
+ #Usage: parse_aux( $aux_file, \@new_bib_files, \@new_aux_files, \@new_bst_files )
+ # Parse aux_file (recursively) for bib files, and bst files.
# If can't open aux file, then
# Return 0 and leave @new_bib_files empty
# Else set @new_bib_files from information in the aux files
@@ -3404,8 +3552,10 @@ sub parse_aux {
my $aux_file = $_[0];
local $Pbib_files = $_[1];
local $Paux_files = $_[2];
+ local $Pbst_files = $_[3];
@$Pbib_files = ();
+ @$Pbst_files = ();
@$Paux_files = ();
parse_aux1( $aux_file );
@@ -3413,6 +3563,7 @@ sub parse_aux {
return 0;
}
@$Pbib_files = uniqs( @$Pbib_files );
+ @$Pbst_files = uniqs( @$Pbst_files );
if ( $#{$Pbib_files} == -1 ) {
warn "$My_name: No .bib files listed in .aux file '$aux_file' \n",
@@ -3421,6 +3572,8 @@ sub parse_aux {
my $bibret = &find_file_list1( $Pbib_files, $Pbib_files,
'.bib', \@BIBINPUTS );
@$Pbib_files = uniqs( @$Pbib_files );
+ &find_file_list1( $Pbst_files, $Pbst_files, '.bst' );
+ @$Pbst_files = uniqs( @$Pbst_files );
if ($bibret == 0) {
warn "$My_name: Found bibliography file(s) [@$Pbib_files]\n"
unless $silent;
@@ -3468,6 +3621,11 @@ AUX_LINE:
# (Without the '.bib' extension)
push( @$Pbib_files, split /,/, $1 );
}
+ elsif ( /^\\bibstyle\{(.*)\}/ ) {
+ # \\bibstyle{bst_file_name}
+ # (Without the '.bst' extension)
+ push( @$Pbst_files, $1 );
+ }
elsif ( /^\\\@input\{(.*)\}/ ) {
# \\@input{next_aux_file_name}
&parse_aux1( $1 );
@@ -3968,9 +4126,10 @@ sub rdb_set_from_logB {
foreach my $bbl_file ( uniqs( @bbl_files ) ) {
my ($bbl_base, $bbl_path, $bbl_ext) = fileparseA( $bbl_file );
$bbl_base = $bbl_path.$bbl_base;
- my @new_bib_files;
- my @new_aux_files;
- &parse_aux( "$bbl_base.aux", \@new_bib_files, \@new_aux_files );
+ my @new_bib_files = ();
+ my @new_aux_files = ();
+ my @new_bst_files = ();
+ &parse_aux( "$bbl_base.aux", \@new_bib_files, \@new_aux_files, \@new_bst_files );
my $from_rule = "bibtex $bbl_base";
print "!!!===Dealing with rule '$from_rule'\n"
if ($diagnostics);
@@ -3982,7 +4141,7 @@ sub rdb_set_from_logB {
}
local %old_sources = ();
rdb_one_rule( $from_rule, sub { %old_sources = %$PHsource; } );
- foreach my $source ( @new_bib_files, @new_aux_files ) {
+ foreach my $source ( @new_bib_files, @new_aux_files, @new_bst_files ) {
print " === Source file '$source' for '$from_rule'\n"
if ($diagnostics);
rdb_ensure_file( $from_rule, $source );
@@ -4982,6 +5141,11 @@ sub rdb_run1 {
elsif ($retcode == 1) {
push @warnings, "Bibtex warnings for '$$Pbase'";
}
+ elsif ($retcode == 10) {
+ push @warnings, "Bibtex found no citations for '$$Pbase'";
+ # But this is an innocuous error, so fix return code
+ $return = 0;
+ }
}
$updated = 1;
@@ -5986,6 +6150,13 @@ sub get_time_size_raw
#************************************************************
+sub processing_time
+{ my ($user, $system, $cuser, $csystem) = times();
+ return $user + $system + $cuser + $csystem;
+}
+
+#************************************************************
+
sub get_checksum_md5 {
my $source = shift;
my $input = new FileHandle;
@@ -6040,38 +6211,41 @@ sub find_file1 {
# On success: full_name = full name with path, retcode = 0
# On failure: full_name = given name, retcode = 1
- my $name = $_[0];
- # Make local copy of path, since we may rewrite it!
- my @path = @{$_[1]};
- if ( $name =~ /^\// ) {
- # Absolute path (if under UNIX)
- # This needs fixing, in general
- if (-e $name) { return( $name, 0 );}
- else { return( $name, 1 );}
- }
- foreach my $dir ( @path ) {
- #??print "-------------dir='$dir', ";
- # Make $dir concatenatable, and empty for current dir:
- if ( $dir eq '.' ) {
- $dir = '';
- }
- elsif ( $dir =~ /[\/\\:]$/ ) {
- #OK if dir ends in / or \ or :
- }
- elsif ( $dir ne '' ) {
- #Append directory separator only to non-empty dir
- $dir = "$dir/";
- }
- #?? print " newdir='$dir'\n";
- if (-e "$dir$name") {
- return("$dir$name", 0);
- }
- }
- my @kpse_result = kpsewhich( $name );
- if ($#kpse_result > -1) {
- return( $kpse_result[0], 0);
- }
- return("$name" , 1);
+ my $name = $_[0];
+ # Make local copy of path, since we may rewrite it!
+ my @path = ();
+ if ($_[1]) {
+ @path = @{$_[1]};
+ }
+ if ( $name =~ /^\// ) {
+ # Absolute path (if under UNIX)
+ # This needs fixing, in general
+ if (-e $name) { return( $name, 0 );}
+ else { return( $name, 1 );}
+ }
+ foreach my $dir ( @path ) {
+ #??print "-------------dir='$dir', ";
+ # Make $dir concatenatable, and empty for current dir:
+ if ( $dir eq '.' ) {
+ $dir = '';
+ }
+ elsif ( $dir =~ /[\/\\:]$/ ) {
+ #OK if dir ends in / or \ or :
+ }
+ elsif ( $dir ne '' ) {
+ #Append directory separator only to non-empty dir
+ $dir = "$dir/";
+ }
+ #?? print " newdir='$dir'\n";
+ if (-e "$dir$name") {
+ return("$dir$name", 0);
+ }
+ }
+ my @kpse_result = kpsewhich( $name );
+ if ($#kpse_result > -1) {
+ return( $kpse_result[0], 0);
+ }
+ return("$name" , 1);
} #END find_file1
#************************************************************
@@ -6419,7 +6593,11 @@ sub tempfile1 {
sub Run_msg {
# Same as Run, but give message about my running
warn_running( "Running '$_[0]'" );
- Run($_[0]);
+ my $time1 = processing_time();
+ my ($pid, $return) = Run($_[0]);
+ my $time = processing_time() - $time1;
+ push @timings, "'$_[0]': time = $time\n";
+ return ($pid, $return);
}
sub Run {
diff --git a/Master/texmf/doc/man/man1/latexmk.1 b/Master/texmf/doc/man/man1/latexmk.1
index 21bbc3766b7..7e0bc674c09 100644
--- a/Master/texmf/doc/man/man1/latexmk.1
+++ b/Master/texmf/doc/man/man1/latexmk.1
@@ -1,4 +1,4 @@
-.TH LATEXMK 1L "27 July 2010" ""
+.TH LATEXMK 1L "28 December 2010" ""
.SH NAME
latexmk \- generate LaTeX document
.SH SYNOPSIS
@@ -81,7 +81,7 @@ of which programs. In its new version, \fIlatexmk\fR has a highly
general and efficient solution to these issues. The solution involves
retaining between runs information on the source files, and a symptom
is that \fIlatexmk\fR generates an extra file (with extension
-\fR.fdb_latexmk\fR, by default) that contains the source file
+\fI.fdb_latexmk\fR, by default) that contains the source file
information.
.SH LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE
@@ -176,6 +176,10 @@ if you want to do a cleanup then a make.
If \fI$bibtex_use\fR is set to 0 or 1, bbl files are counted as
non-regeneratable.
+
+If \fI$cleanup_includes_cusdep_generated\fR is nonzero, regeneratable
+files are considered as including those generated by custom
+dependencies and are also deleted. Otherwise these files are not deleted.
.TP
.B -C
Clean up (remove) all regeneratable files generated by \fIlatex\fR and
@@ -188,17 +192,14 @@ if you want to do a cleanup than a make.
If \fI$bibtex_use\fR is set to 0 or 1, bbl files are counted as
non-regeneratable.
+
+If \fI$cleanup_includes_cusdep_generated\fR is nonzero, regeneratable
+files are considered as including those generated by custom
+dependencies and are also deleted. Otherwise these files are not deleted.
.TP
.B -CA
Clean up (remove) absolutely all regeneratable files. It is now
-equivalent to the \fB-C\fR option
-
-This cleanup is instead of a regular make.
-See the \fB-gg\fR option if you want to do a cleanup then a
-make.
-
-If \fI$bibtex_use\fR is set to 0 or 1, bbl files are counted as
-non-regeneratable.
+equivalent to the \fB-C\fR option. See that option for details.
.TP
.B -CF
Remove the file containing the database of source file information,
@@ -891,6 +892,13 @@ use BibTeX if the bib files exist. 2: run BibTeX whenever it appears
necessary to update the bbl files, without testing for the existence
of the bib files.
.TP
+.B $cleanup_includes_cusdep_generated [0]
+If nonzero, specifies that cleanup also deletes files that are
+generated by custom dependencies.
+(When doing a clean up, e.g., by use of the \fI-C\fR option, custom
+dependencies are those listed in the \fI.fdb_latexmk\fR file from a
+previous run.)
+.TP
.B $cleanup_includes_generated [0]
If nonzero, specifies that cleanup also deletes files that are
detected in log file as being generated (see the \\openout lines in
@@ -905,14 +913,25 @@ files. (There is also extra cleaning as specified by the
variables.)
.PP
This variable is equivalent to specifying one of
-the \fB-c\fR, \fB-c1\fR, or \fB-C\fR options. But there should be no need
+the \fB-c\fR or \fB-C\fR options. But there should be no need
to set this variable from an RC file.
.TP
.B $clean_ext [""]
Extra extensions of files for \fIlatexmk\fR to remove when any of the
-clean-up options (\fB-c\fR, \fB-c1\fR, or \fB-C\fR) is selected.
+clean-up options (\fB-c\fR or \fB-C\fR) is selected.
The value of this variable is a string containing the extensions
separated by spaces.
+
+It is also possible to specify a more general pattern of file to be
+deleted, by using the place holder %R, as in commands. Thus setting
+
+ $clean_ext = "out %R-blx.bib";
+
+in an initialization file will imply that when a clean-up operation is
+specified, not only is the standard set of files deleted, but also
+files of the form FOO.out and FOO-blx.bib, where FOO stands for the
+basename of the file being processed (as in FOO.tex).
+
.TP
.B $clean_full_ext [""]
Extra extensions of files for \fIlatexmk\fR to remove when the \fB-C\fR
@@ -1087,7 +1106,8 @@ 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, \fIlatex\fR sees
that the eps file has changed, and therefore reruns latex. This
-causes an infinite loop, only exited becaues \fIlatexmk\fR has a limit
+causes an infinite loop, that is only terminated becaues \fIlatexmk\fR
+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
@@ -1104,6 +1124,26 @@ are to be specified in general.) This particular regular expression
specifies that lines beginning with "%%CreationDate: " are to be
ignored in deciding whether a file of the given extension \fI.eps\fR
has changed.
+
+There is only one regular expression available for each extension. If
+you need more one pattern to specify lines to ignore, then you need to
+combine the patterns into a single regular expression. The simplest
+method is separate the different simple patterns by a vertical bar
+character (indicating "alternation" in the jargon of regular
+expressions). For example,
+
+ $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: |^%%Title: ';
+
+causes lines starting with either "^%%CreationDate: " or "^%%Title: "
+to be ignored.
+
+It may happen that a pattern to be ignored is specified in, for
+example, in a system or user initialization file, and you wish to
+remove this in a file read later. To do this, you use perl's delete
+function, e.g.,
+
+ delete $hash_calc_ignore_pattern{'eps'};
+
.TP
.B $kpsewhich ["kpsewhich %S"]
The program called to locate a source file when the name alone is not
@@ -1715,7 +1755,7 @@ e-mail addresses are not written in their standard form to avoid being
harvested by worms and viruses.)
.SH AUTHOR
Current version, by John Collins (username collins at node phys.psu.edu).
-(Version 4.17).
+(Version 4.21).
Released version can be obtained from CTAN:
<http://www.tug.org/tex-archive/support/latexmk/>, and from the
diff --git a/Master/texmf/doc/man/man1/latexmk.man1.pdf b/Master/texmf/doc/man/man1/latexmk.man1.pdf
index 9faf5bbb9d4..fd4d993bfd0 100644
--- a/Master/texmf/doc/man/man1/latexmk.man1.pdf
+++ b/Master/texmf/doc/man/man1/latexmk.man1.pdf
Binary files differ