diff options
author | Karl Berry <karl@freefriends.org> | 2015-02-22 22:04:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-02-22 22:04:48 +0000 |
commit | 0d90f2f36d4d8fde651668aaab3e48a2c6db80c1 (patch) | |
tree | 271511032392443cf6b595cced2b2608f2fb4d76 /Master | |
parent | 23d33b3a33e4e066a0718491024c5c2ee8ec7f99 (diff) |
latexmk (22feb15)
git-svn-id: svn://tug.org/texlive/trunk@36353 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/man/man1/latexmk.1 | 47 | ||||
-rw-r--r-- | Master/texmf-dist/doc/man/man1/latexmk.man1.pdf | bin | 145217 -> 147760 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/latexmk/CHANGES | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexmk/INSTALL | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexmk/README | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexmk/latexmk.pdf | bin | 133188 -> 135604 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/latexmk/latexmk.txt | 1582 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/latexmk/latexmk.pl | 262 |
8 files changed, 1097 insertions, 808 deletions
diff --git a/Master/texmf-dist/doc/man/man1/latexmk.1 b/Master/texmf-dist/doc/man/man1/latexmk.1 index 5d2afc41803..a4e46dc36b3 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 1L "10 January 2015" "" +.TH LATEXMK 1L "5 February 2015" "" .SH NAME latexmk \- generate LaTeX document .SH SYNOPSIS @@ -869,10 +869,15 @@ Print version number of \fIlatexmk\fR. .B -verbose Opposite of \fB-silent\fR. This is the default setting. .TP -.B -view=default, -view=dvi, -view=ps, -view=pdf +.B -view=default, -view=dvi, -view=ps, -view=pdf, -view=none Set the kind of file used when previewing is requested (e.g., by the \fB-pv\fR or \fB-pvc\fR switches). The default is to view the "highest" kind of requested file (in the order dvi, ps, pdf). + +Note the possibility \fB-view=none\fR where no viewer is opened at +all. One example of is use is in conjunction with the \fB-pvc\fR +option, when you want \fIlatexmk\fR to do a compilation automatically +whenever source file(s) change, but do want a previewer to be opened. .TP .B -xelatex @@ -1503,15 +1508,43 @@ compilation. Custom dependency list -- see section on "Custom Dependencies". .TP +.B @default_excluded_files [()] +When \fIlatexmk\fR is invoked with no files specified on the command +line, then, by default, it will process all files in the current +directory with the extension .tex. (In general, it will process the +files specified in the \fI@default_files\fR variable.) + +But sometimes you want to exclude particular files from this default +list. In that case you can specify the excluded files in the array +\fI@default_excluded_files\fR. For example if you wanted to process +all .tex files with the exception of common.tex, which is a not a +standard alone LaTeX file but a file input by some or all of the +others, you could do + + @default_files = ("*.tex"); + + @default_excluded_files = ("common.tex"); + +If you have a variable or large number of files to be processed, this +method saves you from having to list them in detail in +\fI@default_files\fR and having to update the list every time you +change the set of files to be processed. + +Notes: 1. This variable has no effect except when no files are +specified on the \fIlatexmk\fR command line. 2. Wildcards are allowed +in \fI@default_excluded_files\fR. + +.TP .B @default_files [("*.tex")] Default list of files to be processed. -Normally, if no filenames are specified on the command line, +If no filenames are specified on the command line, \fIlatexmk\fR processes all tex files specified in the \fI@default_files\fR variable, which by default is set to all tex files ("*.tex") in the current directory. This is a convenience: just run \fIlatexmk\fR and it will process an appropriate set of files. But sometimes you want -only some of these files to be processed. In this case you set the +only some of these files to be processed. In this case you can list +the files to be processed by setting \fI@default_files\fR in an initialization file (e.g., the file "latexmkrc" in the current directory). Then if no files are specified on the command line then the files you specify by @@ -1529,6 +1562,10 @@ Note that more than file may be given, and that the default extension is ".tex". Wild cards are allowed. The parentheses are because \fI@default_files\fR is an array variable, i.e., a sequence of filename specifications is possible. + +If you want \fIlatexmk\fR to process all .tex files with a few +exceptions, see the \fI@default_excluded_files\fR array variable. + .TP .B $dependents_phony [0] If a list of dependencies is output, this variable determines whether @@ -2703,7 +2740,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 jcc8 at node psu.edu). -(Version 4.42). +(Version 4.43a). Released version can be obtained from CTAN: <http://www.ctan.org/tex-archive/support/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 Binary files differindex 4f26dc26443..7721ee89666 100644 --- a/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf +++ b/Master/texmf-dist/doc/man/man1/latexmk.man1.pdf diff --git a/Master/texmf-dist/doc/support/latexmk/CHANGES b/Master/texmf-dist/doc/support/latexmk/CHANGES index 9d0b4094320..1274802f235 100644 --- a/Master/texmf-dist/doc/support/latexmk/CHANGES +++ b/Master/texmf-dist/doc/support/latexmk/CHANGES @@ -464,3 +464,9 @@ From v. 4.41 to 4.42 Fix bugs associated with the -cd option Add missfont.log and the generated synctex.gz to standard cleaned-up files +From v. 4.42 to 4.43a + Fix problem that source files are not correctly detected under + MiKTeX when name of current working directory contains non-ASCII + characters. + On cleanup, synctex.gz files are deleted only by -C, not by -c. + diff --git a/Master/texmf-dist/doc/support/latexmk/INSTALL b/Master/texmf-dist/doc/support/latexmk/INSTALL index 6f142440fa0..7de9248944f 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.42, 10 January 2015) + (Version 4.43a, 5 February 2015) John Collins Physics Department diff --git a/Master/texmf-dist/doc/support/latexmk/README b/Master/texmf-dist/doc/support/latexmk/README index 289c996e983..0f4d7620421 100644 --- a/Master/texmf-dist/doc/support/latexmk/README +++ b/Master/texmf-dist/doc/support/latexmk/README @@ -1,5 +1,5 @@ -Latexmk, version 4.42, 10 January 2015 --------------------------------------- +Latexmk, version 4.43a, 5 February 2015 +--------------------------------------- Latexmk completely automates the process of generating a LaTeX document. Essentially, it is a highly specialized cousin of the @@ -91,7 +91,7 @@ NOTES:- John Collins ---------------------------- "latexmk -h" ---------------------------- -Latexmk 4.42: Automatic LaTeX document generation routine +Latexmk 4.43a: Automatic LaTeX document generation routine Usage: latexmk [latexmk_options] [filename ...] diff --git a/Master/texmf-dist/doc/support/latexmk/latexmk.pdf b/Master/texmf-dist/doc/support/latexmk/latexmk.pdf Binary files differindex 79314cd37ef..fecec0f39b1 100644 --- a/Master/texmf-dist/doc/support/latexmk/latexmk.pdf +++ b/Master/texmf-dist/doc/support/latexmk/latexmk.pdf diff --git a/Master/texmf-dist/doc/support/latexmk/latexmk.txt b/Master/texmf-dist/doc/support/latexmk/latexmk.txt index f68f883268b..18c6c768e39 100644 --- a/Master/texmf-dist/doc/support/latexmk/latexmk.txt +++ b/Master/texmf-dist/doc/support/latexmk/latexmk.txt @@ -61,7 +61,7 @@ DESCRIPTION - 10 January 2015 1 + 5 February 2015 1 @@ -127,7 +127,7 @@ LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE - 10 January 2015 2 + 5 February 2015 2 @@ -193,7 +193,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 3 + 5 February 2015 3 @@ -259,7 +259,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 4 + 5 February 2015 4 @@ -325,7 +325,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 5 + 5 February 2015 5 @@ -391,7 +391,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 6 + 5 February 2015 6 @@ -457,7 +457,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 7 + 5 February 2015 7 @@ -523,7 +523,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 8 + 5 February 2015 8 @@ -589,7 +589,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 9 + 5 February 2015 9 @@ -655,7 +655,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 10 + 5 February 2015 10 @@ -721,7 +721,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 11 + 5 February 2015 11 @@ -787,7 +787,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 12 + 5 February 2015 12 @@ -853,7 +853,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 13 + 5 February 2015 13 @@ -919,7 +919,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 14 + 5 February 2015 14 @@ -985,7 +985,7 @@ LATEXMK(1L) LATEXMK(1L) - 10 January 2015 15 + 5 February 2015 15 @@ -1002,11 +1002,17 @@ LATEXMK(1L) LATEXMK(1L) -verbose Opposite of -silent. This is the default setting. - -view=default, -view=dvi, -view=ps, -view=pdf + -view=default, -view=dvi, -view=ps, -view=pdf, -view=none Set the kind of file used when previewing is requested (e.g., by the -pv or -pvc switches). The default is to view the "highest" kind of requested file (in the order dvi, ps, pdf). + Note the possibility -view=none where no viewer is opened at + all. One example of is use is in conjunction with the -pvc + option, when you want latexmk to do a compilation automatically + whenever source file(s) change, but do want a previewer to be + opened. + -xelatex Use xelatex. That is, use xelatex to process the source file(s) @@ -1042,22 +1048,21 @@ EXAMPLES keep running, watching for source file changes. - % latexmk -c # remove .aux, .log, .bbl, .blg, .dvi, - .pdf, .ps & .bbl files - + 5 February 2015 16 - 10 January 2015 16 +LATEXMK(1L) LATEXMK(1L) + % latexmk -c # remove .aux, .log, .bbl, .blg, .dvi, + .pdf, .ps & .bbl files -LATEXMK(1L) LATEXMK(1L) HOW TO CHANGE THE WAY LATEXMK BEHAVES, DEALING WITH PROBLEMS, ETC @@ -1109,21 +1114,21 @@ HOW TO CHANGE THE WAY LATEXMK BEHAVES, DEALING WITH PROBLEMS, ETC g. Ask a question at tex.stackexchange.com. - h. Or ask me (the author of latexmk). My e-mail is at the end of this - documentation. + 5 February 2015 17 - 10 January 2015 17 +LATEXMK(1L) LATEXMK(1L) + h. Or ask me (the author of latexmk). My e-mail is at the end of this + documentation. -LATEXMK(1L) LATEXMK(1L) CONFIGURATION/INITIALIZATION (RC) FILES @@ -1175,23 +1180,23 @@ CONFIGURATION/INITIALIZATION (RC) FILES For possible examples of code for in an RC file, see the directory example_rcfiles in the distribution of latexmk (e.g., at - http://www.ctan.org/tex-archive/support/latexmk/example_rcfiles). -HOW TO SET VARIABLES IN INITIALIZATION FILES - The important variables that can be configured are described in the + 5 February 2015 18 - 10 January 2015 18 +LATEXMK(1L) LATEXMK(1L) -LATEXMK(1L) LATEXMK(1L) + http://www.ctan.org/tex-archive/support/latexmk/example_rcfiles). +HOW TO SET VARIABLES IN INITIALIZATION FILES + The important variables that can be configured are described in the section "List of configuration variables usable in initialization files". Syntax for setting these variables is of the following forms: @@ -1241,15 +1246,10 @@ FORMAT OF COMMAND SPECIFICATIONS The two items starting with the % character are placeholders. These are substituted by appropriate values before the command is run. Thus - %S will be replaced by the source file that elatex will be applied to, - and %O will be replaced by any options that latexmk has decided to use - for this command. (E.g., if you used the -silent option it would - replace %O by "-interaction=batchmode".) - - 10 January 2015 19 + 5 February 2015 19 @@ -1258,6 +1258,11 @@ FORMAT OF COMMAND SPECIFICATIONS LATEXMK(1L) LATEXMK(1L) + %S will be replaced by the source file that elatex will be applied to, + and %O will be replaced by any options that latexmk has decided to use + for this command. (E.g., if you used the -silent option it would + replace %O by "-interaction=batchmode".) + The available placeholders are: %B base of filename for current command. E.g., if a postscript @@ -1307,15 +1312,10 @@ LATEXMK(1L) LATEXMK(1L) 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'; - 10 January 2015 20 + 5 February 2015 20 @@ -1324,6 +1324,12 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + 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. @@ -1372,16 +1378,10 @@ LATEXMK(1L) LATEXMK(1L) traPDF.exe" %O %S'; - (Note about the above example: Forward slashes are equivalent to back- - 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 - rules for dealing with forward slashes in strings in the Perl lan- - guage.) - 10 January 2015 21 + 5 February 2015 21 @@ -1390,6 +1390,13 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + (Note about the above example: Forward slashes are equivalent to back- + 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 + rules for dealing with forward slashes in strings in the Perl lan- + guage.) + 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. @@ -1438,16 +1445,9 @@ LATEXMK(1L) LATEXMK(1L) return system 'latex', @args; } - Advanced tricks: Normally one specifies a single command for the com- - mands invoked by latexmk. Naturally, if there is some complicated - additional processing you need to do in your special situation, you can - write a script (or batch file) to do the processing, and then configure - latexmk to use your script in place of the standard program. - - - 10 January 2015 22 + 5 February 2015 22 @@ -1456,6 +1456,12 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + Advanced tricks: Normally one specifies a single command for the com- + mands invoked by latexmk. Naturally, if there is some complicated + additional processing you need to do in your special situation, you can + write a script (or batch file) to do the processing, and then configure + latexmk to use your script in place of the standard program. + It is also possible to configure latexmk to run multiple commands. For example, if when running pdflatex to generate a pdf file from a tex file you need to run another program after pdflatex to perform some @@ -1504,16 +1510,10 @@ LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES $auto_rc_use [1] 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 - to prevent automatic reading of the later RC files. - This variable does not affect the reading of RC files specified - - 10 January 2015 23 + 5 February 2015 23 @@ -1522,6 +1522,12 @@ LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES LATEXMK(1L) LATEXMK(1L) + 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 + to prevent automatic reading of the later RC files. + + This variable does not affect the reading of RC files specified on the command line by the -r option. @@ -1570,16 +1576,10 @@ LATEXMK(1L) LATEXMK(1L) @BIBINPUTS This is an array variable, now mostly obsolete, that specifies - directories where latexmk should look for .bib files. By - default it is set from the BIBINPUTS environment variable of the - operating system. If that environment variable is not set, a - single element list consisting of the current directory is set. - The format of the directory names depends on your operating sys- - tem, of course. Examples for setting this variable are: - 10 January 2015 24 + 5 February 2015 24 @@ -1588,6 +1588,13 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + directories where latexmk should look for .bib files. By + default it is set from the BIBINPUTS environment variable of the + operating system. If that environment variable is not set, a + single element list consisting of the current directory is set. + The format of the directory names depends on your operating sys- + tem, of course. Examples for setting this variable are: + @BIBINPUTS = ( ".", "C:\bibfiles" ); @BIBINPUTS = ( ".", "\\server\bibfiles" ); @BIBINPUTS = ( ".", "C:/bibfiles" ); @@ -1635,17 +1642,10 @@ LATEXMK(1L) LATEXMK(1L) values are: 0: never use BibTeX or biber. 1: only use BibTeX or biber if the bib files exist. 2: run BibTeX or biber whenever it appears necessary to update the bbl files, without testing - for the existence of the bib files. - $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.) - - 10 January 2015 25 + 5 February 2015 25 @@ -1654,6 +1654,14 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + for the existence of the bib files. + + $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.) + $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 @@ -1701,17 +1709,9 @@ LATEXMK(1L) LATEXMK(1L) $compiling_cmd [undefined], $failure_cmd [undefined], $success_cmd [undefined] - These variables specify commands that are executed at certain - points of compilations during preview-continuous mode. One - motivation for their existance is to allow convenient visual - indications of compilation status even when the window receiving - the screen output of the compilation is hidden. - - The commands are executed at the following points: - - 10 January 2015 26 + 5 February 2015 26 @@ -1720,9 +1720,16 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - $compiling_cmd at the start of compilation, $success_cmd at the - end of a successful compilation, and $failure_cmd at the end of - an unsuccessful compilation. If any of above variables is unde- + These variables specify commands that are executed at certain + points of compilations during preview-continuous mode. One + motivation for their existance is to allow convenient visual + indications of compilation status even when the window receiving + the screen output of the compilation is hidden. + + The commands are executed at the following points: $compil- + ing_cmd at the start of compilation, $success_cmd at the end of + a successful compilation, and $failure_cmd at the end of an + unsuccessful compilation. If any of above variables is unde- fined (the default situation) or blank, then the corresponding command is not executed. @@ -1756,35 +1763,63 @@ LATEXMK(1L) LATEXMK(1L) Custom dependency list -- see section on "Custom Dependencies". - @default_files [("*.tex")] - Default list of files to be processed. + @default_excluded_files [()] + When latexmk is invoked with no files specified on the command + line, then, by default, it will process all files in the current + directory with the extension .tex. (In general, it will process + the files specified in the @default_files variable.) - Normally, if no filenames are specified on the command line, - latexmk processes all tex files specified in the @default_files - 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 - you want only some of these files to be processed. In this case - you set the @default_files in an initialization file (e.g., the - file "latexmkrc" in the current directory). Then if no files - are specified on the command line then the files you specify by - setting @default_files are processed. + But sometimes you want to exclude particular files from this + default list. In that case you can specify the excluded files + in the array @default_excluded_files. For example if you wanted + to process all .tex files with the exception of common.tex, + which is a not a standard alone LaTeX file but a file input by - Three examples: - @default_files = ("paper_current"); + + 5 February 2015 27 - 10 January 2015 27 +LATEXMK(1L) LATEXMK(1L) + some or all of the others, you could do + @default_files = ("*.tex"); -LATEXMK(1L) LATEXMK(1L) + @default_excluded_files = ("common.tex"); + If you have a variable or large number of files to be processed, + this method saves you from having to list them in detail in + @default_files and having to update the list every time you + change the set of files to be processed. + + Notes: 1. This variable has no effect except when no files are + specified on the latexmk command line. 2. Wildcards are allowed + in @default_excluded_files. + + + @default_files [("*.tex")] + Default list of files to be processed. + + If no filenames are specified on the command line, latexmk pro- + cesses all tex files specified in the @default_files variable, + which by default is set to all tex files ("*.tex") in the cur- + rent directory. This is a convenience: just run latexmk and it + will process an appropriate set of files. But sometimes you + want only some of these files to be processed. In this case you + can list the files to be processed by setting @default_files in + an initialization file (e.g., the file "latexmkrc" in the cur- + rent directory). Then if no files are specified on the command + line then the files you specify by setting @default_files are + processed. + + Three examples: + + @default_files = ("paper_current"); @default_files = ("paper1", "paper2.tex"); @@ -1795,233 +1830,248 @@ LATEXMK(1L) LATEXMK(1L) are because @default_files is an array variable, i.e., a sequence of filename specifications is possible. + If you want latexmk to process all .tex files with a few excep- + tions, see the @default_excluded_files array variable. + + $dependents_phony [0] - If a list of dependencies is output, this variable determines - whether to include a phony target for each source file. If you - use the dependents list in a Makefile, the dummy rules work - around errors make gives if you remove header files without + If a list of dependencies is output, this variable determines + whether to include a phony target for each source file. If you + use the dependents list in a Makefile, the dummy rules work + around errors make gives if you remove header files without updating the Makefile to match. + + + 5 February 2015 28 + + + + + +LATEXMK(1L) LATEXMK(1L) + + $dependents_list [0] - Whether to display a list(s) of dependencies at the end of a + Whether to display a list(s) of dependencies at the end of a run. $deps_file ["-"] - Name of file to receive list(s) of dependencies at the end of a - run, to be used if $dependesnt_list is set. If the filename is - "-", then the dependency list is set to stdout (i.e., normally + Name of file to receive list(s) of dependencies at the end of a + run, to be used if $dependesnt_list is set. If the filename is + "-", then the dependency list is set to stdout (i.e., normally the screen). $do_cd [0] - Whether to change working directory to the directory specified - for the main source file before processing it. The default + Whether to change working directory to the directory specified + for the main source file before processing it. The default behavior is not to do this, which is the same as the behavior of - latex and pdflatex programs. This variable is set by the -cd + latex and pdflatex programs. This variable is set by the -cd and -cd- options on latexmk's command line. $dvi_filter [empty] - The dvi file filter to be run on the newly produced dvi file - before other processing. Equivalent to specifying the -dF + The dvi file filter to be run on the newly produced dvi file + before other processing. Equivalent to specifying the -dF option. $dvi_mode [See below for default] - If nonzero, generate a dvi version of the document. Equivalent + If nonzero, generate a dvi version of the document. Equivalent to the -dvi option. - The variable $dvi_mode defaults to 0, but if no explicit - requests are made for other types of file (postscript, pdf), - then $dvi_mode will be set to 1. In addition, if a request for - a file for which a .dvi file is a prerequisite, then $dvi_mode + The variable $dvi_mode defaults to 0, but if no explicit + requests are made for other types of file (postscript, pdf), + then $dvi_mode will be set to 1. In addition, if a request for + a file for which a .dvi file is a prerequisite, then $dvi_mode will be set to 1. $dvi_previewer ["start xdvi %O %S" under UNIX] - The command to invoke a dvi-previewer. [Default is "start" - under MS-WINDOWS; under more recent versions of Windows, this - will cause to be run whatever command the system has associated + The command to invoke a dvi-previewer. [Default is "start" + under MS-WINDOWS; under more recent versions of Windows, this + will cause to be run whatever command the system has associated with .dvi files.] + Important note: Normally you will want to have a previewer run + detached, so that latexmk doesn't wait for the previewer to ter- + minate before continuing its work. So normally you should pre- + fix the command by "start ", which flags to latexmk that it + should do the detaching of the previewer itself (by whatever + method is appropriate to the operating system). But sometimes + letting latexmk do the detaching is not appropriate (for a vari- + ety of non-trivial reasons), so you should put the "start " bit + in yourself, whenever it is needed. - - 10 January 2015 28 + $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 + of Windows, this will cause to be run whatever command the sys- + tem has associated with .dvi files.] + 5 February 2015 29 -LATEXMK(1L) LATEXMK(1L) - Important note: Normally you will want to have a previewer run - detached, so that latexmk doesn't wait for the previewer to ter- - minate before continuing its work. So normally you should pre- - fix the command by "start ", which flags to latexmk that it - should do the detaching of the previewer itself (by whatever - method is appropriate to the operating system). But sometimes - letting latexmk do the detaching is not appropriate (for a vari- - ety of non-trivial reasons), so you should put the "start " bit - in yourself, whenever it is needed. +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 - of Windows, this will cause to be run whatever command the sys- - tem has associated with .dvi files.] $dvipdf ["dvipdf %O %S %D"] Command to convert dvi to pdf file. A common reconfiguration is - to use the dvipdfm command, which needs its arguments in a dif- + to use the dvipdfm command, which needs its arguments in a dif- ferent 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 + 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 -- see below -- will be included in the options substituted for "%O". $dvips_landscape ["dvips -tlandscape %O -o %D %S"] - The program to used as a filter to convert a .dvi file to a .ps + 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 + Switch(es) for dvips program when pdf file is to be generated from ps file. $dvips_silent_switch ["-q"] Switch(es) for dvips program when silent mode is on. + $dvi_update_command [""] + When the dvi previewer is set to be updated by running a com- + mand, this is the command that is run. See the information for + the variable $dvi_update_method for further information, and see + information on the variable $pdf_update_method for an example + 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_update_method and to the $ps_update_method variables. + 0 => update is automatic, + 1=> manual update by user, which may only mean a mouse click + on the viewer's window or may mean a more serious action. + 2 => Send the signal, whose number is in the variable + $dvi_update_signal. The default value under UNIX is suitable - 10 January 2015 29 + 5 February 2015 30 -LATEXMK(1L) LATEXMK(1L) - $dvi_update_command [""] - When the dvi previewer is set to be updated by running a com- - mand, this is the command that is run. See the information for - the variable $dvi_update_method for further information, and see - information on the variable $pdf_update_method for an example - for the analogous case of a pdf previewer. +LATEXMK(1L) LATEXMK(1L) + - $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_update_method and to the $ps_update_method variables. - 0 => update is automatic, - 1=> manual update by user, which may only mean a mouse click - on the viewer's window or may mean a more serious action. - 2 => Send the signal, whose number is in the variable - $dvi_update_signal. The default value under UNIX is suitable for xdvi. - 3 => Viewer cannot do an update, because it locks the file. + 3 => Viewer cannot do an update, because it locks the file. (As with acroread under MS-Windows.) - 4 => run a command to do the update. The command is speci- + 4 => run a command to do the update. The command is speci- fied by the variable $dvi_update_command. - See information on the variable $pdf_update_method for an exam- + See information on the variable $pdf_update_method for an exam- ple of updating by command. - $dvi_update_signal [Under UNIX: SIGUSR1, which is a system-dependent + $dvi_update_signal [Under UNIX: SIGUSR1, which is a system-dependent value] - The number of the signal that is sent to the dvi viewer when it - is updated by sending a signal -- see the information on the - variable $dvi_update_method. The default value is the one + The number of the signal that is sent to the dvi viewer when it + is updated by sending a signal -- see the information on the + variable $dvi_update_method. The default value is the one appropriate for xdvi on a UNIX system. $failure_cmd [undefined] See the documentation for $compiling_cmd. $fdb_ext ["fdb_latexmk"] - The extension of the file which latexmk generates to contain a - database of information on source files. You will not normally + 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. $force_mode [0] - If nonzero, continue processing past minor latex errors includ- + If nonzero, continue processing past minor latex errors includ- ing unrecognized cross references. Equivalent to specifying the -f option. - @generated_exts [( aux , bbl , idx , ind , lof , lot , out , toc , + @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, + This contains a list of extensions for files that are generated + during a LaTeX run and that are read in by LaTeX in later runs, either directly or indirectly. - This list has two uses: (a) to set the kinds of file to be + This list has two uses: (a) to set the kinds of file to be deleted in a cleanup operation (with the -c, -C, -CA, -g and -gg - options), and (b) in the determination of whether a rerun of + options), and (b) in the determination of whether a rerun of + (pdf)LaTeX is needed after a run that gives an error. + (Normally, a change of a source file during a run should provoke + a rerun. This includes a file generated by LaTeX, e.g., an aux + file, that is read in on subsequent runs. But after a run that + results in an error, a new run should occur until the user has + made a change in the files. But the user may have corrected an + error in a source .tex file during the run. So latexmk needs to + distinguish user-generated and automatically generated files; it + determines the automatically generated files as those with + extensions in the list in @generated_exts.) + A convenient way to add an extra extension to the list, without + losing the already defined ones is to use a push command in the + line in an RC file. E.g., - 10 January 2015 30 + 5 February 2015 31 -LATEXMK(1L) LATEXMK(1L) - (pdf)LaTeX is needed after a run that gives an error. - (Normally, a change of a source file during a run should provoke - a rerun. This includes a file generated by LaTeX, e.g., an aux - file, that is read in on subsequent runs. But after a run that - results in an error, a new run should occur until the user has - made a change in the files. But the user may have corrected an - error in a source .tex file during the run. So latexmk needs to - distinguish user-generated and automatically generated files; it - determines the automatically generated files as those with - extensions in the list in @generated_exts.) +LATEXMK(1L) LATEXMK(1L) - A convenient way to add an extra extension to the list, without - losing the already defined ones is to use a push command in the - line in an RC file. E.g., push @generated_exts, "end"; - adds the extension "end" to the list of predefined generated - extensions. (This extension is used by the RevTeX package, for + adds the extension "end" to the list of predefined generated + extensions. (This extension is used by the RevTeX package, for example.) $go_mode [0] - If nonzero, process files regardless of timestamps, and is then + If nonzero, process files regardless of timestamps, and is then equivalent to the -g option. %hash_calc_ignore_pattern !!!This variable is for experts only!!! - The general rule latexmk uses for determining when an extra run - of some program is needed is that one of the source files has - changed. But consider for example a latex package that causes - an encapsulated postscript file (an "eps" file) to be made that - is to be read in on the next run. The file contains a comment - line giving its creation date and time. On the next run the - time changes, latex sees that the eps file has changed, and - therefore reruns latex. This causes an infinite loop, that is - only terminated because latexmk has a limit on the number of + The general rule latexmk uses for determining when an extra run + of some program is needed is that one of the source files has + changed. But consider for example a latex package that causes + an encapsulated postscript file (an "eps" file) to be made that + is to be read in on the next run. The file contains a comment + line giving its creation date and time. On the next run the + time changes, latex sees that the eps file has changed, and + therefore reruns latex. This causes an infinite loop, that is + only terminated because latexmk has a limit on the number of runs to guard against pathological situations. But the changing line has no real effect, since it is a comment. @@ -2030,41 +2080,42 @@ LATEXMK(1L) LATEXMK(1L) $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 + 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 + ing a regular expresssion. (See documentation on Perl for how + they are to be specified in general.) This particular regular + expression specifies that lines beginning with "%%CreationDate: + " are to be ignored in deciding whether a file of the given extension .eps has changed. + There is only one regular expression available for each exten- + sion. If you need more one pattern to specify lines to ignore, + then you need to combine the patterns into a single regular + expression. The simplest method is separate the different sim- + ple patterns by a vertical bar character (indicating "alterna- + tion" in the jargon of regular expressions). For example, + $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: + |^%%Title: '; - 10 January 2015 31 + 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 + 5 February 2015 32 -LATEXMK(1L) LATEXMK(1L) - 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. +LATEXMK(1L) LATEXMK(1L) + - 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., @@ -2072,81 +2123,81 @@ LATEXMK(1L) LATEXMK(1L) $kpsewhich ["kpsewhich %S"] - The program called to locate a source file when the name alone - is not sufficient. Most filenames used by latexmk have suffi- - cient path information to be found directly. But sometimes, - notably when .bib files are found from the log file of a bibtex - or biber run, the name of the file, but not its path is known. + The program called to locate a source file when the name alone + is not sufficient. Most filenames used by latexmk have suffi- + cient path information to be found directly. But sometimes, + notably when .bib files are found from the log file of a bibtex + or biber run, the name of the file, but not its path is known. The program specified by $kpsewhich is used to find it. - 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. $landscape_mode [0] If nonzero, run in landscape mode, using the landscape mode pre- - viewers and dvi to postscript converters. Equivalent to the -l + viewers and dvi to postscript converters. Equivalent to the -l option. Normally not needed with current previewers. $latex ["latex %O %S"] The LaTeX processing program. Note that as with other programs, - you can use this variable not just to change the name of the + you can use this variable not just to change the name of the program used, but also specify options to the program. E.g., $latex = "latex --src-specials"; %latex_input_extensions - This variable specifies the extensions tried by latexmk when it - finds that a LaTeX run resulted in an error that a file has not - been found, and the file is given without an extension. This - typically happens when LaTeX commands of the form \input{file} - or \includegraphics{figure}, when the relevant source file does + This variable specifies the extensions tried by latexmk when it + finds that a LaTeX run resulted in an error that a file has not + been found, and the file is given without an extension. This + typically happens when LaTeX commands of the form \input{file} + or \includegraphics{figure}, when the relevant source file does not exist. - In this situation, latexmk searches for custom dependencies to + In this situation, latexmk searches for custom dependencies to + make the missing file(s), but restricts it to the extensions + specified by the variable %latex_input_extensions. The default + extensions are 'tex' and 'eps'. + (For Perl experts: %latex_input_extensions is a hash whose keys + are the extensions. The values are irrelevant.) Two subrou- + tines are provided for manipulating this and the related vari- + able %pdflatex_input_extensions, add_input_ext and + remove_input_ext. They are used as in the following examples + are possible lines in an initialization file: + remove_input_ext( 'latex', 'tex' ); - 10 January 2015 32 + removes the extension 'tex' from latex_input_extensions + 5 February 2015 33 -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'. - (For Perl experts: %latex_input_extensions is a hash whose keys - are the extensions. The values are irrelevant.) Two subrou- - tines are provided for manipulating this and the related vari- - able %pdflatex_input_extensions, add_input_ext and - remove_input_ext. They are used as in the following examples - are possible lines in an initialization file: - remove_input_ext( 'latex', 'tex' ); +LATEXMK(1L) LATEXMK(1L) - removes the extension 'tex' from latex_input_extensions add_input_ext( 'latex', 'asdf' ); - add the extension 'asdf to latex_input_extensions. (Naturally + add the extension 'asdf to latex_input_extensions. (Naturally with such an extension, you should have made an appropriate cus- tom dependency for latexmk, and should also have done the appro- - priate programming in the LaTeX source file to enable the file - to be read. The standard extensions are handled by LaTeX and + priate programming in the LaTeX source file to enable the file + to be read. The standard extensions are handled by LaTeX and its graphics/graphicx packages. $latex_silent_switch ["-interaction=batchmode"] - Switch(es) for the LaTeX processing program when silent mode is + Switch(es) for the LaTeX processing program when silent mode is on. - If you use MikTeX, you may prefer the results if you configure - the options to include -c-style-errors, e.g., by the following + If you use MikTeX, you may prefer the results if you configure + the options to include -c-style-errors, e.g., by the following line in an initialization file $latex_silent_switch = "-interaction=batchmode -c-style- @@ -2156,47 +2207,47 @@ LATEXMK(1L) LATEXMK(1L) $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- - sary because one part of the command name ("Program Files") + 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. + $lpr_dvi ["NONE lpr_dvi"] + The printing program to print dvi files. + $lpr_pdf ["NONE lpr_pdf"] + The printing program to print pdf files. - 10 January 2015 33 + Under MS-Windows you could set this to use gsview, if it is + installed, e.g., + $lpr = '"c:/Program Files/Ghostgum/gsview/gsview32.exe" /p'; + If gsview is installed in a different directory, you will need + to make the appropriate change. Note the double quotes around -LATEXMK(1L) LATEXMK(1L) + 5 February 2015 34 - contains a space which would otherwise be misinterpreted. - $lpr_dvi ["NONE lpr_dvi"] - The printing program to print dvi files. - $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 - installed, e.g., +LATEXMK(1L) LATEXMK(1L) - $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 the name: this is necessary because one part of the command name ("Program Files") contains a space which would otherwise be mis- interpreted. @@ -2210,126 +2261,126 @@ LATEXMK(1L) LATEXMK(1L) The index processing program. $makeindex_silent_switch ["-q"] - Switch(es) for the index processing program when silent mode is + Switch(es) for the index processing program when silent mode is on. $max_repeat [5] - The maximum number of times latexmk will run latex/pdflatex - before deciding that there may be an infinite loop and that it + The maximum number of times latexmk will run latex/pdflatex + before deciding that there may be an infinite loop and that it needs to bail out, rather than rerunning latex/pdflatex again to - resolve cross-references, etc. The default value covers all + resolve cross-references, etc. The default value covers all normal cases. - (Note that the "etc" covers a lot of cases where one run of + (Note that the "etc" covers a lot of cases where one run of latex/pdflatex generates files to be read in on a later run.) $MSWin_back_slash [1] - This configuration variable only has an effect when latexmk is + This configuration variable only has an effect when latexmk is running under MS-Windows. It determines whether, when a command - is executed under MS-Windows, there should be substituted "\" - for the separator character between components of a directory - name. Internally, latexmk uses "/" for the directory separator + is executed under MS-Windows, there should be substituted "\" + for the separator character between components of a directory + name. Internally, latexmk uses "/" for the directory separator character, which is the character used by Unix-like systems. For many programs under MS-Windows, both "\" and "/" are accept- - able as the directory separator character. But some programs - only accept "\". So for safety latexmk makes a translation, by - default. It is conceivable that under certain situations this - is undesirable, so the configuration can be changed. (A + able as the directory separator character. But some programs + only accept "\". So for safety latexmk makes a translation, by + default. It is conceivable that under certain situations this + is undesirable, so the configuration can be changed. (A possi- + ble example might be when some of the software is implemented + using Cygwin, which provides an Unix-like environment inside MS- + Windows.) + $new_viewer_always [0] + This variable applies to latexmk only in continuous-preview + mode. If $new_viewer_always is 0, latexmk will check for a pre- + viously running previewer on the same file, and if one is run- + ning will not start a new one. If $new_viewer_always is non- + zero, this check will be skipped, and latexmk will behave as if + no viewer is running. - 10 January 2015 34 + $out_dir [""] + 5 February 2015 35 -LATEXMK(1L) LATEXMK(1L) - possible example might be when some of the software is imple- - mented using Cygwin, which provides an Unix-like environment - inside MS-Windows.) - $new_viewer_always [0] - This variable applies to latexmk only in continuous-preview - mode. If $new_viewer_always is 0, latexmk will check for a pre- - viously running previewer on the same file, and if one is run- - ning will not start a new one. If $new_viewer_always is non- - zero, this check will be skipped, and latexmk will behave as if - no viewer is running. +LATEXMK(1L) LATEXMK(1L) - $out_dir [""] - If non-blank, this variable specifies the directory in which + If non-blank, this variable specifies the directory in which output files are to be written by a run of (pdf)latex. See also the variable $aux_dir. - The effect of this variable (when non-blank) is achieved by - using the -output-directory option of (pdf)latex. This exists - in the usual current (Dec. 2011 and later) implementations of - TeX, i.e., MiKTeX and TeXLive. But it may not be present in + The effect of this variable (when non-blank) is achieved by + using the -output-directory option of (pdf)latex. This exists + in the usual current (Dec. 2011 and later) implementations of + TeX, i.e., MiKTeX and TeXLive. But it may not be present in other versions. - If you also use the -cd option, and $out_dir (or $aux_dir) con- - tains a relative path, then the path is interpreted relative to + If you also use the -cd option, and $out_dir (or $aux_dir) con- + tains a relative path, then the path is interpreted relative to the document directory. - Commonly, the directory specified for output files is a subdi- + Commonly, the directory specified for output files is a subdi- rectory of the current working directory. However, if you spec- - ify some other directory, e.g., "/tmp/foo" or "../output", be - aware that this could cause problems, e.g., with makeindex or - bibtex. This is because modern versions of these programs, by - default, will refuse to work when they find that they are asked - to write to a file in a directory that appears not to be the + ify some other directory, e.g., "/tmp/foo" or "../output", be + aware that this could cause problems, e.g., with makeindex or + bibtex. This is because modern versions of these programs, by + default, will refuse to work when they find that they are asked + to write to a file in a directory that appears not to be the current working directory or one of its subdirectories. This is - part of security measures by the whole TeX system that try to + part of security measures by the whole TeX system that try to prevent malicious or errant TeX documents from incorrectly mess- ing with a user's files. If for $out_dir or $aux_dir you really - do need to specify an absolute pathname (e.g., "/tmp/foo") or a + do need to specify an absolute pathname (e.g., "/tmp/foo") or a path (e.g., "../output") that includes a higher-level directory, - and you need to use makeindex or bibtex, then you need to dis- - able the security measures (and assume any risks). One way of + and you need to use makeindex or bibtex, then you need to dis- + able the security measures (and assume any risks). One way of doing this is to temporarily set an operating system environment - variable openout_any to "a" (as in "all"), to override the + variable openout_any to "a" (as in "all"), to override the default "paranoid" setting. $pdf_mode [0] - If zero, do NOT generate a pdf version of the document. If - equal to 1, generate a pdf version of the document using pdfla- + If zero, do NOT generate a pdf version of the document. If + equal to 1, generate a pdf version of the document using pdfla- tex. If equal to 2, generate a pdf version of the document from - the ps file, by using the command specified by the $ps2pdf + the ps file, by using the command specified by the $ps2pdf vari- + able. If equal to 3, generate a pdf version of the document + from the dvi file, by using the command specified by the $dvipdf + variable. + Equivalent to the -pdf-, -pdf, -pdfdvi, -pdfps options. - 10 January 2015 35 + $pdflatex ["pdflatex %O %S"] + The LaTeX processing program in a version that makes a pdf file + instead of a dvi file. + An example of the use of this variable is to arrange for luala- + tex, xelatex or some similar program to be used instead of + pdflatex. Note that lualatex and xelatex only produce .pdf + files (and not .dvi), so to use them you will also need to turn + 5 February 2015 36 -LATEXMK(1L) LATEXMK(1L) - variable. If equal to 3, generate a pdf version of the document - from the dvi file, by using the command specified by the $dvipdf - variable. - Equivalent to the -pdf-, -pdf, -pdfdvi, -pdfps options. +LATEXMK(1L) LATEXMK(1L) - $pdflatex ["pdflatex %O %S"] - The LaTeX processing program in a version that makes a pdf file - instead of a dvi file. - An example of the use of this variable is to arrange for luala- - tex, xelatex or some similar program to be used instead of - pdflatex. Note that lualatex and xelatex only produce .pdf - files (and not .dvi), so to use them you will also need to turn - on production of .pdf files, and to turn off the production of + on production of .pdf files, and to turn off the production of .dvi (and .ps) files, either by command line options or by suit- able settings in a configuration file. Thus to use lualatex, the following settings are appropriate: @@ -2342,7 +2393,7 @@ LATEXMK(1L) LATEXMK(1L) $pdflatex = "xelatex %O %S"; $pdf_mode = 1; $postscript_mode = $dvi_mode = 0; - Another use of the same variable is to add certain options to + Another use of the same variable is to add certain options to the command line for the program, e.g., $pdflatex = "pdflatex --shell-escape %O %S"; @@ -2350,56 +2401,57 @@ LATEXMK(1L) LATEXMK(1L) %pdflatex_input_extensions - This variable specifies the extensions tried by latexmk when it - finds that a pdflatex run resulted in an error that a file has - not been found, and the file is given without an extension. - This typically happens when LaTeX commands of the form + This variable specifies the extensions tried by latexmk when it + finds that a pdflatex run resulted in an error that a file has + not been found, and the file is given without an extension. + This typically happens when LaTeX commands of the form \input{file} or \includegraphics{figure}, when the relevant source file does not exist. - In this situation, latexmk searches for custom dependencies to - make the missing file(s), but restricts it to the extensions - specified by the variable %pdflatex_input_extensions. The + In this situation, latexmk searches for custom dependencies to + make the missing file(s), but restricts it to the extensions + specified by the variable %pdflatex_input_extensions. The default extensions are 'tex', 'pdf', 'jpg, and 'png'. - (For Perl experts: %pdflatex_input_extensions is a hash whose - keys are the extensions. The values are irrelevant.) Two sub- - routines are provided for manipulating this and the related - variable %latex_input_extensions, add_input_ext and - remove_input_ext. They are used as in the following examples + (For Perl experts: %pdflatex_input_extensions is a hash whose + keys are the extensions. The values are irrelevant.) Two sub- + routines are provided for manipulating this and the related + variable %latex_input_extensions, add_input_ext and + remove_input_ext. They are used as in the following examples are possible lines in an initialization file: + remove_input_ext( 'pdflatex', 'tex' ); + removes the extension 'tex' from pdflatex_input_extensions - 10 January 2015 36 + add_input_ext( 'pdflatex', 'asdf' ); + add the extension 'asdf to pdflatex_input_extensions. (Natu- + 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.) -LATEXMK(1L) LATEXMK(1L) + 5 February 2015 37 - remove_input_ext( 'pdflatex', 'tex' ); - removes the extension 'tex' from pdflatex_input_extensions - add_input_ext( 'pdflatex', 'asdf' ); - add the extension 'asdf to pdflatex_input_extensions. (Natu- - 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.) + +LATEXMK(1L) LATEXMK(1L) $pdflatex_silent_switch ["-interaction=batchmode"] - Switch(es) for the pdflatex program (specified in the variable + Switch(es) for the pdflatex program (specified in the variable $pdflatex when silent mode is on. - If you use MikTeX, you may prefer the results if you configure - the options to include -c-style-errors, e.g., by the following + If you use MikTeX, you may prefer the results if you configure + the options to include -c-style-errors, e.g., by the following line in an initialization file $latex_silent_switch = "-interaction=batchmode -c-style- @@ -2409,59 +2461,59 @@ LATEXMK(1L) LATEXMK(1L) $pdf_previewer ["start acroread %O %S"] The command to invoke a pdf-previewer. - On MS-WINDOWS, the default is changed to "cmd /c start """; + On MS-WINDOWS, the default is changed to "cmd /c start """; under more recent versions of Windows, this will cause to be run whatever command the system has associated with .pdf files. But - this may be undesirable if this association is to acroread -- + this may be undesirable if this association is to acroread -- see the notes in the explanation of the -pvc option.] - On OS-X the default is changed to "open %S", which results in - OS-X starting up (and detaching) the viewer associated with the - file. By default, for pdf files this association is to OS-X's + On OS-X the default is changed to "open %S", which results in + OS-X starting up (and detaching) the viewer associated with the + file. By default, for pdf files this association is to OS-X's preview, which is quite satisfactory. - WARNING: Problem under MS-Windows: if acroread is used as the - pdf previewer, and it is actually viewing a pdf file, the pdf - file cannot be updated. Thus makes acroread a bad choice of - previewer if you use latexmk's previous-continuous mode (option - -pvc) under MS-windows. This problem does not occur if, for + WARNING: Problem under MS-Windows: if acroread is used as the + pdf previewer, and it is actually viewing a pdf file, the pdf + file cannot be updated. Thus makes acroread a bad choice of + previewer if you use latexmk's previous-continuous mode (option + -pvc) under MS-windows. This problem does not occur if, for example, SumatraPDF or gsview is used to view pdf files. - Important note: Normally you will want to have a previewer run + Important note: Normally you will want to have a previewer run detached, so that latexmk doesn't wait for the previewer to ter- - minate before continuing its work. So normally you should pre- - fix the command by "start ", which flags to latexmk that it - should do the detaching of the previewer itself (by whatever - method is appropriate to the operating system). But sometimes - letting latexmk do the detaching is not appropriate (for a + 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 + in yourself, whenever it is needed. + $pdf_update_command [""] + When the pdf previewer is set to be updated by running a com- + mand, this is the command that is run. See the information for + the variable $pdf_update_method. - 10 January 2015 37 + $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 + 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 + 5 February 2015 38 -LATEXMK(1L) LATEXMK(1L) - variety of non-trivial reasons), so you should put the "start " - bit in yourself, whenever it is needed. +LATEXMK(1L) LATEXMK(1L) - $pdf_update_command [""] - When the pdf previewer is set to be updated by running a com- - mand, this is the command that is run. See the information for - the variable $pdf_update_method. - $pdf_update_method [1 under UNIX, 3 under MS-Windows] - How the pdf viewer updates its display when the pdf file has - changed. See the information on the variable $dvi_update_method - for the codes. (Note that information needs be changed slightly - so that for the value 4, to run a command to do the update, the - command is specified by the variable $pdf_update_command, and - for the value 2, to specify update by signal, the signal is + command is specified by the variable $pdf_update_command, and + for the value 2, to specify update by signal, the signal is specified by $pdf_update_signal.) Note that acroread under MS-Windows (but not UNIX) locks the pdf @@ -2474,84 +2526,83 @@ LATEXMK(1L) LATEXMK(1L) $pdf_update_method = 4; $pdf_update_command = "xpdf -remote %R -reload"; - The first setting arranges for the xpdf program to be used in - its "remote server mode", with the server name specified as the - rootname of the TeX file. The second setting arranges for + The first setting arranges for the xpdf program to be used in + its "remote server mode", with the server name specified as the + rootname of the TeX file. The second setting arranges for updating to be done in response to a command, and the third set- ting sets the update command. - $pdf_update_signal [Under UNIX: SIGHUP, which is a system-dependent + $pdf_update_signal [Under UNIX: SIGHUP, which is a system-dependent value] - The number of the signal that is sent to the pdf viewer when it - is updated by sending a signal -- see the information on the - variable $pdf_update_method. The default value is the one + The number of the signal that is sent to the pdf viewer when it + is updated by sending a signal -- see the information on the + variable $pdf_update_method. The default value is the one appropriate for gv on a UNIX system. $pid_position[1 under UNIX, -1 under MS-Windows] - The variable $pid_position is used to specify which word in - lines of the output from $pscmd corresponds to the process ID. - The first word in the line is numbered 0. The default value of + The variable $pid_position is used to specify which word in + lines of the output from $pscmd corresponds to the process ID. + The first word in the line is numbered 0. The default value of 1 (2nd word in line) is correct for Solaris 2.6 and Linux. Set- - ting the variable to -1 is used to indicate that $pscmd is not + ting the variable to -1 is used to indicate that $pscmd is not to be used. $postscript_mode [0] - If nonzero, generate a postscript version of the document. + If nonzero, generate a postscript version of the document. Equivalent to the -ps option. + If some other request is made for which a postscript file is + needed, then $postscript_mode will be set to 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 + option. Which previewer is run depends on the other settings, + see the command line options -view=, and the variable $view. - - 10 January 2015 38 + $preview_mode [0] + If nonzero, run a previewer to preview the document. Equivalent + to the -pv option. Which previewer is run depends on the other + settings, see the command line options -view=, and the variable + $view. + 5 February 2015 39 -LATEXMK(1L) LATEXMK(1L) - If some other request is made for which a postscript file is - needed, then $postscript_mode will be set to 1. - $preview_continuous_mode [0] - If nonzero, run a previewer to view the document, and continue - running latexmk to keep .dvi up-to-date. Equivalent to the -pvc - option. Which previewer is run depends on the other settings, - see the command line options -view=, and the variable $view. +LATEXMK(1L) LATEXMK(1L) - $preview_mode [0] - If nonzero, run a previewer to preview the document. Equivalent - to the -pv option. Which previewer is run depends on the other - settings, see the command line options -view=, and the variable - $view. $printout_mode [0] - If nonzero, print the document using lpr. Equivalent to the -p + If nonzero, print the document using lpr. Equivalent to the -p option. This is recommended not to be set from an RC file, oth- erwise you could waste lots of paper. $print_type = ["auto"] - Type of file to printout: possibilities are "auto", "dvi", + Type of file to printout: possibilities are "auto", "dvi", "none", "pdf", or "ps". See the option -print= for the meaning of the "auto" value. $pscmd Command used to get all the processes currently run by the user. - The -pvc option uses the command specified by the variable - $pscmd to determine if there is an already running previewer, - and to find the process ID (needed if latexmk needs to signal + The -pvc option uses the command specified by the variable + $pscmd to determine if there is an already running previewer, + and to find the process ID (needed if latexmk needs to signal the previewer about file changes). Each line of the output of this command is assumed to correspond - to one process. See the $pid_position variable for how the + to one process. See the $pid_position variable for how the process number is determined. - The default for pscmd is "NONE" under MS-Windows and cygwin + The default for pscmd is "NONE" under MS-Windows and cygwin (i.e., the command is not used), "ps --width 200 -f -u - $ENV{USER}" under linux, "ps -ww -u $ENV{USER}" under darwin - (Macintosh OS-X), and "ps -f -u $ENV{USER}" under other operat- - ing systems (including other flavors of UNIX). In these speci- + $ENV{USER}" under linux, "ps -ww -u $ENV{USER}" under darwin + (Macintosh OS-X), and "ps -f -u $ENV{USER}" under other operat- + ing systems (including other flavors of UNIX). In these speci- fications "$ENV{USER}" is substituted by the username. $ps2pdf ["ps2pdf %O %S %D"] @@ -2559,69 +2610,70 @@ LATEXMK(1L) LATEXMK(1L) $ps_filter [empty] The postscript file filter to be run on the newly produced post- - script file before other processing. Equivalent to specifying + script file before other processing. Equivalent to specifying the -pF option. $ps_previewer ["start gv %O %S", but start %O %S under MS-WINDOWS] - The command to invoke a ps-previewer. (The default under MS- - WINDOWS will cause to be run whatever command the system has + The command to invoke a ps-previewer. (The default under MS- + WINDOWS will cause to be run whatever command the system has associated with .ps files.) + Note that gv could be used with the -watch option updates its + display whenever the postscript file changes, whereas ghostview + does not. However, different versions of gv have slightly dif- + ferent ways of writing this option. You can configure this + variable appropriately. + WARNING: Linux systems may have installed one (or more) versions + of gv under different names, e.g., ggv, kghostview, etc, but + perhaps not one called gv. - 10 January 2015 39 + 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 + 5 February 2015 40 -LATEXMK(1L) LATEXMK(1L) - Note that gv could be used with the -watch option updates its - display whenever the postscript file changes, whereas ghostview - does not. However, different versions of gv have slightly dif- - ferent ways of writing this option. You can configure this - variable appropriately. - WARNING: Linux systems may have installed one (or more) versions - of gv under different names, e.g., ggv, kghostview, etc, but - perhaps not one called gv. +LATEXMK(1L) LATEXMK(1L) - 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 + + 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. - $ps_previewer_landscape ["start gv -swap %O %S", but start %O %S under + $ps_previewer_landscape ["start gv -swap %O %S", but start %O %S under MS-WINDOWS] The command to invoke a ps-previewer in landscape mode. $ps_update_command [""] - When the postscript previewer is set to be updated by running a - command, this is the command that is run. See the information + When the postscript previewer is set to be updated by running a + command, this is the command that is run. See the information for the variable $ps_update_method. $ps_update_method [0 under UNIX, 1 under MS-Windows] - How the postscript viewer updates its display when the ps file - has changed. See the information on the variable - $dvi_update_method for the codes. (Note that information needs + How the postscript viewer updates its display when the ps file + has changed. See the information on the variable + $dvi_update_method for the codes. (Note that information needs be changed slightly so that for the value 4, to run a command to do the update, the command is specified by the variable - $ps_update_command, and for the value 2, to specify update by + $ps_update_command, and for the value 2, to specify update by signal, the signal is specified by $ps_update_signal.) - $ps_update_signal [Under UNIX: SIGHUP, which is a system-dependent + $ps_update_signal [Under UNIX: SIGHUP, which is a system-dependent value] - The number of the signal that is sent to the pdf viewer when it - is updated by sending a signal -- see $ps_update_method. The + The number of the signal that is sent to the pdf viewer when it + is updated by sending a signal -- see $ps_update_method. The default value is the one appropriate for gv on a UNIX system. @@ -2632,128 +2684,129 @@ LATEXMK(1L) LATEXMK(1L) $quote_filenames [1] This specifies whether substitutions for placeholders in command + specifications (as in $pdflatex) are surrounded by double + quotes. If this variable is 1 (or any other value Perl regards + as true), then quoting is done. Otherwise quoting is omitted. + The quoting method used by latexmk is tested to work correctly + under UNIX systems (including Linux and Mac OS-X) and under MS- + Windows. It allows the use of filenames containing special + characters, notably spaces. (But note that many versions of + LaTeX and PdfLaTeX cannot correctly deal with TeX files whose + names contain spaces. Latexmk's quoting only ensures that such + filenames are correctly treated by the operating system in pass- + ing arguments to programs.) - 10 January 2015 40 + 5 February 2015 41 -LATEXMK(1L) LATEXMK(1L) - specifications (as in $pdflatex) are surrounded by double - quotes. If this variable is 1 (or any other value Perl regards - as true), then quoting is done. Otherwise quoting is omitted. - The quoting method used by latexmk is tested to work correctly - under UNIX systems (including Linux and Mac OS-X) and under MS- - Windows. It allows the use of filenames containing special - characters, notably spaces. (But note that many versions of - LaTeX and PdfLaTeX cannot correctly deal with TeX files whose - names contain spaces. Latexmk's quoting only ensures that such - filenames are correctly treated by the operating system in pass- - ing arguments to programs.) +LATEXMK(1L) LATEXMK(1L) + $recorder [0] - 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- + 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 + It is generally recommended to use this option (or to configure + the $recorder variable to be on.) But it only works if (pdf)latex supports the -recorder option, which is true for most current implementations - 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, + 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. $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 - communicate appropriately modified search paths to $bibtex, + INPUTS, BIBINPUTS, and BSTINPUTS. This variable is mainly used + by latexmk when the -outdir, -output-directory, -auxdir, and/or + -aux-directory options are used. In that case latexmk needs to + communicate appropriately modified search paths to $bibtex, dvipdf, dvips, and (pdf)latex. - [Comment to technically savvy readers: (pdf)latex doesn't actu- - ally need the modified search path, because it corrects it - internally. But, surprisingly, dvipdf and dvips do, because - sometimes graphics files get generated in the output or aux + [Comment to technically savvy readers: (pdf)latex doesn't actu- + ally need the modified search path, because it corrects it + internally. 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 + The default under MSWin and Cygwin is ';' and under UNIX-like + operating systems (including Linux and OS-X) is ':'. Normally + the defaults give correct behavior. But there can be difficul- + ties if your operating system is of one kind, but some of your + software is running under an emulator for the other kind of + operating system; in that case you'll need to find out what is + needed, and set $search_path_separator explicitly. (The same + goes, of course, for unusual operating systems that are not in + the MSWin, Linux, OS-X, Unix collection.) + $silence_logfile_warnings [0] + Whether after a run of (pdf)latex to summarize warnings in the + log file about undefined citations and references. Setting + $silence_logfile_warnings=0 gives the summary of warnings (pro- + vided silent mode isn't also set), and this is useful to locate + undefined citations and references without searching through the - 10 January 2015 41 + 5 February 2015 42 -LATEXMK(1L) LATEXMK(1L) - software is running under an emulator for the other kind of - operating system; in that case you'll need to find out what is - needed, and set $search_path_separator explicitly. (The same - goes, of course, for unusual operating systems that are not in - the MSWin, Linux, OS-X, Unix collection.) +LATEXMK(1L) LATEXMK(1L) - $silence_logfile_warnings [0] - Whether after a run of (pdf)latex to summarize warnings in the - log file about undefined citations and references. Setting - $silence_logfile_warnings=0 gives the summary of warnings (pro- - vided silent mode isn't also set), and this is useful to locate - undefined 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 + much more verbose log file or the screen output of (pdf)latex. + But the summary can also be excessively annoying. The default + is not to give these warnings. The command line options -silence_logfile_warning_list and -silence_logfile_warning_list- also set this variable. - Note that multiple occurrences for the same undefined object on + Note that multiple occurrences for the same undefined object on the same page and same line will be compressed to a single warn- ing. $silent [0] - Whether to run silently. Setting $silent to 1 has the same + Whether to run silently. Setting $silent to 1 has the same effect as the -quiet of -silent options on the command line. $sleep_time [2] - The time to sleep (in seconds) between checking for source file + The time to sleep (in seconds) between checking for source file changes when running with the -pvc option. This is subject to a - minimum of one second delay, except that zero delay is also + minimum of one second delay, except that zero delay is also allowed. - A value of exactly 0 gives no delay, and typically results in + 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". @@ -2763,60 +2816,60 @@ LATEXMK(1L) LATEXMK(1L) $tmpdir [See below for default] - Directory to store temporary files that latexmk may generate + Directory to store temporary files that latexmk may generate + while running. + The default under MSWindows (including cygwin), is to set + $tmpdir to the value of the first of whichever of the system + environment variables TMPDIR or TEMP exists, otherwise to the + current directory. Under other operating systems (expected to + be UNIX/Linux, including OS-X), the default is the value of the + system environment variable TMPDIR if it exists, otherwise + "/tmp". + $use_make_for_missing_files [0] + Whether to use make to try and make files that are missing after + a run of latex or pdflatex, and for which a custom dependency - 10 January 2015 42 + 5 February 2015 43 -LATEXMK(1L) LATEXMK(1L) - while running. +LATEXMK(1L) LATEXMK(1L) - The default under MSWindows (including cygwin), is to set - $tmpdir to the value of the first of whichever of the system - environment variables TMPDIR or TEMP exists, otherwise to the - current directory. Under other operating systems (expected to - be UNIX/Linux, including OS-X), the default is the value of the - system environment variable TMPDIR if it exists, otherwise - "/tmp". - $use_make_for_missing_files [0] - Whether to use make to try and make files that are missing after - a run of latex or pdflatex, and for which a custom dependency - has not been found. This is generally useful only when latexmk - is used as part of a bigger project which is built by using the + 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). 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. - The old method of configuring latexmk was to directly manipulate the - @cus_dep_list array that contains information defining the custom - dependencies. This method still works. But now there are subroutines - that allow convenient manipulations of the custom dependency list. + The old method of configuring latexmk was to directly manipulate the + @cus_dep_list array that contains information defining the custom + dependencies. This method still works. But now there are subroutines + that allow convenient manipulations of the custom dependency list. These are add_cus_dep( fromextension, toextension, must, subroutine ) @@ -2827,55 +2880,55 @@ CUSTOM DEPENDENCIES follow: from extension: - The extension of the file we are converting from (e.g. "fig"). + The extension of the file we are converting from (e.g. "fig"). It is specified without a period. + to extension: + The extension of the file we are converting to (e.g. "eps"). It + is specified without a period. + must: If non-zero, the file from which we are converting must exist, + if it doesn't exist latexmk will give an error message and exit + unless the -f option is specified. If must is zero and the file + we are converting from doesn't exist, then no action is taken. + 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. - 10 January 2015 43 + 5 February 2015 44 -LATEXMK(1L) LATEXMK(1L) - to extension: - The extension of the file we are converting to (e.g. "eps"). It - is specified without a period. +LATEXMK(1L) LATEXMK(1L) - 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. - 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 + 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. - It is invoked whenever latexmk detects that a run of latex/pdflatex - needs to read a file, like a graphics file, whose extension is the to- + It is invoked whenever latexmk detects that a run of latex/pdflatex + needs to read a file, like a graphics file, whose extension is the to- extension of a custom dependency. Then latexmk examines whether a file - exists with the same name, but with the 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 + 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 + 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 other item in each custom-dependency rule labeled "must" above - specifies how the rule should be applied when the source file fails to + One other item in each custom-dependency rule labeled "must" above + specifies how the rule should be applied when the source file fails to exist. A simple and typical example of code in an initialization rcfile is @@ -2885,44 +2938,44 @@ LATEXMK(1L) LATEXMK(1L) system( "fig2dev -Leps \"$_[0].fig\" \"$_[0].eps\"" ); } - The first line adds a custom dependency that converts a file with - extension "fig", as created by the xfig program, to an encapsulated - postscript file, with extension "eps". The remaining lines define a - subroutine that carries out the conversion. If a rule for converting - "fig" to "eps" files already exists (e.g., from a previously read-in - initialization file), the latexmk will delete this rule before making + The first line adds a custom dependency that converts a file with + extension "fig", as created by the xfig program, to an encapsulated + postscript file, with extension "eps". The remaining lines define a + subroutine that carries out the conversion. If a rule for converting + "fig" to "eps" files already exists (e.g., from a previously read-in + initialization file), the latexmk will delete this rule before making the new one. - Suppose latexmk is using this rule to convert a file "figure.fig" to - "figure.eps". Then it will invoke the fig2eps subroutine defined in - the above code with a single argument "figure", which is the basename + 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. - 10 January 2015 44 + 5 February 2015 45 -LATEXMK(1L) LATEXMK(1L) - 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. +LATEXMK(1L) LATEXMK(1L) - If the return value of the subroutine is non-zero, then latexmk will - assume an error occurred during the execution of the subroutine. In - the above example, no explicit return value is given, and instead the - return value is the value returned by the last (and only) statement, - i.e., the invocation of system, which returns the value 0 on success. - If you use pdflatex instead of latex, then you will probably prefer to - convert your graphics files to pdf format, in which case you would + If you use pdflatex instead of latex, then you will probably prefer to + convert your graphics files to pdf format, in which case you would replace the above code in an initialization file by add_cus_dep( 'fig', 'pdf, 0, 'fig2pdf' ); @@ -2930,42 +2983,55 @@ LATEXMK(1L) LATEXMK(1L) system( "fig2dev -Lpdf \"$_[0].fig\" \"$_[0].pdf\"" ); } - Note 1: In the command lines given in the system commands in the above - examples, double quotes have been inserted around the file names - (implemented by '\"' in the Perl language). They immunize the running - of the program against special characters in filenames. Very often - these quotes are not necessary, i.e., they can be omitted. But it is + Note 1: In the command lines given in the system commands in the above + examples, double quotes have been inserted around the file names + (implemented by '\"' in the Perl language). They immunize the running + of the program against special characters in filenames. Very often + these quotes are not necessary, i.e., they can be omitted. But it is normally safer to keep them in. Even though the rules for quoting vary - between operating systems, command shells and individual pieces of + between operating systems, command shells and individual pieces of software, the quotes in the above examples do not cause problems in the cases I have tested. - Note 2: One case in which the quotes are important is when the files - are in a subdirectory and your operating system is Microsoft Windows. - Then the separator character for directory components can be either a - forward slash '/' or Microsoft's more usual backward slash '\'. For- - ward slashes are generated by latexmk, to maintain its sanity from - software like MiKTeX that mixes both directory separators; but their + Note 2: One case in which the quotes are important is when the files + are in a subdirectory and your operating system is Microsoft Windows. + Then the separator character for directory components can be either a + forward slash '/' or Microsoft's more usual backward slash '\'. For- + ward slashes are generated by latexmk, to maintain its sanity from + software like MiKTeX that mixes both directory separators; but their correct use normally requires quoted filenames. (See a log file from a - run of MiKTeX (at least in v. 2.9) for an example of the use of both + run of MiKTeX (at least in v. 2.9) for an example of the use of both directory separators.) - If you have some general custom dependencies defined in the system or - user initialization file, you may find that for a particular project - they are undesirable. So you might want to delete the unneeded ones. + If you have some general custom dependencies defined in the system or + user initialization file, you may find that for a particular project + they are undesirable. So you might want to delete the unneeded ones. For example, you remove any "fig" to "eps" rule by the line remove_cus_dep( 'fig', 'eps' ); - If you have complicated sets of custom dependencies, you may want to - get a listing of the custom dependencies. This is done by using the + If you have complicated sets of custom dependencies, you may want to + get a listing of the custom dependencies. This is done by using the line show_cus_dep(); + in an initialization file. + + Another example of a custom dependency overcomes a limitation of + latexmk concerning index files. The only index-file conversion built- + in to latexmk is from an ".idx" file written on one run of latex/pdfla- + tex to an ".ind" file to be read in on a subsequent run. But with the + index.sty package 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{spe- + cial}{ndx}{nnd}{Special index}" you will need to convert files with the + extension .ndx to .nnd. The following lines in an initialization RC + - 10 January 2015 45 + 5 February 2015 46 @@ -2974,18 +3040,6 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - in an initialization file. - - Another example of a custom dependency overcomes a limitation of - latexmk concerning index files. The only index-file conversion built- - in to latexmk is from an ".idx" file written on one run of latex/pdfla- - tex to an ".ind" file to be read in on a subsequent run. But with the - index.sty package 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{spe- - cial}{ndx}{nnd}{Special index}" you will need to convert files with the - extension .ndx to .nnd. The following lines in an initialization RC file will cause this to happen: add_cus_dep('ndx', 'nnd', 0, 'makendx2nnd'); @@ -2993,100 +3047,101 @@ LATEXMK(1L) LATEXMK(1L) system( "makeindex -o \"$_[0].nnd\" \"$_[0].ndx\"" ); } - (You will need to modify this code if you use filenames with spaces in + (You will need to modify this code if you use filenames with spaces in them, to provide correct quoting of the filenames.) - Those of you with experience with Makefiles, will undoubtedly be con- + 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 - be perpetually out-of-date. This situation, of circular dependencies, + 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 latexmk in its current version works correctly - with circular dependencies. It examines the contents of the files (by - use of an md5 checksum), and only does a remake when the file contents + with circular dependencies. It examines the contents of the files (by + use of an md5 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 and .aux - file, etc) that changes on each new run, then you will have a problem. - For real experts: See the %hash_cal_ignore_pattern if you have to deal + Of course if you choose to write random data to the .nnd (or and .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. Glossaries can be dealt with similarly. 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- + 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 sepa- - rated by a space, the from-extension, the to-extension, the "must" - item, and the name of the subroutine for the custom dependency. These + strings, and each string in the array has four items in it, each sepa- + rated by a space, the from-extension, the to-extension, the "must" + item, and the name of the subroutine for the custom dependency. These were all defined above. An example of the old method of defining custom dependencies is as fol- - lows. It is the code in an RC file to ensure automatic conversion of + lows. It is the code in an RC file to ensure automatic conversion of .fig files to .eps files: push @cus_dep_list, "fig eps 0 fig2eps"; sub fig2eps { + system( "fig2dev -Lps \"$_[0].fig\" \"$_[0].eps\"" ); + } + This method still works, and is equivalent to the earlier code using + the add_cus_dep subroutine, except that it doesn't delete any previous + custom-dependency for the same conversion. So the new method is + preferable. - 10 January 2015 46 -LATEXMK(1L) LATEXMK(1L) + + 5 February 2015 47 - system( "fig2dev -Lps \"$_[0].fig\" \"$_[0].eps\"" ); - } - This method still works, and is equivalent to the earlier code using - the add_cus_dep subroutine, except that it doesn't delete any previous - custom-dependency for the same conversion. So the new method is - preferable. +LATEXMK(1L) LATEXMK(1L) USING latexmk WITH make - This section is targeted only at advanced users who use the make pro- + This section is targeted only at advanced users who use the make pro- gram for complex projects, as for software development, with the depen- dencies specified by a Makefile. - Now the basic task of latexmk is to run the appropriate programs to - make a viewable version of a LaTeX document. However, the usual make - program is not suited to this purpose for at least two reasons. First + Now the basic task of latexmk is to run the appropriate programs to + make a viewable version of a LaTeX document. However, the usual make + program is not suited to this purpose for at least two reasons. First is that the use of LaTeX involves circular dependencies (e.g., via .aux files), and these cannot be handled by the standard make program. Sec- - ond is that in a large document the set of source files can change - quite frequently, particularly with included graphics files; in this - situation keeping a Makefile manually updated is inappropriate and - error-prone, especially when the dependencies can be determined auto- + ond is that in a large document the set of source files can change + quite frequently, particularly with included graphics files; in this + situation keeping a Makefile manually updated is inappropriate and + error-prone, especially when the dependencies can be determined auto- matically. Latexmk solves both of these problems robustly. - Thus for many standard LaTeX documents latexmk can be used by itself - without the make program. In a complex project it simply needs to be - suitably configured. A standard configuration would be to define cus- - tom dependencies to make graphics files from their source files (e.g., - as created by the xfig program). Custom dependencies are latexmk's + Thus for many standard LaTeX documents latexmk can be used by itself + without the make program. In a complex project it simply needs to be + suitably configured. A standard configuration would be to define cus- + tom dependencies to make graphics files from their source files (e.g., + as created by the xfig program). Custom dependencies are latexmk's equivalent of pattern rules in Makefiles. - Nevertheless there are projects for which a Makefile is appropriate, + Nevertheless there are projects for which a Makefile is appropriate, and it is useful to know how to use latexmk from a Makefile. A typical - example would be to generate documentation for a software project. - Potentially the interaction with the rest of the rules in the Makefile + example would be to generate documentation for a software project. + Potentially the interaction with the rest of the rules in the Makefile could be quite complicated, for example if some of the source files for a LaTeX document are generated by the project's software. In this section, I give a couple of examples of how latexmk can be use- - fully invoked from a Makefile. The examples use specific features of - current versions of GNU make, which is the default on both linux and + fully invoked from a Makefile. The examples use specific features of + current versions of GNU make, which is the default on both linux and OS-X systems. They may need modifications for other versions of make. - The simplest method is simply to delegate all the relevant tasks to + The simplest method is simply to delegate all the relevant tasks to latexmk, as is suitable for a straightforward LaTeX document. For this a suitable Makefile is like @@ -3095,44 +3150,45 @@ USING latexmk WITH make %.pdf : %.tex FORCE_MAKE latexmk -pdf -dvi- -ps- $< + (Note: the last line must be introduced by a tab for the Makefile to + function correctly!) Naturally, if making try.pdf from its associated + LaTeX file try.tex were the only task to be performed, a direct use of + latexmk without a Makefile would normally be better. The benefit of + using a Makefile for a LaTeX document would be in a larger project, + where lines such as the above would be only be a small part of a larger + Makefile. + The above example has a pattern rule for making a .pdf file from a .tex + file, and it is defined to use latexmk in the obvious way. There is a - 10 January 2015 47 + 5 February 2015 48 -LATEXMK(1L) LATEXMK(1L) - (Note: the last line must be introduced by a tab for the Makefile to - function correctly!) Naturally, if making try.pdf from its associated - LaTeX file try.tex were the only task to be performed, a direct use of - latexmk without a Makefile would normally be better. The benefit of - using a Makefile for a LaTeX document would be in a larger project, - where lines such as the above would be only be a small part of a larger - Makefile. +LATEXMK(1L) LATEXMK(1L) + - 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 conventional default target named "all", with a prerequisite of - try.pdf. So when make is invoked, by default it makes try.pdf. The - only complication is that there may be many source files beyond + try.pdf. So when make is invoked, by default it makes try.pdf. The + only complication is that there may be many source files beyond try.tex, but these aren't specified in the Makefile, so changes in them - will not by themselves cause latexmk to be invoked. Instead, the pat- - tern rule is equipped with a "phony" prerequisite FORCE_MAKE; this has - the effect of causing the rule to be always out-of-date, so that - latexmk is always run. It is latexmk that decides whether any action - is needed, e.g., a rerun of pdflatex. Effectively the Makefile dele- + will not by themselves cause latexmk to be invoked. Instead, the pat- + tern rule is equipped with a "phony" prerequisite FORCE_MAKE; this has + the effect of causing the rule to be always out-of-date, so that + latexmk is always run. It is latexmk that decides whether any action + is needed, e.g., a rerun of pdflatex. Effectively the Makefile dele- gates all decisions to latexmk, while make has no knowledge of the list - of source files except for primary LaTeX file for the document. If - there are, for example, graphics files to be made, these must be made + of source files except for primary LaTeX file for the document. If + there are, for example, graphics files to be made, these must be made by custom dependencies configured in latexmk. - But something better is needed in more complicated situations, for - example, when the making of graphics files needs to be specified by - rules in the Makefile. To do this, one can use a Makefile like the + But something better is needed in more complicated situations, for + example, when the making of graphics files needs to be specified by + rules in the Makefile. To do this, one can use a Makefile like the following: TARGETS = document1.pdf document2.pdf @@ -3151,19 +3207,29 @@ LATEXMK(1L) LATEXMK(1L) %.pdf : %.fig fig2dev -Lpdf $< $@ - (Again, the lines containing the commands for the rules should be + (Again, the lines containing the commands for the rules should be started with tabs.) This example was inspired by how GNU automake han- dles automatic dependency tracking of C source files. - After each run of latexmk, dependency information is put in a file in - the .deps subdirectory. The Makefile causes these dependency files to + After each run of latexmk, dependency information is put in a file in + the .deps subdirectory. The Makefile causes these dependency files to be read by make, which now has the full dependency information for each - target .pdf file. To make things less trivial it is specificed that - two files document1.pdf and document2.pdf are the targets. The + target .pdf file. To make things less trivial it is specificed that + two files document1.pdf and document2.pdf are the targets. The depen- + dency files are .deps/document1.pdfP and .deps/document2.pdfP. + + There is now no need for the phony prerequisite for the rule to make + .pdf files from .tex files. But I have added a rule to make .pdf files + from .fig files produced by the xfig program; these are commonly used + for graphics insertions in LaTeX documents. Latexmk is arranged to + output a dependency file after each run. It is given the -recorder + option, which improves its detection of files generated during a run of + pdflatex; such files should not be in the dependency list. The -e + options are used to turn off all custom dependencies, and to document - 10 January 2015 48 + 5 February 2015 49 @@ -3172,28 +3238,18 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - dependency files are .deps/document1.pdfP and .deps/document2.pdfP. - - There is now no need for the phony prerequisite for the rule to make - .pdf files from .tex files. But I have added a rule to make .pdf files - from .fig files produced by the xfig program; these are commonly used - for graphics insertions in LaTeX documents. Latexmk is arranged to - output a dependency file after each run. It is given the -recorder - option, which improves its detection of files generated during a run of - pdflatex; such files should not be in the dependency list. The -e - options are used to turn off all custom dependencies, and to document - this. Instead the -use-make is used to delegate the making of missing + this. Instead the -use-make is used to delegate the making of missing files to make itself. - Suppose in the LaTeX file there is a command \includegraphics{graph}, - and an xfig file "graph.fig" exists. On a first run, pdflatex reports - a missing file, named "graph". Latexmk succeeds in making "graph.pdf" + Suppose in the LaTeX file there is a command \includegraphics{graph}, + and an xfig file "graph.fig" exists. On a first run, pdflatex reports + a missing file, named "graph". Latexmk succeeds in making "graph.pdf" by calling "make graph.pdf", and after completion of its work, it lists "fig.pdf" among the dependents of the file latexmk is making. Then let - "fig.fig" be updated, and then let make be run. Make first remakes + "fig.fig" be updated, and then let make be run. Make first remakes "fig.pdf", and only then reruns latexmk. - Thus we now have a method by which all the subsidiary processing is + Thus we now have a method by which all the subsidiary processing is delegated to make. @@ -3202,34 +3258,44 @@ SEE ALSO BUGS Sometimes a viewer (gv) tries to read an updated .ps or .pdf file after - its creation is started but before the file is complete. Work around: + its creation is started but before the file is complete. Work around: manually refresh (or reopen) display. Or use one of the other preview- ers and update methods. - (The following isn't really a bug, but concerns features of preview- - ers.) Preview continuous mode only works perfectly with certain pre- - viewers: Xdvi on UNIX/LINUX works for dvi files. Gv on UNIX/LINUX - works for both postscript and pdf. Ghostview on UNIX/LINUX needs a - manual update (reopen); it views postscript and pdf. Gsview under MS- - Windows works for both postscript and pdf, but only reads the updated - file when its screen is refreshed. Acroread under UNIX/LINUX views - pdf, but the file needs to be closed and reopened to view an updated - version. Under MS-Windows, acroread locks its input file and so the - pdf file cannot be updated. (Remedy: configure latexmk to use suma- + (The following isn't really a bug, but concerns features of preview- + ers.) Preview continuous mode only works perfectly with certain pre- + viewers: Xdvi on UNIX/LINUX works for dvi files. Gv on UNIX/LINUX + works for both postscript and pdf. Ghostview on UNIX/LINUX needs a + manual update (reopen); it views postscript and pdf. Gsview under MS- + Windows works for both postscript and pdf, but only reads the updated + file when its screen is refreshed. Acroread under UNIX/LINUX views + pdf, but the file needs to be closed and reopened to view an updated + version. Under MS-Windows, acroread locks its input file and so the + pdf file cannot be updated. (Remedy: configure latexmk to use suma- trapdf instead.) THANKS TO - Authors of previous versions. Many users with their feedback, and - especially David Coppit (username david at node coppit.org) who made - many useful suggestions that contributed to version 3, and Herbert - Schulz. (Please note that the e-mail addresses are not written in + Authors of previous versions. Many users with their feedback, and + especially David Coppit (username david at node coppit.org) who made + many useful suggestions that contributed to version 3, and Herbert + Schulz. (Please note that the e-mail addresses are not written in their standard form to avoid being harvested by worms and viruses.) +AUTHOR + Current version, by John Collins (username jcc8 at node psu.edu). + (Version 4.43a). + + Released version can be obtained from CTAN: <http://www.ctan.org/tex- + archive/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) - 10 January 2015 49 + + 5 February 2015 50 @@ -3238,15 +3304,7 @@ THANKS TO LATEXMK(1L) LATEXMK(1L) -AUTHOR - Current version, by John Collins (username jcc8 at node psu.edu). - (Version 4.42). - Released version can be obtained from CTAN: <http://www.ctan.org/tex- - archive/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) @@ -3295,6 +3353,14 @@ AUTHOR - 10 January 2015 50 + + + + + + + + + 5 February 2015 51 diff --git a/Master/texmf-dist/scripts/latexmk/latexmk.pl b/Master/texmf-dist/scripts/latexmk/latexmk.pl index 20624bc554b..caa11ceed0e 100755 --- a/Master/texmf-dist/scripts/latexmk/latexmk.pl +++ b/Master/texmf-dist/scripts/latexmk/latexmk.pl @@ -112,8 +112,8 @@ use warnings; $my_name = 'latexmk'; $My_name = 'Latexmk'; -$version_num = '4.42'; -$version_details = "$My_name, John Collins, 10 January 2015"; +$version_num = '4.43a'; +$version_details = "$My_name, John Collins, 5 February 2015"; use Config; use File::Basename; @@ -186,6 +186,14 @@ else { ## ## 12 Jan 2012 STILL NEED TO DOCUMENT some items below ## +## 5 Feb 2015 John Collins Deletion of synctex.gz file is with full clean +## (-C option), not with the small clean (-c) +## 27 Jan 2015 John Collins Comments added. +## 25,26 Jan 2015 John Collins Complete MiKTeX fix. +## 16 Jan 2015 John Collins V. 4.43 +## Try to fix issues caused +## by MiKTeX's absolute pathnames in +## .fls and .log file ## 10 Jan 2015 John Collins Fix -cd-associated bugs ## 9 Jan 2015 John Collins V. 4.42 ## Add missfont.log and synctex.gz to cleaned @@ -2278,7 +2286,7 @@ foreach $filename ( @file_list ) show_array( " Yet other generated files:\n", keys %generated_exts_all ); } - &cleanup1( $aux_dir1, $fdb_ext, 'blg', 'ilg', 'log', 'aux.bak', 'idx.bak', 'synctex.gz', + &cleanup1( $aux_dir1, $fdb_ext, 'blg', 'ilg', 'log', 'aux.bak', 'idx.bak', split('\s+',$clean_ext), keys %generated_exts_all ); @@ -2295,7 +2303,7 @@ foreach $filename ( @file_list ) &cleanup_cusdep_generated; } if ( $cleanup_mode == 1 ) { - &cleanup1( $out_dir1, 'dvi', 'dviF', 'ps', 'psF', 'pdf', + &cleanup1( $out_dir1, 'dvi', 'dviF', 'ps', 'psF', 'pdf', 'synctex.gz', split('\s+', $clean_full_ext) ); } @@ -3815,6 +3823,24 @@ sub parse_log { %conversions = (); @missing_subdirs = (); + + # Filenames given in log file may be preceded by a pathname + # denoting current directory. In MiKTeX, this is an absolute + # pathname; in TeXLive, it is './'. Either way, we'll want to + # remove this pathname string --- see the comments in sub + # rdb_set_latex_deps. In order of reliability for use in + # normalizing filenames from the log file, the following forms + # of the cwd are used: + # (a) internally deduced pwd from log file from sequence of lines + # **file + # (dir/file + # if possible + # (b) from PWD line in fls file (if available), passed as $pwd_latex + # (c) system-given cwd as interpreted by sub good_cwd. + # We'll put the first two in @pwd_log + my @pwd_log = (); + if ($pwd_latex) { push @pwd_log, $pwd_latex; } + # $primary_out is actual output file (dvi or pdf) # It is initialized before the call to this routine, to ensure # a sensible default in case of misparsing @@ -3860,6 +3886,9 @@ sub parse_log { # are always terminated by non-block line, rather than eof. my $line = 0; + my $state = 0; # 0 => before ** line, + # 1 => after **filename line, before next line (first file-reading line) + # 2 => pwd_log determined. # For parsing multiple line blocks of info my $current_pkg = ""; # non-empty string for package name, if in # middle of parsing multi-line block of form: @@ -3912,6 +3941,31 @@ LINE: return 0; } } + + if ( ($state == 0) && /^\*\*(.*)$/ ) { + # Line containing first line specified to tex + # It's either a filename or a command starting with \ + my $first = $1; + $state = 1; + if ( ! /^\\/ ) { + $source_log = $first; + if ( -e "$source_log.tex" ) { $source_log .= '.tex'; } + } + else { + $state = 2; + } + next LINE; + } + elsif ( $state == 1 ) { + $state = 2; + if ( m{^\("([^"]*)[/\\]\Q$source_log\E"} ) { + unshift @pwd_log, $1; + } + elsif ( m{^\((.*)[/\\]\Q$source_log\E} ) { + unshift @pwd_log, $1; + } + } + if ( $block_type ) { # In middle of parsing block if ( /^\($current_pkg\)/ ) { @@ -3919,7 +3973,7 @@ LINE: if ( ($block_type eq 'conversion') && /^\($current_pkg\)\s+Output file: <([^>]+)>/ ) { - $delegated_output = normalize_clean_filename($1); + $delegated_output = normalize_clean_filename($1, @pwd_log); } next LINE; } @@ -3968,7 +4022,7 @@ print "=== $delegated_source -> $delegated_output\n"; next LINE; } elsif ( /^Output written on\s+(.*)\s+\(\d+\s+page/ ) { - $primary_out = normalize_clean_filename($1); + $primary_out = normalize_clean_filename($1, @pwd_log); warn "$My_name: Log file says output to '$primary_out'\n" unless $silent; next LINE; @@ -3992,8 +4046,8 @@ print "=== $delegated_source -> $delegated_output\n"; elsif ( /^Package (\S+) Info: Source file: <([^>]+)>/ ) { # Info. produced by epstopdf (and possibly others) # about file conversion - $current_pkg = normalize_clean_filename($1); - $delegated_source = normalize_clean_filename($2); + $current_pkg = normalize_clean_filename($1, @pwd_log); + $delegated_source = normalize_clean_filename($2, @pwd_log); $block_type = 'conversion'; next LINE; } @@ -4063,7 +4117,7 @@ print "=== $delegated_source -> $delegated_output\n"; my $file = clean_filename($1); warn "$My_name: Missing input file: '$file' from line\n '$_'\n" unless $silent; - $dependents{normalize_filename($file)} = 0; + $dependents{normalize_filename($file, @pwd_log)} = 0; my $file1 = $file; if ( $aux_dir ) { # Allow for the possibility that latex generated @@ -4081,7 +4135,7 @@ print "=== $delegated_source -> $delegated_output\n"; } if ( /^File: (.+) Graphic file \(type / ) { # First line of message from includegraphics/x - $dependents{normalize_clean_filename($1)} = 1; + $dependents{normalize_clean_filename($1, @pwd_log)} = 1; next LINE; } # Now test for generic lines to ignore, only after special cases! @@ -4228,7 +4282,7 @@ print "=== $delegated_source -> $delegated_output\n"; } INCLUDE_NAME: foreach my $include_name (@new_includes) { - $include_name = normalize_filename( $include_name ); + $include_name = normalize_filename( $include_name, @pwd_log ); my ($base, $path, $ext) = fileparseB( $include_name ); if ( ($path eq './') || ($path eq '.\\') ) { $include_name = $base.$ext; @@ -4426,7 +4480,7 @@ CANDIDATE_PAIR: #************************************************************ sub parse_fls { - my ($fls_name, $Pinputs, $Poutputs, $Pfirst_read_after_write ) = @_; + my ($fls_name, $Pinputs, $Poutputs, $Pfirst_read_after_write, $Ppwd_latex ) = @_; %$Pinputs = %$Poutputs = %$Pfirst_read_after_write = (); my $fls_file = new FileHandle; # Make a note of current working directory @@ -4436,6 +4490,14 @@ sub parse_fls { # giving (pdf)latex's best view of the cwd. Note that the # value given by the cwd() function may be mangled, e.g., by cygwin # compared with native MSWin32. + # + # Two relevant forms of cwd exist: The system one, which we can find, and + # the one reported by (pdf)latex in the fls file. It will be + # useful to remove leading part of cwd in filenames --- see the + # comments in sub rdb_set_latex_deps. Given the possible multiplicity + # of representations of cwd, the one reported in the fls file should + # be definitive in the fls file. + my $cwd = good_cwd(); if ( ! open ($fls_file, "<$fls_name") ) { return 1; @@ -4448,10 +4510,18 @@ sub parse_fls { $_ =~ s/[\n\r]*$//; if (/^\s*PWD\s+(.*)$/) { $cwd = $1; + $$Ppwd_latex = $cwd; } elsif (/^\s*INPUT\s+(.*)$/) { # Take precautions against aliasing of foo, ./foo and other possibilities for cwd. - my $file = normalize_filename( $1 ); + my $file = $1; + # Remove exactly pwd reported in this file, and following separator. + # MiKTeX reports absolute pathnames, and this way of removing PWD insulates + # us from coding issues if the PWD contains non-ASCII characters. What + # coding scheme (UTF-8, code page, etc) is used depends on OS, TeX + # implementation, ... + $file =~ s(^\Q$$Ppwd_latex\E[\\/])(); + $file = normalize_filename( $file ); if ( (exists $$Poutputs{$file}) && (! exists $$Pinputs{$file}) ) { $$Pfirst_read_after_write{$file} = 1; } @@ -4459,7 +4529,9 @@ sub parse_fls { } elsif (/^\s*OUTPUT\s+(.*)$/) { # Take precautions against aliasing of foo, ./foo and other possibilities for cwd. - $$Poutputs{ normalize_filename( $1 )} = 1; + my $file = $1; + $file =~ s(^\Q$$Ppwd_latex\E[\\/])(); + $$Poutputs{ normalize_filename( $file )} = 1; } } close( $fls_file ); @@ -4488,32 +4560,38 @@ sub clean_filename { # ------------------------------ sub normalize_filename { - # Remove various forms for cwd at start of filename. - # Convert to have directory separator = '/' only - my $file = $_[0]; + # Usage: normalize_filename( filename [, extra forms of name of cwd] ) + # Returns filename with removal of various forms for cwd, and + # with conversion of directory separator to '/' only + # + my ( $file, @dirs ) = @_; my $file1 = $file; # Saved original value my $cwd = good_cwd(); # Normalize files to use / to separate directory components: # (Note both / and \ are allowed under MSWin.) - $cwd =~ s(\\)(/)g; - $file =~ s(\\)(/)g; - + foreach ($cwd, $file, @dirs) { + s(\\)(/)g; + } # Remove initial component equal to current working directory. # Use \Q and \E round directory name in regex to avoid interpretation # of metacharacters in directory name: - $file =~ s(^\Q$cwd\E/)(); - # Remove current directory string: - $file =~ s(^\./)(); + foreach my $dir ( @dirs, './', $cwd ) { + if ( $file =~ s(^\Q$dir\E/)() ) { +#print "===normalize_filename: '$file1' changed to '$file'\n"; + last; + } + } return $file; } # ------------------------------ sub normalize_clean_filename { - # Remove quotes around filename --- see clean_filename --- as from log file. - # Then remove any string for cwd, and convert to use '/' for directory separator, - # (and any other standardization) done by normalize_filename. - return normalize_filename( clean_filename( $_[0] )); + # Usage: normalize_clean_filename( filename [, extra forms of name of cwd] ) + # Same as normalize_filename, but first remove any double quotes, as + # done by clean_filename, which is appropriate for filenames from log file. + my ($file, @dirs) = @_; + return normalize_filename( clean_filename( $file ) , @dirs ); } #************************************************************ @@ -5018,6 +5096,99 @@ sub rdb_set_latex_deps { # Use fls file only if $recorder is set, and the fls file was generated # on this run. + # N.B. A complication which we try and handle in determining + # dependent files is that there may be aliasing of file names, + # especially when characters are used in file and directory + # names that are not pure 7-bit-ASCII. Here is a list of some + # of the difficulties that do arise, between, on the one hand, + # the filenames specified on latexmk's and the cwd found by + # latexmk from the system, and, on the other hand, the filenames + # and their components reported by (pdf)latex in the fls and log + # files: + # 1. Whether the separator of path components is / or \ in + # MSWin. + # 2. Whether the LFN or the SFN is provided. + # 3. Whether the filenames include the cwd or whether they + # are relative to the current directory. + # 4. Under cygwin, whether the absolute filenames are + # specified by UNIX or native MSWin conventions. + # (With cygin, the programs used, including the Perl that + # executes latexmk, can be any combination of native MSWin + # programs and cygwin programs with their UNIX-like + # behavior.) + # 5. Whether UTF-8 or some other coding is used, and under + # which circumstances: e.g., in calls to the OS to access + # files, in files output by programs, on latexmk's command + # line, on other programs' command lines, by the command + # interpreterS. + # 6. If UTF-8 is used, what kind of canonicalization is used, + # if any. (This is a particular bugbear when files are + # transferred between different OSes.) + # 7. Whether the name of a file in the current directory is + # reported as the simple filename or whether it is + # preceeded by ".\" or "./". + # 8. How is it determined whether a pathname is absolute or + # relative? An absolute pathname in MSWin may start with + # a drive letter and a colon, but under UNIX-type systems, + # the colon is an ordinary character. + # 9. Whether a filename reported in an fls or log file can be + # used as is by perl to access a file, or on the command + # line to invoke another program, and whether the use on a + # command line depends on whether the command line is + # executed by a CLI, and by which CLI. (E.g., cmd.exe, + # v. sh v. tcsh, etc.) + # 10. Whether such a filename for the filename on (pdf)latex's + # file agrees with the one on the command line. + # The above questions have arisen from actual experiences and + # tests. + # + # In any case, when determining dependent files, we will try to + # remove an initial directory string from filenames found in the + # fls and log files, whenever it denotes the current + # directory. The directory string may be an absolute pathname, + # such as MiKTeX writes in both fls and log files, or it may be + # simply "./" as given by TeXLive in its log file. There are + # several reasons for removing a directory string when possible: + # + # 1. To avoid having multiple names referring to the same + # file in the list of dependents. + # 2. Because the name may be in a different coding. Thus + # under MSWin 7, cmd.exe and perl (by default) work in an + # "ANSI" coding with some code page, but the filenames + # written by MiKTeX are UTF-8 coded (and if they are non-ASCII + # can't be used for file-processing by Perl without some + # trouble). This is a particular problem if the pathname + # contains non-ASCII characters; the directory names may not + # even be under the user's control, unlike typical filenames. + # 3. When it comes to filenames that are then used in calls to + # bibtex and makeindex, it is bad to use absolute pathnames + # instead of clearly relative pathnames, because the default + # security settings are to prohibit writing files to the + # corresponding directories, which makes the calls to these + # programs unnecessarily fail. + # + # In removing unnecessary directory-specifying strings, to + # convert a filename to a simple specification relative to the + # current directory, it will be important to preferentially use + # a determination of the current directory from the file being + # processed. In the fls file, there is normally a PWD line. In + # the log file, if (pdf)latex is started with a filename instead + # of a command-executing first line, then this can be determined + # from the first few lines of the log file -- see parse_log. + # This gives a more reliable determination of the relevant path + # string; this is especially important in cases where there is a + # mismatch of coding of the current directory, particularly + # notable in the above-mentioned case of non-ASCII characters + # under MSWin. Other inconsistencies happen when there is a + # mixure of cygwin and native MSWin software. There can also be + # inconsistencies between whether the separator of pathname + # components is "/" or "\". So we will allow for this. The + # necessary normalizations of filenames are handled by the + # subroutines normalize_filename and normalize_clean_filename. + # + # I have not tried to handle the (currently rare) cases that the + # OS is neither UNIX-like nor MSWin-like. + # Rules should only be primary if ( $$Pcmd_type ne 'primary' ) { warn "\n$My_name: ==========$My_name: Probable BUG======= \n ", @@ -5047,6 +5218,8 @@ sub rdb_set_latex_deps { # to source file of conversion. local @missing_subdirs = (); # Missing subdirectories in aux_dir + local $pwd_latex = undef; # Cwd as reported in fls file by (pdf)latex + # The following are also returned, but are global, to be used by caller # $reference_changed, $bad_reference $bad_citation, $mult_defined @@ -5056,6 +5229,14 @@ sub rdb_set_latex_deps { if ( /^eps pdf / ) { $epspdf_cusdep = 1; last; } } + # Analyze fls file first. It tells us the working directory as seen by (pdf)latex + # But we'll use the results later, so that they take priority over the findings + # from the log file. + my $fls_file = "$aux_dir1$root_filename.fls"; + if ($recorder && test_gen_file($fls_file) ) { + parse_fls( $fls_file, \%source_fls, \%generated_fls, \%first_read_after_write, \$pwd_latex ); + } + &parse_log; $missing_dirs = 'none'; # Status of missing directories if (@missing_subdirs) { @@ -5093,20 +5274,19 @@ sub rdb_set_latex_deps { } } } - - my $fls_file = "$aux_dir1$root_filename.fls"; - if ($recorder && test_gen_file($fls_file) ) { - parse_fls( $fls_file, \%source_fls, \%generated_fls, \%first_read_after_write ); - foreach (keys %source_fls) { - $dependents{$_} = 4; - } - foreach (keys %generated_fls) { - rdb_add_generated( $_ ); - if ( exists($dependents{$_}) ) { - $dependents{$_} = 6; - } - } + # Use results from fls file. (N.B. The hashes will be empty if the fls file + # wasn't used/analyzed, so we don't need a test as to whether the fls file was + # used. + foreach (keys %source_fls) { + $dependents{$_} = 4; } + foreach (keys %generated_fls) { + rdb_add_generated( $_ ); + if ( exists($dependents{$_}) ) { + $dependents{$_} = 6; + } + } + for my $conv (sort keys %conversions) { my $conv_source = $conversions{$conv}; @@ -8343,7 +8523,7 @@ sub cache_good_cwd { " to get MSWin version of cygwin path\n", " '$cwd'\n", " The result was\n", - " 'Win_cwd'\n"; + " '$Win_cwd'\n"; } } $cache{cwd} = $cwd; |