From 24bdf3da6edc25056334c4063cf9c3d23ef95505 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 15 Nov 2012 00:20:11 +0000 Subject: latexmk (14nov12) git-svn-id: svn://tug.org/texlive/trunk@28264 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/support/latexmk/CHANGES | 14 + Master/texmf-dist/doc/support/latexmk/INSTALL | 2 +- Master/texmf-dist/doc/support/latexmk/README | 6 +- .../latexmk/example_rcfiles/TeX4ht-latexmkrc | 33 + .../doc/support/latexmk/extra-scripts/htlatexonly | 10 + .../doc/support/latexmk/extra-scripts/myhtlatex2 | 19 + Master/texmf-dist/doc/support/latexmk/latexmk.pdf | Bin 123878 -> 124523 bytes Master/texmf-dist/doc/support/latexmk/latexmk.txt | 1174 ++++++++++---------- 8 files changed, 667 insertions(+), 591 deletions(-) create mode 100644 Master/texmf-dist/doc/support/latexmk/example_rcfiles/TeX4ht-latexmkrc create mode 100644 Master/texmf-dist/doc/support/latexmk/extra-scripts/htlatexonly create mode 100644 Master/texmf-dist/doc/support/latexmk/extra-scripts/myhtlatex2 (limited to 'Master/texmf-dist/doc/support/latexmk') diff --git a/Master/texmf-dist/doc/support/latexmk/CHANGES b/Master/texmf-dist/doc/support/latexmk/CHANGES index 81bdfa85bd8..a7ed053be72 100644 --- a/Master/texmf-dist/doc/support/latexmk/CHANGES +++ b/Master/texmf-dist/doc/support/latexmk/CHANGES @@ -381,3 +381,17 @@ From v. 4.33b to 4.33c Correct infinite loop when maximum passes through latex/pdflatex are exceeded +From v. 4.33c to 4.34 + Correct non-optimality that if (pdf)latex reads a file only after + it has been written in the same run, the file is not a true + source file, but nevertheless latexmk treats it as a source + file. Thus changes in the file sometimes caused latexmk to make + unnecessary (but otherwise innocuous) extra runs of (pdflatex). + +From v. 4.34 to 4.35 + Correct bug in parsing fls file from native MS-Windows LaTeX (e.g., + MiKTeX) when latexmk is run under cygwin. (The names of some + files used by latexmk incorrectly contained a CR character.) + Correct bug that when the --gg option is used, the rule database + from the old fdb file was used instead of being cleared. + diff --git a/Master/texmf-dist/doc/support/latexmk/INSTALL b/Master/texmf-dist/doc/support/latexmk/INSTALL index 026edcbc4e9..16aefc347bd 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.33c, 19 August 2012) + (Version 4.35, 11 November 2012) John Collins Physics Department diff --git a/Master/texmf-dist/doc/support/latexmk/README b/Master/texmf-dist/doc/support/latexmk/README index b9699a8cbe3..db5cf8413c3 100644 --- a/Master/texmf-dist/doc/support/latexmk/README +++ b/Master/texmf-dist/doc/support/latexmk/README @@ -1,5 +1,5 @@ -Latexmk, version 4.33c, 19 August 2012 --------------------------------------- +Latexmk, version 4.35, 11 November 2012 +--------------------------------------- Latexmk completely automates the process of generating a LaTeX document. Essentially, it is a highly specialized cousin of the @@ -92,7 +92,7 @@ NOTES:- John Collins ---------------------------- "latexmk -h" ---------------------------- -Latexmk 4.33c: Automatic LaTeX document generation routine +Latexmk 4.35: Automatic LaTeX document generation routine Usage: latexmk [latexmk_options] [filename ...] diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/TeX4ht-latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/TeX4ht-latexmkrc new file mode 100644 index 00000000000..de486d8d8be --- /dev/null +++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/TeX4ht-latexmkrc @@ -0,0 +1,33 @@ +# Sometime in the future, latexmk will directly support the use of +# TeX4ht to obtain html from tex. Meanwhile, here is how to use +# latexmk with TeX4ht. There is a script htlatex supplied by the +# TeX4ht package: It simply runs latex a fixed number of times and +# then the programs tex4ht and t4ht. To use latexmk to get optimal +# processing use the following instructions (under UNIX-like operating +# systems, e.g., OS-X and linux): +# +# 1. Put the scripts htlatexonly and myhtlatex2 somewhere in the PATH +# for executables (and make sure they have excutable permissions +# set). +# 2. Set up an initialization file for latexmk like this one. +# +# 3. To process file.tex to make file.html, run +# +# myhtlatex2 file +# + +# Since these instructions use scripts that are UNIX shell scripts, +# the instructions work as written for UNIX-like operating +# systems. Users of other operating systems will have to adjust them +# and modify the scripts suitably. + + +warn "latexmkrc for htlatex\n"; + +$dvi_mode = 1; +$pdf_mode = 0; +$quote_filenames = 0; +$latex = 'htlatexonly %S'; + +$clean_ext .= ' 4ct 4tc idv lg tmp xref'; +$clean_full_ext .= ' css html'; diff --git a/Master/texmf-dist/doc/support/latexmk/extra-scripts/htlatexonly b/Master/texmf-dist/doc/support/latexmk/extra-scripts/htlatexonly new file mode 100644 index 00000000000..ea50bf9bf21 --- /dev/null +++ b/Master/texmf-dist/doc/support/latexmk/extra-scripts/htlatexonly @@ -0,0 +1,10 @@ +#!/bin/sh + +# Replacement for latex executable when latexmk is used for htlatex +# See TeX4ht-latexmkrc in the example-rcfiles directory of the latexmk +# distribution for how to use this. +# +# This is a shell script suitable for UNIX-like operating systems (including +# OS-X and linux, and presumably Cygwin under MS-Windows). + +latex --recorder $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1 diff --git a/Master/texmf-dist/doc/support/latexmk/extra-scripts/myhtlatex2 b/Master/texmf-dist/doc/support/latexmk/extra-scripts/myhtlatex2 new file mode 100644 index 00000000000..f2db06fd66f --- /dev/null +++ b/Master/texmf-dist/doc/support/latexmk/extra-scripts/myhtlatex2 @@ -0,0 +1,19 @@ +#!/bin/sh + +# This is a replacement for htlatex from the TeX4ht package. It allows +# latexmk to be used to do the latex part of the processing. +# See TeX4ht-latexmkrc in the example-rcfiles directory of the latexmk +# distribution for how to use this. +# +# This is a shell script suitable for UNIX-like operating systems (including +# OS-X and linux, and presumably Cygwin under MS-Windows). + +if [[ $# -lt 1 || $1 == "--help" || $1 == "-help" || $1 == "-h" ]]; then + echo "Convert tex file to html. Simplest usage" + echo " myhtlatex2 file" + exit 1 +fi + +latexmk $1 +tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 +t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644 diff --git a/Master/texmf-dist/doc/support/latexmk/latexmk.pdf b/Master/texmf-dist/doc/support/latexmk/latexmk.pdf index c731ddd5310..13be83f23e4 100644 Binary files a/Master/texmf-dist/doc/support/latexmk/latexmk.pdf and b/Master/texmf-dist/doc/support/latexmk/latexmk.pdf differ diff --git a/Master/texmf-dist/doc/support/latexmk/latexmk.txt b/Master/texmf-dist/doc/support/latexmk/latexmk.txt index 698ab117471..50ce0195a07 100644 --- a/Master/texmf-dist/doc/support/latexmk/latexmk.txt +++ b/Master/texmf-dist/doc/support/latexmk/latexmk.txt @@ -61,7 +61,7 @@ DESCRIPTION - 19 August 2012 1 + 11 November 2012 1 @@ -127,7 +127,7 @@ LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE - 19 August 2012 2 + 11 November 2012 2 @@ -193,7 +193,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 3 + 11 November 2012 3 @@ -259,7 +259,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 4 + 11 November 2012 4 @@ -325,7 +325,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 5 + 11 November 2012 5 @@ -391,7 +391,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 6 + 11 November 2012 6 @@ -457,7 +457,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 7 + 11 November 2012 7 @@ -523,7 +523,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 8 + 11 November 2012 8 @@ -577,19 +577,19 @@ LATEXMK(1L) LATEXMK(1L) - -p Print out the document. By default it is the generated post- - script file that is printed. But you can use the -print=... + + -p Print out the document. By default it is the generated + postscript file that is printed. But you can use the -print=... option to print the dvi or pdf files instead, and you can con- figure this in a start up file (by setting the $print_type vari- able). However, printing is enabled by default only under UNIX/LINUX - systems, where the default is to use the lpr command. In gen- - eral, the correct behavior for printing very much depends on + systems, where the default is to use the lpr command. In - 19 August 2012 9 + 11 November 2012 9 @@ -598,6 +598,7 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + general, the correct behavior for printing very much depends on your system's software. In particular, under MS-Windows you must have suitable program(s) available, and you must have con- figured the print commands used by latexmk. This can be non- @@ -651,11 +652,10 @@ LATEXMK(1L) LATEXMK(1L) -ps Generate postscript version of document. - -ps- - 19 August 2012 10 + 11 November 2012 10 @@ -664,7 +664,7 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - Turn off generation of postscript version of document. This can + -ps- Turn off generation of postscript version of document. This can be used to override a setting in a configuration file. (It may get overridden by some other option that requires a postscript file, for example a request for printing.) @@ -721,7 +721,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 11 + 11 November 2012 11 @@ -733,8 +733,8 @@ LATEXMK(1L) LATEXMK(1L) Important note: the acroread program on MS-Windows locks the pdf file, and prevents new versions being written, so it is a bad idea to use acroread to view pdf files in preview-continuous - mode. It is better to use a dvi or ps viewer, as set by one of - the -view=dvi and -view=ps options. + mode. It is better to use a different viewer: SumatraPDF and + gsview are good possibilities. There are some other methods for arranging an update, notably useful for many versions of xdvi and xpdf. These are best set @@ -787,7 +787,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 12 + 11 November 2012 12 @@ -804,56 +804,56 @@ LATEXMK(1L) LATEXMK(1L) -rules Show a list of latemk's rules and dependencies after processing. -rules- - Do not show a list of latexmk's rules and dependencies after + Do not show a list of latexmk's rules and dependencies after processing. (This is the default.) -showextraoptions - Show the list of extra latex and pdflatex options that latexmk - recognizes. These are options for the latex and pdflatex that - latexmk recognizes, but simply passes through to these programs - when they are run. These options are (currently) a combination + Show the list of extra latex and pdflatex options that latexmk + recognizes. These are options for the latex and pdflatex that + latexmk recognizes, but simply passes through to these programs + when they are run. These options are (currently) a combination of those allowed by the TeXLive and MiKTeX implementations. (If - a particular option is given to latexmk but is not handled by + a particular option is given to latexmk but is not handled by the particular implementation of latex or pdflatex that is being - used, that program will probably give an error message.) These + used, that program will probably give an error message.) These options are very numerous, but are not listed in this documenta- tion because they have no effect on latexmk's actions. - There are a few options (-includedirectory=dir, -initialize, - -ini) that are not recognized, either because they don't fit + There are a few options (-includedirectory=dir, -initialize, + -ini) that are not recognized, either because they don't fit with latexmk's intended operations, or because they need special - processing by latexmk that isn't implemented (at least, not + processing by latexmk that isn't implemented (at least, not yet). - There are also options that are accepted by latex etc, but + There are also options that are accepted by latex etc, but instead trigger actions by latexmk: -help, -version. Finally, there are certain options for latex and pdflatex (e.g., - -recorder) that trigger special actions or behavior by latexmk - itself as well as being passed in some form to the called latex - and pdflatex program, or that affect other programs as well. - These options do have entries in this documentation. These + -recorder) that trigger special actions or behavior by latexmk + itself as well as being passed in some form to the called latex + and pdflatex program, or that affect other programs as well. + These options do have entries in this documentation. These options are: -jobname=STRING, -aux-directory=dir, -output-direc- tory=DIR, -quiet, and -recorder. -silent Run commands silently, i.e., with options that reduce the amount - of diagnostics generated. For example, with the default set- - tings, the command "latex -interaction=batchmode" is used for + of diagnostics generated. For example, with the default set- + tings, the command "latex -interaction=batchmode" is used for latex. - Also reduce the number of informational messages that latexmk + Also reduce the number of informational messages that latexmk generates. - To change the options used to make the commands run silently, + To change the options used to make the commands run silently, you need to configure latexmk with changed values of its config- - uration variables, the relevant ones being $bib- - tex_silent_switch, $biber_silent_switch, $dvipdf_silent_switch, + uration variables, the relevant ones being $bib- + tex_silent_switch, $biber_silent_switch, $dvipdf_silent_switch, - 19 August 2012 13 + 11 November 2012 13 @@ -866,25 +866,25 @@ LATEXMK(1L) LATEXMK(1L) dex_silent_switch, and $pdflatex_silent_switch. -use-make - When after a run of latex or pdflatex, there are warnings about + When after a run of latex or pdflatex, there are warnings about missing files (e.g., as requested by the LaTeX \input, \include, - and \includgraphics), latexmk tries to make them by a custom + and \includgraphics), latexmk tries to make them by a custom dependency. If no relevant custom dependency with an appropriate - source file is found, and if the -use-make option is set, then - latexmk will try as a resort using the make program to try to + source file is found, and if the -use-make option is set, then + latexmk will try as a resort using the make program to try to make the missing files. - Note that the filename may be specified without an extension, - e.g., by \includegraphics{drawing} in a LaTeX file. In that - case, latexmk will try making drawing.ext with ext set in turn - to the possible extensions that are relevant for latex (or as + Note that the filename may be specified without an extension, + e.g., by \includegraphics{drawing} in a LaTeX file. In that + case, latexmk will try making drawing.ext with ext set in turn + to the possible extensions that are relevant for latex (or as appropriate pdflatex). - See also the documentation for the $use_make_for_missing_files + See also the documentation for the $use_make_for_missing_files configuration variable. -use-make- - Do not use the make program to try to make missing files. + Do not use the make program to try to make missing files. (Default.) -v, -version @@ -900,17 +900,17 @@ LATEXMK(1L) LATEXMK(1L) -xelatex Use xelatex. That is, use xelatex to process the source file(s) - to pdf (in place of pdflatex). This option is exactly equiva- + to pdf (in place of pdflatex). This option is exactly equiva- lent to specifying the following sequence of options: -pdflatex="xelatex %O %S" -pdf -dvi- -ps - The preview-continuous option -pvc can only work with one file. So in - this case you will normally only specify one filename on the command + The preview-continuous option -pvc can only work with one file. So in + this case you will normally only specify one filename on the command line. - Options -p, -pv and -pvc are mutually exclusive. So each of these + Options -p, -pv and -pvc are mutually exclusive. So each of these options turns the others off. @@ -919,7 +919,7 @@ EXAMPLES - 19 August 2012 14 + 11 November 2012 14 @@ -958,7 +958,7 @@ CONFIGURATION/INITIALIZATION (RC) FILES "/usr/local/share/latexmk/LatexMk", "/usr/local/lib/latexmk/LatexMk". On a MS-WINDOWS system it looks for "C:\latexmk\LatexMk". - On a cygwin system (i.e., a MS-Windows system in which perl is that + On a cygwin system (i.e., a MS-Windows system in which perl is that of cygwin), latexmk reads for the first it finds of "/cygdrive/c/latexmk/LatexMk", "/opt/local/share/latexmk/LatexMk", @@ -966,26 +966,26 @@ CONFIGURATION/INITIALIZATION (RC) FILES "/usr/local/lib/latexmk/LatexMk". 2) The user's RC file, "$HOME/.latexmkrc", if it exists. Here $HOME is - the user's home directory. [Latexmk determines the user's home direc- - tory as follows: It is the value of the environment variable HOME, if - this variable exists, which normally is the case on UNIX-like systems - (including LINUX and OS-X). Otherwise the environment variable USER- + the user's home directory. [Latexmk determines the user's home direc- + tory as follows: It is the value of the environment variable HOME, if + this variable exists, which normally is the case on UNIX-like systems + (including LINUX and OS-X). Otherwise the environment variable USER- PROFILE is used, if it exists, which normally is the case on MS-Windows systems. Otherwise a blank string is used instead of $HOME.] - 3) The RC file in the current working directory. This file can be - named either "latexmkrc" or ".latexmkrc", and the first of these to be + 3) The RC file in the current working directory. This file can be + named either "latexmkrc" or ".latexmkrc", and the first of these to be found is used, if any. 4) Any RC file(s) specified on the command line with the -r option. Each RC file is a sequence of Perl commands. Naturally, a user can use - this in creative ways. But for most purposes, one simply uses a - sequence of assignment statements that override some of the built-in + this in creative ways. But for most purposes, one simply uses a + sequence of assignment statements that override some of the built-in - 19 August 2012 15 + 11 November 2012 15 @@ -994,24 +994,24 @@ CONFIGURATION/INITIALIZATION (RC) FILES LATEXMK(1L) LATEXMK(1L) - settings of Latexmk. Straightforward cases can be handled without - knowledge of the Perl language by using the examples in this document + settings of Latexmk. Straightforward cases can be handled without + knowledge of the Perl language by using the examples in this document as templates. Comment lines are introduced by the "#" character. - Note that command line options are obeyed in the order in which they + Note that command line options are obeyed in the order in which they are written; thus any RC file specified on the command line with the -r - option can override previous options but can be itself overridden by - later options on the command line. There is also the -e option, which + option can override previous options but can be itself overridden by + later options on the command line. There is also the -e option, which allows initialization code to be specified in latexmk's command line. - For possible examples of code for in an RC file, see the directory - example_rcfiles in the distribution of latexmk (e.g., at + For possible examples of code for in an RC file, see the directory + example_rcfiles in the distribution of latexmk (e.g., at http://ctan.tug.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 + 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: $bibtex = 'bibtex %O %B'; @@ -1024,34 +1024,34 @@ HOW TO SET VARIABLES IN INITIALIZATION FILES @default_files = ('paper', 'paper1'); - for the setting of an array of strings. It is possible to append an + for the setting of an array of strings. It is possible to append an item to an array variable as follows: push @default_files, 'paper2'; - Note that simple "scalar" variables have names that begin with a $ + Note that simple "scalar" variables have names that begin with a $ character and array variables have names that begin with a @ character. Each statement ends with a semicolon. - Strings should be enclosed in single quotes. (You could use double - quotes, as in many programming languages. But then the Perl program- - ming language brings into play some special rules for interpolating - variables into strings. People not fluent in Perl will want to avoid + Strings should be enclosed in single quotes. (You could use double + quotes, as in many programming languages. But then the Perl program- + ming language brings into play some special rules for interpolating + variables into strings. People not fluent in Perl will want to avoid these complications.) - You can do much more complicated things, but for this you will need to + You can do much more complicated things, but for this you will need to consult a manual for the Perl programming language. FORMAT OF COMMAND SPECIFICATIONS - Some of the variables set the commands that latexmk uses for carrying - out its work, for example to generate a dvi file from a tex file or to + Some of the variables set the commands that latexmk uses for carrying + out its work, for example to generate a dvi file from a tex file or to - 19 August 2012 16 + 11 November 2012 16 @@ -1064,33 +1064,33 @@ LATEXMK(1L) LATEXMK(1L) of how the commands are specified. Placeholders: Supposed you wanted latexmk to use the command elatex in - place of the regular latex command, and suppose moreover that you - wanted to give it the option "--shell-escape". You could do this by + place of the regular latex command, and suppose moreover that you + wanted to give it the option "--shell-escape". You could do this by the following setting: $latex = 'elatex --shell-escape %O %S'; - 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 + 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".) The available placeholders are: - %B base of filename for current command. E.g., if a postscript - file document.ps is being made from the dvi file document.dvi, + %B base of filename for current command. E.g., if a postscript + file document.ps is being made from the dvi file document.dvi, then the basename is document. - %D destination file (e.g., the name of the postscript file when + %D destination file (e.g., the name of the postscript file when converting a dvi file to postscript). %O options %R root filename. This is the base name for the main tex file. - %S source file (e.g., the name of the dvi file when converting a + %S source file (e.g., the name of the dvi file when converting a dvi file to ps). %T The name of the primary tex file. @@ -1101,23 +1101,23 @@ LATEXMK(1L) LATEXMK(1L) able character, with suitable characters being those appropriate to UNIX and MS-Windows, i.e., ':', '/' and '\'. - %Z Name of directory for output files (see the configuration vari- - able $out_dir). A directory separation character ('/') is + %Z Name of directory for output files (see the configuration vari- + able $out_dir). A directory separation character ('/') is appended if $out_dir is non-empty and does not end in a suitable - character, with suitable characters being those appropriate to + character, with suitable characters being those appropriate to UNIX and MS-Windows, i.e., ':', '/' and '\'. - If for some reason you need a literal % character in your string not - subject to the above rules, use a pair of these characters. Thus with - the command specification $ps_previewer = 'latex -ad=%%Sfile.ad %S', + If for some reason you need a literal % character in your string not + subject to the above rules, use a pair of these characters. Thus with + the command specification $ps_previewer = 'latex -ad=%%Sfile.ad %S', the %%S will become %S when the command is executed, but the %S will be - replaced by the source filename, which in this case would be the name + replaced by the source filename, which in this case would be the name of a postscript file to be viewed. - 19 August 2012 17 + 11 November 2012 17 @@ -1126,26 +1126,26 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - Appropriate quoting will be applied to the filename substitutions, so - you mustn't supply them yourself even if the names of your files have + Appropriate quoting will be applied to the filename substitutions, so + you mustn't supply them yourself even if the names of your files have spaces in them. (But if your TeX filenames have spaces in them, beware that many versions of the TeX program cannot correctly handle filenames - containing spaces.) In case latexmk's quoting does not work correctly - on your system, you can turn it off -- see the documentation for the + containing spaces.) In case latexmk's quoting does not work correctly + on your system, you can turn it off -- see the documentation for the variable $quote_filenames. - The distinction between %B and %R needs a bit of care, since they are - often the same, but not always. For example on a simple document, the + The distinction between %B and %R needs a bit of care, since they are + often the same, but not always. For example on a simple document, the basename of a bibtex run is the same as for the texfile. But in a doc- - ument with several bibliographies, the bibliography files will have a - variety of names. Since bibtex is invoked with the basename of the - bibliography file, the setting for the bibtex command should therefore + ument with several bibliographies, the bibliography files will have a + variety of names. Since bibtex is invoked with the basename of the + bibliography file, the setting for the bibtex command should therefore be $bibtex = 'bibtex %O %B'; - Generally, you should use %B rather than %R. Similarly for most pur- - poses, the name %T of the primary texfile is not a useful placeholder. + Generally, you should use %B rather than %R. Similarly for most pur- + poses, the name %T of the primary texfile is not a useful placeholder. See the default values in the section "List of configuration variables usable in initialization files" for what is normally the most appropri- @@ -1183,7 +1183,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 18 + 11 November 2012 18 @@ -1249,7 +1249,7 @@ LATEXMK(1L) LATEXMK(1L) - 19 August 2012 19 + 11 November 2012 19 @@ -1260,6 +1260,7 @@ LATEXMK(1L) LATEXMK(1L) $latex = 'latex --src-specials %O %S'; + Running a subroutine instead of an external command: Use a specifica- tion starting with "internal", as in @@ -1270,6 +1271,7 @@ 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 @@ -1310,12 +1312,10 @@ LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES unfortunately.) This use of a temporary file solves a problem that the making of - these files can occupy a substantial time. If a viewer sees - that the file has changed, it reads the new file, and this can - 19 August 2012 20 + 11 November 2012 20 @@ -1324,6 +1324,8 @@ LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES LATEXMK(1L) LATEXMK(1L) + these files can occupy a substantial time. If a viewer sees + that the file has changed, it reads the new file, and this can cause havoc if the program writing the file has not yet finished its work. @@ -1376,12 +1378,10 @@ LATEXMK(1L) LATEXMK(1L) black, 1 is white. The default is just right if your toner car- tridge isn't running too low. - $banner_message ["DRAFT"] - The banner message to print across each page when converting the - 19 August 2012 21 + 11 November 2012 21 @@ -1390,6 +1390,8 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + $banner_message ["DRAFT"] + The banner message to print across each page when converting the dvi file to postscript. This is equivalent to the -bm option. $banner_scale [220.0] @@ -1441,13 +1443,11 @@ LATEXMK(1L) LATEXMK(1L) Switch(es) for the BibTeX processing program when silent mode is on. - $bibtex_use [1] - Under what conditions to run BibTeX or biber. When latexmk dis- - covers from the log file that one (or more) BibTeX/biber- - 19 August 2012 22 + + 11 November 2012 22 @@ -1456,8 +1456,11 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - generated bibliographies are used, it can run BibTeX or biber - whenever it appears necessary to regenerate the bbl file(s) from + $bibtex_use [1] + Under what conditions to run BibTeX or biber. When latexmk dis- + covers from the log file that one (or more) BibTeX/biber-gener- + ated bibliographies are used, it can run BibTeX or biber when- + ever it appears necessary to regenerate the bbl file(s) from their source bib database file(s). But sometimes, the bib file(s) are not available (e.g., for a @@ -1507,13 +1510,10 @@ LATEXMK(1L) LATEXMK(1L) in an initialization file will imply that when a clean-up opera- tion is specified, not only is the standard set of files - deleted, but also files of the form FOO.out and FOO-blx.bib, - where FOO stands for the basename of the file being processed - (as in FOO.tex). - 19 August 2012 23 + 11 November 2012 23 @@ -1522,6 +1522,11 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + deleted, but also files of the form FOO.out and FOO-blx.bib, + where FOO stands for the basename of the file being processed + (as in FOO.tex). + + $clean_full_ext [""] Extra extensions of files for latexmk to remove when the -C option is selected, i.e., extensions of files to remove when the @@ -1533,17 +1538,17 @@ 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 + 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 + 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. An example of a typical setting of these variables is as follows @@ -1572,34 +1577,33 @@ LATEXMK(1L) LATEXMK(1L) window to know the status of the compilation. - @cus_dep_list [()] - Custom dependency list -- see section on "Custom Dependencies". - + 11 November 2012 24 - 19 August 2012 24 +LATEXMK(1L) LATEXMK(1L) -LATEXMK(1L) LATEXMK(1L) + @cus_dep_list [()] + Custom dependency list -- see section on "Custom Dependencies". @default_files [("*.tex")] Default list of files to be processed. - 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 + 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 + 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. Three examples: @@ -1610,42 +1614,38 @@ LATEXMK(1L) LATEXMK(1L) @default_files = ("*.tex", "*.dtx"); - Note that more than file may be given, and that the default - extension is ".tex". Wild cards are allowed. The parentheses + Note that more than file may be given, and that the default + extension is ".tex". Wild cards are allowed. The parentheses are because @default_files is an array variable, i.e., a sequence of filename specifications is possible. $dependents_phony [0] - If a list of dependencies is output, this variable determines - whether to include a phony target for each source file. If you - use the dependents list in a Makefile, the dummy rules work - around errors make gives if you remove header files without + If a list of dependencies is output, this variable determines + whether to include a phony target for each source file. If you + use the dependents list in a Makefile, the dummy rules work + around errors make gives if you remove header files without updating the Makefile to match. $dependents_list [0] - Whether to display a list(s) of dependencies at the end of a + Whether to display a list(s) of dependencies at the end of a run. $dvi_filter [empty] - The dvi file filter to be run on the newly produced dvi file - before other processing. Equivalent to specifying the -dF + The dvi file filter to be run on the newly produced dvi file + before other processing. Equivalent to specifying the -dF option. $dvi_mode [See below for default] - If nonzero, generate a dvi version of the document. Equivalent + If nonzero, generate a dvi version of the document. Equivalent to the -dvi option. - The variable $dvi_mode defaults to 0, but if no explicit - requests are made for other types of file (postscript, pdf), - then $dvi_mode will be set to 1. In addition, if a request for - a file for which a .dvi file is a prerequisite, then $dvi_mode - will be set to 1. - + The variable $dvi_mode defaults to 0, but if no explicit + requests are made for other types of file (postscript, pdf), + then $dvi_mode will be set to 1. In addition, if a request for - - 19 August 2012 25 + 11 November 2012 25 @@ -1654,64 +1654,64 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + 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 + Important note: Normally you will want to have a previewer run detached, so that latexmk doesn't wait for the previewer to ter- - minate before continuing its work. So normally you should pre- - fix the command by "start ", which flags to latexmk that it - should do the detaching of the previewer itself (by whatever - method is appropriate to the operating system). But sometimes + minate before continuing its work. So normally you should pre- + fix the command by "start ", which flags to latexmk that it + should do the detaching of the previewer itself (by whatever + method is appropriate to the operating system). But sometimes letting latexmk do the detaching is not appropriate (for a vari- - ety of non-trivial reasons), so you should put the "start " bit + ety of non-trivial reasons), so you should put the "start " bit in yourself, whenever it is needed. $dvi_previewer_landscape ["start xdvi %O %S"] The command to invoke a dvi-previewer in landscape mode. [Default is "start" under MS-WINDOWS; under more recent versions - of Windows, this will cause to be run whatever command the sys- + 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 - file in landscape mode. - 19 August 2012 26 + 11 November 2012 26 @@ -1720,39 +1720,43 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + $dvips_landscape ["dvips -tlandscape %O -o %D %S"] + The program to used as a filter to convert a .dvi file to a .ps + file in landscape mode. + $dvips_pdf_switch ["-P pdf"] - Switch(es) for dvips program when pdf file is to be generated + 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 + When the dvi previewer is set to be updated by running a com- + mand, this is the command that is run. See the information for the variable $dvi_update_method for further information, and see - information on the variable $pdf_update_method for an example + information on the variable $pdf_update_method for an example for the analogous case of a pdf previewer. $dvi_update_method [2 under UNIX, 1 under MS-Windows] - How the dvi viewer updates its display when the dvi file has - changed. The values here apply equally to the + How the dvi viewer updates its display when the dvi file has + changed. The values here apply equally to the $pdf_update_method and to the $ps_update_method variables. 0 => update is automatic, 1=> manual update by user, which may only mean a mouse click on the viewer's window or may mean a more serious action. - 2 => Send the signal, whose number is in the variable - $dvi_update_signal. The default value under UNIX is suitable + 2 => Send the signal, whose number is in the variable + $dvi_update_signal. The default value under UNIX is suitable for xdvi. - 3 => Viewer cannot do an update, because it locks the file. + 3 => Viewer cannot do an update, because it locks the file. (As with acroread under MS-Windows.) - 4 => run a command to do the update. The command is speci- + 4 => run a command to do the update. The command is speci- fied by the variable $dvi_update_command. - See information on the variable $pdf_update_method for an exam- + See information on the variable $pdf_update_method for an exam- ple of updating by command. - $dvi_update_signal [Under UNIX: SIGUSR1, which is a system-dependent + $dvi_update_signal [Under UNIX: SIGUSR1, which is a system-dependent value] The number of the signal that is sent to the dvi viewer when it is updated by sending a signal -- see the information on the @@ -1770,14 +1774,10 @@ LATEXMK(1L) LATEXMK(1L) $force_mode [0] If nonzero, continue processing past minor latex errors includ- ing unrecognized cross references. Equivalent to specifying the - -f option. - @generated_exts [( aux , bbl , idx , ind , lof , lot , out , toc , - $fdb_ext )] - - 19 August 2012 27 + 11 November 2012 27 @@ -1786,64 +1786,64 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - 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, + -f option. + + @generated_exts [( aux , bbl , idx , ind , lof , lot , out , toc , + $fdb_ext )] + This contains a list of extensions for files that are generated + during a LaTeX run and that are read in by LaTeX in later runs, either directly or indirectly. - This list has two uses: (a) to set the kinds of file to be + 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 + a rerun. This includes a file generated by LaTeX, e.g., an aux + file, that is read in on subsequent runs. But after a run that + results in an error, a new run should occur until the user has + made a change in the files. But the user may have corrected an error in a source .tex file during the run. So latexmk needs to distinguish user-generated and automatically generated files; it - determines the automatically generated files as those with + determines the automatically generated files as those with extensions in the list in @generated_exts.) - A convenient way to add an extra extension to the list, without - losing the already defined ones is to use a push command in the + A convenient way to add an extra extension to the list, without + losing the already defined ones is to use a push command in the line in an RC file. E.g., push @generated_exts, "end"; - adds the extension "end" to the list of predefined generated - extensions. (This extension is used by the RevTeX package, for + adds the extension "end" to the list of predefined generated + extensions. (This extension is used by the RevTeX package, for example.) $go_mode [0] - If nonzero, process files regardless of timestamps, and is then + If nonzero, process files regardless of timestamps, and is then equivalent to the -g option. %hash_calc_ignore_pattern !!!This variable is for experts only!!! - The general rule latexmk uses for determining when an extra run - of some program is needed is that one of the source files has - changed. But consider for example a latex package that causes - an encapsulated postscript file (an "eps" file) to be made that - is to be read in on the next run. The file contains a comment - line giving its creation date and time. On the next run the - time changes, latex sees that the eps file has changed, and - therefore reruns latex. This causes an infinite loop, that is - only terminated becaues 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 becaues latexmk has a limit on the number of runs to guard against pathological situations. But the changing line has no real effect, since it is a comment. You can instruct latex to ignore the offending line as follows: - $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 - 19 August 2012 28 + 11 November 2012 28 @@ -1852,29 +1852,33 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - in a hash. Note that the file extension is specified without a + $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: '; + + This creates a rule for files with extension .eps about lines to + ignore. The left-hand side is a Perl idiom for setting an item + in a hash. Note that the file extension is specified without a period. The value, on the right-hand side, is a string contain- - ing a regular expresssion. (See documentation on Perl for how - they are to be specified in general.) This particular regular - expression specifies that lines beginning with "%%CreationDate: - " are to be ignored in deciding whether a file of the given + 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- + 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: + $hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: |^%%Title: '; - causes lines starting with either "^%%CreationDate: " or + causes lines starting with either "^%%CreationDate: " or "^%%Title: " to be ignored. - It may happen that a pattern to be ignored is specified in, for - example, in a system or user initialization file, and you wish + 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., @@ -1882,34 +1886,30 @@ 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"; - - - - 19 August 2012 29 + 11 November 2012 29 @@ -1918,24 +1918,26 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + $latex = "latex --src-specials"; + %latex_input_extensions - This variable specifies the extensions tried by latexmk when it - finds that a LaTeX run resulted in an error that a file has not - been found, and the file is given without an extension. This - typically happens when LaTeX commands of the form \input{file} - or \includegraphics{figure}, when the relevant source file does + This variable specifies the extensions tried by latexmk when it + finds that a LaTeX run resulted in an error that a file has not + been found, and the file is given without an extension. This + typically happens when LaTeX commands of the form \input{file} + or \includegraphics{figure}, when the relevant source file does not exist. - In this situation, latexmk searches for custom dependencies to - make the missing file(s), but restricts it to the extensions - specified by the variable %latex_input_extensions. The default + In this situation, latexmk searches for custom dependencies to + make the missing file(s), but restricts it to the extensions + specified by the variable %latex_input_extensions. The default extensions are 'tex' and 'eps'. - (For Perl experts: %latex_input_extensions is a hash whose keys - are the extensions. The values are irrelevant.) Two subrou- - tines are provided for manipulating this and the related vari- - able %pdflatex_input_extensions, add_input_ext and - remove_input_ext. They are used as in the following examples + (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' ); @@ -1944,20 +1946,20 @@ LATEXMK(1L) LATEXMK(1L) 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- @@ -1967,15 +1969,13 @@ 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": - - 19 August 2012 30 + 11 November 2012 30 @@ -1984,6 +1984,8 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + option "/p": + $lpr = '"c:/Program Files/Ghostgum/gsview/gsview32.exe" /p'; If gsview is installed in a different directory, you will need @@ -2006,8 +2008,8 @@ 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 + 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. @@ -2021,27 +2023,25 @@ 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 - running under MS-Windows. It determines whether, when a command - is executed under MS-Windows, there should be substituted "\" + This configuration variable only has an effect when latexmk is - 19 August 2012 31 + 11 November 2012 31 @@ -2050,36 +2050,38 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - for the separator character between components of a directory - name. Internally, latexmk uses "/" for the directory separator + running under MS-Windows. It determines whether, when a command + is executed under MS-Windows, there should be substituted "\" + for the separator character between components of a directory + name. Internally, latexmk uses "/" for the directory separator character, which is the character used by Unix-like systems. For many programs under MS-Windows, both "\" and "/" are accept- - able as the directory separator character. But some programs - only accept "\". 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 + 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 + This variable applies to latexmk only in continuous-preview mode. If $new_viewer_always is 0, latexmk will check for a pre- - viously running previewer on the same file, and if one is run- - ning will not start a new one. If $new_viewer_always is non- - zero, this check will be skipped, and latexmk will behave as if + viously running previewer on the same file, and if one is run- + ning will not start a new one. If $new_viewer_always is non- + zero, this check will be skipped, and latexmk will behave as if no viewer is running. $out_dir [""] - The directory in which output files are to be written by a run + 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) implementations of TeX, i.e., + 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) implementations of TeX, i.e., MiKTeX and TeXLive. But it may not be present in other versions. Commonly, the directory specified for output files is a subdi- @@ -2102,12 +2104,10 @@ LATEXMK(1L) LATEXMK(1L) $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 - 19 August 2012 32 + 11 November 2012 32 @@ -2116,9 +2116,11 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - pdflatex. If equal to 2, generate a pdf version of the document - from the ps file, by using the command specified by the $ps2pdf - variable. If equal to 3, generate a pdf version of the document + 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 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. @@ -2168,12 +2170,10 @@ LATEXMK(1L) LATEXMK(1L) removes the extension 'tex' from pdflatex_input_extensions - add_input_ext( 'pdflatex', 'asdf' ); - - 19 August 2012 33 + 11 November 2012 33 @@ -2182,6 +2182,8 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + 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 @@ -2216,12 +2218,12 @@ LATEXMK(1L) LATEXMK(1L) file. By default, for pdf files this association is to OS-X's preview, which is quite satisfactory. - WARNING: Potential 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 + 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 ghost- - view, gv or gsview is used to view pdf files. + -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 detached, so that latexmk doesn't wait for the previewer to ter- @@ -2234,12 +2236,10 @@ LATEXMK(1L) LATEXMK(1L) in yourself, whenever it is needed. - $pdf_update_command [""] - When the pdf previewer is set to be updated by running a - 19 August 2012 34 + 11 November 2012 34 @@ -2248,8 +2248,10 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - command, this is the command that is run. See the information - for the variable $pdf_update_method. + $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 @@ -2279,33 +2281,31 @@ LATEXMK(1L) LATEXMK(1L) $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 + 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 - 19 August 2012 35 + + 11 November 2012 35 @@ -2314,39 +2314,42 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - option. Which previewer is run depends on the other settings, + $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. $preview_mode [0] If nonzero, run a previewer to preview the document. Equivalent - to the -pv option. Which previewer is run depends on the other - settings, see the command line options -view=, and the variable + to the -pv option. Which previewer is run depends on the other + settings, see the command line options -view=, and the variable $view. $printout_mode [0] - If nonzero, print the document using 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 = ["ps"] - Type of file to printout: possibilities are "dvi", "none", + Type of file to printout: possibilities are "dvi", "none", "pdf", or "ps". $pscmd Command used to get all the processes currently run by the user. - The -pvc option uses the command specified by the variable - $pscmd to determine if there is an already running previewer, - and to find the process ID (needed if latexmk needs to signal + The -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"] @@ -2354,24 +2357,21 @@ 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 apppropriately. - + 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 - 19 August 2012 36 + 11 November 2012 36 @@ -2380,22 +2380,25 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + different ways of writing this option. You can configure this + variable apppropriately. + WARNING: Linux systems may have installed one (or more) versions - of gv under different names, e.g., ggv, kghostview, etc, but + of gv under different names, e.g., ggv, kghostview, etc, but perhaps not one called gv. - Important note: Normally you will want to have a previewer run + Important note: Normally you will want to have a previewer run detached, so that latexmk doesn't wait for the previewer to ter- - minate before continuing its work. So normally you should pre- - fix the command by "start ", which flags to latexmk that it - should do the detaching of the previewer itself (by whatever - method is appropriate to the operating system). But sometimes + minate before continuing its work. So normally you should pre- + fix the command by "start ", which flags to latexmk that it + should do the detaching of the previewer itself (by whatever + method is appropriate to the operating system). But sometimes letting latexmk do the detaching is not appropriate (for a vari- - ety of non-trivial reasons), so you should put the "start " bit + ety of non-trivial reasons), so you should put the "start " bit in yourself, whenever it is needed. - $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. @@ -2416,8 +2419,8 @@ LATEXMK(1L) LATEXMK(1L) $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. @@ -2429,15 +2432,12 @@ 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 + 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- - - 19 August 2012 37 + 11 November 2012 37 @@ -2446,64 +2446,64 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - Windows. It allows the use of filenames containing special - characters, notably spaces. (But note that many versions of - LaTeX and PdfLaTeX cannot correctly deal with TeX files whose - names contain spaces. Latexmk's quoting only ensures that such + The quoting method used by latexmk is tested to work correctly + under UNIX systems (including Linux and Mac OS-X) and under MS- + Windows. It allows the use of filenames containing special + characters, notably spaces. (But note that many versions of + LaTeX and PdfLaTeX cannot correctly deal with TeX files whose + names contain spaces. Latexmk's quoting only ensures that such filenames are correctly treated by the operating system in pass- ing arguments to programs.) $recorder [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 - 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.) - + 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 - 19 August 2012 38 + 11 November 2012 38 @@ -2512,21 +2512,24 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + the MSWin, Linux, OS-X, Unix collection.) + + $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". @@ -2536,40 +2539,37 @@ 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 + The default under MSWindows (including cygwin), is to set + $tmpdir to the value of the first of whichever of the system + environment variables TMPDIR or TEMP exists, otherwise to the + current directory. Under other operating systems (expected to + be UNIX/Linux, including OS-X), the default is the value of the + system environment variable TMPDIR if it exists, otherwise "/tmp". $use_make_for_missing_files [0] Whether to use make to try and make files that are missing after - a run of latex or pdflatex, and for which a custom dependency - has not been found. This is generally useful only when latexmk - is used as part of a bigger project which is built by using the + a run of latex or pdflatex, and for which a custom dependency + has not been found. This is generally useful only when latexmk + is used as part of a bigger project which is built by using the make program. Note that once a missing file has been made, no further calls to - make will be made on a subsequent run of latexmk to update the - file. Handling this problem is the job of a suitably defined - Makefile. See the section "USING latexmk WITH make" for how to - do this. The intent of calling make from latexmk is merely to + make will be made on a subsequent run of latexmk to update the + file. Handling this problem is the job of a suitably defined + Makefile. See the section "USING latexmk WITH make" for how to + do this. The intent of calling make from latexmk is merely to detect dependencies. $view ["default"] - Which kind of file is to be previewed if a previewer is used. - The possible values are "default", "dvi", "ps", "pdf". The - value of "default" means that the "highest" of the kinds of file - generated is to be used (among dvi, ps and pdf). + Which kind of file is to be previewed if a previewer is used. - 19 August 2012 39 + 11 November 2012 39 @@ -2578,16 +2578,21 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + 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 ) @@ -2598,44 +2603,39 @@ 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 + 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 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 - rule is invoked, with an argument that is the base name of the files in - question. Simple cases just involve a subroutine invoking an external - program; this can be done by following the templates below, even by - those without knowledge of the Perl programming language. Of course, - experts could do something much more elaborate. + To make the new destination file, the Perl subroutine specified in the - 19 August 2012 40 + 11 November 2012 40 @@ -2644,8 +2644,14 @@ CUSTOM DEPENDENCIES LATEXMK(1L) LATEXMK(1L) - One other item in each custom-dependency rule labelled "must" above - specifies how the rule should be applied when the source file fails to + rule is invoked, with an argument that is the base name of the files in + question. Simple cases just involve a subroutine invoking an external + program; this can be done by following the templates below, even by + those without knowledge of the Perl programming language. Of course, + experts could do something much more elaborate. + + One other item in each custom-dependency rule labelled "must" above + 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 @@ -2655,32 +2661,32 @@ LATEXMK(1L) LATEXMK(1L) system( "fig2dev -Leps } - The first line adds a custom dependency that converts a file with - extension "fig", as created by the xfig program, to an encapsulated - postscript file, with extension "eps". The remaining lines define a - subroutine that carries out the conversion. If a rule for converting - "fig" to "eps" files already exists (e.g., from a previously read-in - initialization file), the latexmk will delete this rule before making + The first line adds a custom dependency that converts a file with + extension "fig", as created by the xfig program, to an encapsulated + postscript file, with extension "eps". The remaining lines define a + subroutine that carries out the conversion. If a rule for converting + "fig" to "eps" files already exists (e.g., from a previously read-in + initialization file), the latexmk will delete this rule before making the new one. - Suppose latexmk is using this rule to convert a file "figure.fig" to - "figure.eps". Then it will invoke the fig2eps subroutine defined in - the above code with a single argument "figure", which is the basename - of each of the files (possibly with a path component). This argument - is referred to by Perl as $_[0]. In the example above, the subroutine + Suppose latexmk is using this rule to convert a file "figure.fig" to + "figure.eps". Then it will invoke the fig2eps subroutine defined in + the above code with a single argument "figure", which is the basename + of each of the files (possibly with a path component). This argument + is referred to by Perl as $_[0]. In the example above, the subroutine uses the Perl command system to invoke the program fig2dev. The double quotes around the string are a Perl idiom that signify that each string - of the form of a variable name, $_[0] in this case, is to be substi- + of the form of a variable name, $_[0] in this case, is to be substi- tuted by its value. - If the return value of the subroutine is non-zero, then latexmk will - assume an error occurred during the execution of the subroutine. In - the above example, no explicit return value is given, and instead the - return value is the value returned by the last (and only) statement, + If the return value of the subroutine is non-zero, then latexmk will + assume an error occurred during the execution of the subroutine. In + the above example, no explicit return value is given, and instead the + return value is the value returned by the last (and only) statement, i.e., the invocation of system, which returns the value 0 on success. - If you use pdflatex instead of latex, then you will probably prefer to - convert your graphics files to pdf format, in which case you would + If you use pdflatex instead of latex, then you will probably prefer to + convert your graphics files to pdf format, in which case you would replace the above code in an initialization file by add_cus_dep( 'fig', 'pdf, 0, 'fig2pdf' ); @@ -2688,20 +2694,14 @@ LATEXMK(1L) LATEXMK(1L) system( "fig2dev -Lpdf } - 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 ' of the program against special characters in file- - names. Very often these quotes are not necessary, i.e., they can be - omitted. But it is normally safer to keep them in. Even though the - rules for quoting vary between operating systems, command shells and - individual pieces of software, the quotes in the above examples do not - cause problems in the cases I have tested. + Note 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 ' of the program against special characters in file- + names. Very often these quotes are not necessary, i.e., they can be - Note 2: One case in which the quotes are important is when the files - - 19 August 2012 41 + 11 November 2012 41 @@ -2710,39 +2710,45 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - 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 sanity from - software like MiKTeX that mixes both directory separators; but their + omitted. But it is normally safer to keep them in. Even though the + rules for quoting vary between operating systems, command shells and + individual pieces of software, the quotes in the above examples do not + cause problems in the cases I have tested. + + Note 2: One case in which the quotes are important is when the files + are in a subdirectory and your operating system is Microsoft Windows. + Then the separator character for directory components can be either a + forward slash '/' or Microsoft's more usual backward slash 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- + 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 + 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- + 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 + extension .ndx to .nnd. The following lines in an initialization RC file will cause this to happen: add_cus_dep('ndx', 'nnd', 0, 'makendx2nnd'); @@ -2750,24 +2756,18 @@ LATEXMK(1L) LATEXMK(1L) system( "makeindex -o } - (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 - 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. - 19 August 2012 42 + 11 November 2012 42 @@ -2776,23 +2776,29 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) - For real experts: See the %hash_cal_ignore_pattern if you have to deal + 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 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"; @@ -2800,40 +2806,34 @@ OLD METHOD OF DEFINING CUSTOM DEPENDENCIES system( "fig2dev -Lps } - 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 + 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. 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 + 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 depedencies can be determined automat- ically. Latexmk solves both of these problems robustly. - Thus for many standard LaTeX documents latexmk can be used by itself - without the make program. In a complex project it simply needs to be - suitably configured. A standard configuration would be to define cus- - tom dependencies to make graphics files from their source files (e.g., - as created by the xfig program). Custom dependencies are latexmk's - equivalent of pattern rules in Makefiles. - 19 August 2012 43 + 11 November 2012 43 @@ -2842,17 +2842,24 @@ USING latexmk WITH make LATEXMK(1L) LATEXMK(1L) - Nevertheless there are projects for which a Makefile is appropriate, + Thus for many standard LaTeX documents latexmk can be used by itself + without the make program. In a complex project it simply needs to be + suitably configured. A standard configuration would be to define cus- + tom dependencies to make graphics files from their source files (e.g., + as created by the xfig program). Custom dependencies are latexmk's + equivalent of pattern rules in Makefiles. + + Nevertheless there are projects for which a Makefile is appropriate, and it is useful to know how to use latexmk from a Makefile. A typical - 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 - OS-X systems. They may need modifications for other versions of make. + 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 latexmk, as is suitable for a straightforward LaTeX document. For this @@ -2889,17 +2896,10 @@ LATEXMK(1L) LATEXMK(1L) But something better is needed in more complicated situations, for example, when the making of graphics files needs to be specified by - rules in the Makefile. To do this, one can use a Makefile like the - following: - - TARGETS = document1.pdf document2.pdf - DEPS_DIR = .deps - LATEXMK = latexmk -recorder -use-make -deps \ - -e 'warn qq(In Makefile, turn off custom dependencies0;' \ - 19 August 2012 44 + 11 November 2012 44 @@ -2908,6 +2908,13 @@ LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) LATEXMK(1L) + rules in the Makefile. To do this, one can use a Makefile like the + following: + + TARGETS = document1.pdf document2.pdf + DEPS_DIR = .deps + LATEXMK = latexmk -recorder -use-make -deps \ + -e 'warn qq(In Makefile, turn off custom dependencies0;' \ -e '@cus_dep_list = ();' \ -e 'show_cus_dep();' all : $(TARGETS) @@ -2954,18 +2961,11 @@ LATEXMK(1L) LATEXMK(1L) delegated to make. -SEE ALSO - latex(1), bibtex(1). -BUGS - Sometimes a viewer (gv) tries to read an updated .ps or .pdf file after - its creation is started but before the file is complete. Work around: - manually refresh (or reopen) display. Or use one of the other preview- - ers and update methods. - 19 August 2012 45 + 11 November 2012 45 @@ -2974,6 +2974,15 @@ BUGS LATEXMK(1L) LATEXMK(1L) +SEE ALSO + latex(1), bibtex(1). + +BUGS + Sometimes a viewer (gv) tries to read an updated .ps or .pdf file after + its creation is started but before the file is complete. Work around: + manually refresh (or reopen) display. Or use one of the other preview- + ers and update methods. + (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 @@ -2995,7 +3004,7 @@ THANKS TO AUTHOR Current version, by John Collins (username collins at node - phys.psu.edu). (Version 4.33c). + phys.psu.edu). (Version 4.35). Released version can be obtained from CTAN: , and from the author's website @@ -3022,15 +3031,6 @@ AUTHOR - - - - - - - - - - 19 August 2012 46 + 11 November 2012 46 -- cgit v1.2.3