summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/support/latexmk/latexmk.txt
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-01-02 21:32:25 +0000
committerKarl Berry <karl@freefriends.org>2015-01-02 21:32:25 +0000
commit90d985dd123974027ec2b4e7da30f744b803b6bd (patch)
tree35ca2b4654185ad8a3dba4e3d3b8c68a64121f5e /Master/texmf-dist/doc/support/latexmk/latexmk.txt
parentb943cdf8beb44268e9ec30be3b91415d06a3609d (diff)
latexmk (2jan15)
git-svn-id: svn://tug.org/texlive/trunk@35947 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/latexmk/latexmk.txt')
-rw-r--r--Master/texmf-dist/doc/support/latexmk/latexmk.txt1718
1 files changed, 910 insertions, 808 deletions
diff --git a/Master/texmf-dist/doc/support/latexmk/latexmk.txt b/Master/texmf-dist/doc/support/latexmk/latexmk.txt
index bda111a4768..73089bea4b6 100644
--- a/Master/texmf-dist/doc/support/latexmk/latexmk.txt
+++ b/Master/texmf-dist/doc/support/latexmk/latexmk.txt
@@ -1,4 +1,9 @@
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
NAME
latexmk - generate LaTeX document
@@ -53,15 +58,10 @@ DESCRIPTION
gv) will then automatically update its display. Thus the user can sim-
ply edit a file and, when the changes are written to disk, latexmk com-
pletely automates the cycle of updating the .dvi (and possibly the .ps
- and .pdf) file, and refreshing the previewer's display. It's not quite
- WYSIWYG, but usefully close.
-
- For other previewers, the user may have to manually make the previewer
- update its display, which can be (some versions of xdvi and gsview) as
- 1
+ 1 January 2015 1
@@ -70,6 +70,11 @@ DESCRIPTION
LATEXMK(1L) LATEXMK(1L)
+ and .pdf) file, and refreshing the previewer's display. It's not quite
+ WYSIWYG, but usefully close.
+
+ For other previewers, the user may have to manually make the previewer
+ update its display, which can be (some versions of xdvi and gsview) as
simple as forcing a redraw of its display.
Latexmk has the ability to print a banner in gray diagonally across
@@ -119,15 +124,10 @@ LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE
tions. Some of the options for these programs also trigger special
action or behavior by latexmk, in which case they have specific expla-
nations in this document. Otherwise, they are just passed through to a
- called latex or pdflatex program. Run latexmk with the -showextraop-
- tions to get a list of the options that latexmk accepts and that are
- simply passed through to latex or pdflatex (etc). See also the expla-
- nation of the -showextraoptions option for more information.
-
- 2 December 2013 2
+ 1 January 2015 2
@@ -136,6 +136,11 @@ LATEXMK OPTIONS AND ARGUMENTS ON COMMAND LINE
LATEXMK(1L) LATEXMK(1L)
+ called latex or pdflatex program. Run latexmk with the -showextraop-
+ tions to get a list of the options that latexmk accepts and that are
+ simply passed through to latex or pdflatex (etc). See also the expla-
+ nation of the -showextraoptions option for more information.
+
Note 2: In this documentation, the program pdflatex is often referred
to. Users of programs like lualatex and xelatex should know that from
latexmk's point of view, these other programs behave like pdflatex,
@@ -186,23 +191,22 @@ LATEXMK(1L) LATEXMK(1L)
When the source file uses bbl files for bibliography, run bibtex
or biber as needed to regenerate the bbl files.
- This property can also be configured by setting the $bibtex_use
- variable to 2 in a configuration file
-
- -bibtex-
- Never run bibtex or biber.
+ 1 January 2015 3
- 2 December 2013 3
+LATEXMK(1L) LATEXMK(1L)
-LATEXMK(1L) LATEXMK(1L)
+ This property can also be configured by setting the $bibtex_use
+ variable to 2 in a configuration file
+ -bibtex-
+ Never run bibtex or biber.
A common use for this option is when a document comes from an
external source, complete with its bbl file(s), and the user
@@ -232,8 +236,8 @@ LATEXMK(1L) LATEXMK(1L)
-bm <message>
A banner message to print diagonally across each page when con-
verting the dvi file to postscript. The message must be a sin-
- gle argument on the command line so be careful with quoting
- spaces and such.
+ gle argument on the command line so be careful with quoting spa-
+ ces and such.
Note that if the -bm option is specified, the -ps option is
assumed.
@@ -251,19 +255,11 @@ LATEXMK(1L) LATEXMK(1L)
message. The default is 220.0 which is just right for 5 charac-
ter messages.
- -commands
- List the commands used by latexmk for processing files, and then
- exit.
- -c Clean up (remove) all regeneratable files generated by latex and
- bibtex or biber except dvi, postscript and pdf. These files are
- a combination of log files, aux files, latexmk's database file
- of source file information, and those with extensions specified
- in the @generated_exts configuration variable. In addition,
- 2 December 2013 4
+ 1 January 2015 4
@@ -272,6 +268,15 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
+ -commands
+ List the commands used by latexmk for processing files, and then
+ exit.
+
+ -c Clean up (remove) all regeneratable files generated by latex and
+ bibtex or biber except dvi, postscript and pdf. These files are
+ a combination of log files, aux files, latexmk's database file
+ of source file information, and those with extensions specified
+ in the @generated_exts configuration variable. In addition,
files specified by the $clean_ext configuration variable are
removed.
@@ -318,29 +323,28 @@ LATEXMK(1L) LATEXMK(1L)
dvi, pdf, etc) will be relative to the current directory rather
than the source file.
- This is the default behavior and corresponds to the behavior of
- the latex and pdflatex programs. However, it is not desirable
- behavior when latexmk is invoked by a GUI configured to invoke
- latexmk with a full pathname for the source file. See the -cd
- option.
-
- -CF Remove the file containing the database of source file informa-
- tion, before doing the other actions requested.
- -d Set draft mode. This prints the banner message "DRAFT" across
- your page when converting the dvi file to postscript. Size and
+ 1 January 2015 5
- 2 December 2013 5
+LATEXMK(1L) LATEXMK(1L)
-LATEXMK(1L) LATEXMK(1L)
+ This is the default behavior and corresponds to the behavior of
+ the latex and pdflatex programs. However, it is not desirable
+ behavior when latexmk is invoked by a GUI configured to invoke
+ latexmk with a full pathname for the source file. See the -cd
+ option.
+ -CF Remove the file containing the database of source file informa-
+ tion, before doing the other actions requested.
+ -d Set draft mode. This prints the banner message "DRAFT" across
+ your page when converting the dvi file to postscript. Size and
intensity can be modified with the -bs and -bi options. The -bm
option will override this option as this is really just a short
way of specifying:
@@ -384,6 +388,18 @@ LATEXMK(1L) LATEXMK(1L)
the output is sent to stdout.
Use of this option also turns on the output of the list of
+
+
+
+ 1 January 2015 6
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
dependent files after processing.
-dF Dvi file filtering. The argument to this option is a filter
@@ -399,20 +415,8 @@ LATEXMK(1L) LATEXMK(1L)
-diagnostics
Print detailed diagnostics during a run. This may help for
- debugging problems or to understand latexmk's behavior in
-
-
-
- 2 December 2013 6
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
- difficult situations.
+ debugging problems or to understand latexmk's behavior in diffi-
+ cult situations.
-dvi Generate dvi version of document.
@@ -451,6 +455,17 @@ LATEXMK(1L) LATEXMK(1L)
string in a way that is independent of both the shell and the
operating-system.)
+
+
+ 1 January 2015 7
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
The above command line will NOT work under MS-Windows with
cmd.exe or command.com or 4nt.exe. For MS-Windows with these
command shells you could use
@@ -471,18 +486,6 @@ LATEXMK(1L) LATEXMK(1L)
Note: "Further processing" means the running of other programs
or the rerunning of latex (etc) that would be done if no errors
-
-
-
- 2 December 2013 7
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
had occurred. If instead, or additionally, you want the latex
(etc) program not to pause for user input after an error, you
should arrange this by an option that is passed to the program,
@@ -516,7 +519,20 @@ LATEXMK(1L) LATEXMK(1L)
programs is part of latexmk's implementation of -jobname.
- -l Run in landscape mode, using the landscape mode for the preview-
+ -l
+
+
+
+ 1 January 2015 8
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
+ Run in landscape mode, using the landscape mode for the preview-
ers and the dvi to postscript converters. This option is not
normally needed nowadays, since current previewers normally
determine this information automatically.
@@ -543,17 +559,6 @@ LATEXMK(1L) LATEXMK(1L)
using the -e option with a suitable line of Perl code to set the
$latex variable. See the explanation of the -e option.
-
-
- 2 December 2013 8
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
-lualatex
Use lualatex. That is, use lualatex to process the source
file(s) to pdf (in place of pdflatex). This option is exactly
@@ -581,6 +586,18 @@ LATEXMK(1L) LATEXMK(1L)
the same file and not start a new one if a previous previewer is
running. However, its test sometimes fails (notably if there is
an already-running previewer that is viewing a file of the same
+
+
+
+ 1 January 2015 9
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
name as the current file, but in a different directory). This
option turns off the default behavior.
@@ -603,29 +620,17 @@ LATEXMK(1L) LATEXMK(1L)
N.B. Normally the initialization files are read and obeyed, and
then command line options are obeyed in the order they are
- encountered. Then -norc is an exception to this rule: it is
- acted on first, no matter where is occurs on the command line.
+ encountered. But -norc is an exception to this rule: it is
+ acted on first, no matter where it occurs on the command line.
-outdir=FOO or -output-directory=FOO
Sets the directory for the output files of (pdf)latex. This
achieves its effect by the -output-directory option of
- (pdf)latex, which currently (Dec. 2011) is implemented on the
- common versions of (pdf)latex, i.e., MiKTeX and TeXLive. It may
-
-
-
- 2 December 2013 9
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
- not be present in other versions.
+ (pdf)latex, which currently (Dec. 2011 and later) is implemented
+ on the common versions of (pdf)latex, i.e., MiKTeX and TeXLive.
+ It may not be present in other versions.
See also the -auxdir/-aux-directory options, and the $aux_dir,
$out_dir, and $search_path_separator configuration variables of
@@ -647,6 +652,18 @@ LATEXMK(1L) LATEXMK(1L)
under MS-Windows you must have suitable program(s) available,
and you must have configured the print commands used by latexmk.
This can be non-trivial. See the documentation on the $lpr,
+
+
+
+ 1 January 2015 10
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
$lpr_dvi, and $lpr_pdf configuration variables to see how to set
the commands for printing.
@@ -684,18 +701,6 @@ LATEXMK(1L) LATEXMK(1L)
The specification of the contents of the string are the same as
for the $pdflatex configuration variable. Depending on your
operating system and the command-line shell you are using, you
-
-
-
- 2 December 2013 10
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
may need to change the single quotes to double quotes (or some-
thing else).
@@ -713,6 +718,18 @@ LATEXMK(1L) LATEXMK(1L)
To set the command for running latex (rather than the command
for pdflatex) see the -latex option.
+
+
+
+ 1 January 2015 11
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
Note that the effect of this option can also be achieved by
using the -e option with a suitable line of Perl code to set the
$pdflatex variable. See the explanation of the -e option.
@@ -754,31 +771,31 @@ LATEXMK(1L) LATEXMK(1L)
select the kind of file to be previewed (dvi, ps or pdf). Oth-
erwise the viewer views the "highest" kind of file selected, by
the -dvi, -ps, -pdf, -pdfps options, in the order dvi, ps, pdf
- (low to high). If no file type has been selected, the dvi
+ (low to high). If no file type has been selected, the dvi pre-
+ viewer will be used. This option is incompatible with the -p
+ and -pvc options, so it turns them off.
+ -pv- Turn off -pv.
+ -pvc Run a file previewer and continually update the .dvi, .ps,
+ and/or .pdf files whenever changes are made to source files (see
+ the Description above). Which of these files is generated and
+ which is viewed is governed by the other options, and is the
+ same as for the -pv option. The preview-continuous option -pvc
+ can only work with one file. So in this case you will normally
+ only specify one filename on the command line. It is also
- 2 December 2013 11
+ 1 January 2015 12
-LATEXMK(1L) LATEXMK(1L)
- previewer will be used. This option is incompatible with the -p
- and -pvc options, so it turns them off.
+LATEXMK(1L) LATEXMK(1L)
- -pv- Turn off -pv.
- -pvc Run a file previewer and continually update the .dvi, .ps,
- and/or .pdf files whenever changes are made to source files (see
- the Description above). Which of these files is generated and
- which is viewed is governed by the other options, and is the
- same as for the -pv option. The preview-continuous option -pvc
- can only work with one file. So in this case you will normally
- only specify one filename on the command line. It is also
incompatible with the -p and -pv options, so it turns these
options off.
@@ -826,10 +843,17 @@ LATEXMK(1L) LATEXMK(1L)
line are acted on in the order they are given. Therefore if an
initialization file is specified by the -r option, it is read
during this second step. Thus an initialization file specified
+ with the -r option can override both the standard initialization
+ files and previously specified options. But all of these can be
+ overridden by later options.
+
+ The contents of the RC file just comprise a piece of code in the
+ Perl programming language (typically a sequence of assignment
+ statements); they are executed when the -r option is encountered
- 2 December 2013 12
+ 1 January 2015 13
@@ -838,13 +862,6 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- with the -r option can override both the standard initialization
- files and previously specified options. But all of these can be
- overridden by later options.
-
- The contents of the RC file just comprise a piece of code in the
- Perl programming language (typically a sequence of assignment
- statements); they are executed when the -r option is encountered
during latexmk's parsing of its command line. See the -e option
for a way of giving initialization code directly on latexmk's
command line. An error results in latexmk stopping. Multiple
@@ -868,39 +885,41 @@ 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.
- 2 December 2013 13
+ 1 January 2015 14
@@ -909,8 +928,19 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- options are: -jobname=STRING, -aux-directory=dir, -output-direc-
- tory=DIR, -quiet, and -recorder.
+ -logfilewarninglist
+ -logfilewarnings After a run of (pdf)latex, give a list of warn-
+ ings about undefined citations and references (unless silent
+ mode is on).
+
+ See also the $silence_logfile_warnings configuration variable.
+
+
+ -logfilewarninglist-
+ -logfilewarnings- After a run of (pdf)latex, do not give a list
+ of warnings about undefined citations and references. (Default)
+
+ See also the $silence_logfile_warnings configuration variable.
-silent
@@ -919,36 +949,51 @@ LATEXMK(1L) LATEXMK(1L)
tings, the command "latex -interaction=batchmode" is used for
latex.
- Also reduce the number of informational messages that latexmk
+ See also the -logfilewarninglist and -logfilewarninglist-
+ options.
+
+ 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,
$dvips_silent_switch, $latex_silent_switch, $makein-
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.
+
+
+
+ 1 January 2015 15
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
(Default.)
-v, -version
@@ -965,31 +1010,19 @@ 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:
-
-
-
- 2 December 2013 14
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
-pdflatex="xelatex %O %S" -pdf -dvi- -ps-
Compatibility between options
- 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.
@@ -1014,70 +1047,84 @@ EXAMPLES
+
+
+
+
+ 1 January 2015 16
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
HOW TO CHANGE THE WAY LATEXMK BEHAVES, DEALING WITH PROBLEMS, ETC
Some possibilities:
- a. If you get a strange error, do look carefully at the output that is
- on the screen and in log files. While there is much that is notori-
+ a. If you get a strange error, do look carefully at the output that is
+ on the screen and in log files. While there is much that is notori-
ously verbose in the output of latex (and that is added to by latexmk),
- the verbosity is there for a reason: to enable the user to diagnose
- problems. Latexmk does repeat some messages at the end of a run that
- it thinks would otherwise be easy to miss in the middle of other out-
+ the verbosity is there for a reason: to enable the user to diagnose
+ problems. Latexmk does repeat some messages at the end of a run that
+ it thinks would otherwise be easy to miss in the middle of other out-
put.
- b. If latexmk doesn't do things the way you would like, the first step
- in finding out what to do is to look in this documentation at the list
- of command line options and then at the sections on configuration/ini-
+ b. If latexmk doesn't do things the way you would like, the first step
+ in finding out what to do is to look in this documentation at the list
+ of command line options and then at the sections on configuration/ini-
tialization files. A lot of latexmk's behavior is configurable to deal
with particular situations. (But there is a lot of reading.)
- c. Further tricks can involve replacing the standard commands that
+ c. Further tricks can involve replacing the standard commands that
latexmk by other commands or scripts.
- d. For possible examples of code for use in an RC file, see the direc-
- tory example_rcfiles in the distribution of latexmk (e.g., at
+ d. For possible examples of code for use in an RC file, see the direc-
+ tory example_rcfiles in the distribution of latexmk (e.g., at
http://www.ctan.org/tex-archive/support/latexmk/example_rcfiles). Even
- if these examples don't do what you want, they may provide suitable
+ if these examples don't do what you want, they may provide suitable
inspiration.
+ e. There's a useful trick that can be used when you are lualatex
+ instead of pdflatex (and in some related situations). The problem is
+ that latexmk won't notice a dependency on a file, bar.baz say, that is
+ input by the lua code in your document instead of by the LaTeX part.
+ (Thus if you change bar.baz and rerun latexmk, then latexmk will think
+ no files have changed and not rerun lualatex, whereas if you had
+ '\input{bar.baz}' in the LaTeX part of the document, latexmk would
+ notice the change.) One solution is just to put the following some-
+ where in the LaTeX part of the document:
+ \typeout{(bar.baz)}
- 2 December 2013 15
+ This puts a line in the log file that latexmk will treat as implying
+ that the file bar.baz was read. (At present I don't know a way of
+ doing this automatically.) Of course, if the file has a different
+ name, change bar.baz to the name of your file.
+ f. Look on tex.stackexchange, i.e., at http://tex.stackex-
+ change.com/questions/tagged/latexmk Someone may have already solved
+ your problem.
+ g. Ask a question at tex.stackexchange.com.
+ h. Or ask me (the author of latexmk). My e-mail is at the end of this
+ documentation.
-LATEXMK(1L) LATEXMK(1L)
- e. There's a useful trick that can be used when you are lualatex
- instead of pdflatex (and in some related situations). The problem is
- that latexmk won't notice a dependency on a file, bar.baz say, that is
- input by the lua code in your document instead of by the LaTeX part.
- (Thus if you change bar.baz and rerun latexmk, then latexmk will think
- no files have changed and not rerun lualatex, whereas if you had
- '\input{bar.baz}' in the LaTeX part of the document, latexmk would
- notice the change.) One solution is just to put the following some-
- where in the LaTeX part of the document:
- \typeout{(bar.baz)}
- This puts a line in the log file that latexmk will treat as implying
- that the file bar.baz was read. (At present I don't know a way of
- doing this automatically.) Of course, if the file has a different
- name, change bar.baz to the name of your file.
+ 1 January 2015 17
- f. Look on tex.stackexchange, i.e., at http://tex.stackex-
- change.com/questions/tagged/latexmk Someone may have already solved
- your problem.
- g. Ask a question at tex.stackexchange.com.
- h. Or ask me (the author of latexmk). My e-mail is at the end of this
- documentation.
+LATEXMK(1L) LATEXMK(1L)
+
CONFIGURATION/INITIALIZATION (RC) FILES
Latexmk can be customized using initialization files, which are read at
@@ -1090,12 +1137,14 @@ 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",
"/usr/local/share/latexmk/LatexMk",
"/usr/local/lib/latexmk/LatexMk".
+ In addition, it then tries the same set of locations, but with the
+ file name replaced "LatexMk" replaced by "latexmkrc".
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-
@@ -1111,17 +1160,6 @@ CONFIGURATION/INITIALIZATION (RC) FILES
4) Any RC file(s) specified on the command line with the -r option.
-
-
- 2 December 2013 16
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
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
@@ -1142,6 +1180,18 @@ LATEXMK(1L) LATEXMK(1L)
HOW TO SET VARIABLES IN INITIALIZATION FILES
The important variables that can be configured are described in the
+
+
+
+ 1 January 2015 18
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
section "List of configuration variables usable in initialization
files". Syntax for setting these variables is of the following forms:
@@ -1182,17 +1232,6 @@ FORMAT OF COMMAND SPECIFICATIONS
view a postscript file. This section describes some important features
of how the commands are specified.
-
-
- 2 December 2013 17
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
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
@@ -1207,6 +1246,18 @@ LATEXMK(1L) LATEXMK(1L)
for this command. (E.g., if you used the -silent option it would
replace %O by "-interaction=batchmode".)
+
+
+
+ 1 January 2015 19
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
The available placeholders are:
%B base of filename for current command. E.g., if a postscript
@@ -1252,81 +1303,85 @@ LATEXMK(1L) LATEXMK(1L)
on your system, you can turn it off -- see the documentation for the
variable $quote_filenames.
+ The distinction between %B and %R needs a bit of care, since they are
+ often the same, but not always. For example on a simple document, the
+ basename of a bibtex run is the same as for the texfile. But in a doc-
+ ument with several bibliographies, the bibliography files will have a
+ variety of names. Since bibtex is invoked with the basename of the
+ bibliography file, the setting for the bibtex command should therefore
+ be
+ $bibtex = 'bibtex %O %B';
- 2 December 2013 18
-
+ 1 January 2015 20
-LATEXMK(1L) LATEXMK(1L)
- The distinction between %B and %R needs a bit of care, since they are
- often the same, but not always. For example on a simple document, the
- basename of a bibtex run is the same as for the texfile. But in a doc-
- ument with several bibliographies, the bibliography files will have a
- variety of names. Since bibtex is invoked with the basename of the
- bibliography file, the setting for the bibtex command should therefore
- be
+LATEXMK(1L) LATEXMK(1L)
- $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.
+ poses, the name %T of the primary texfile is not a useful placeholder.
- See the default values in the section "List of configuration variables
+ See the default values in the section "List of configuration variables
usable in initialization files" for what is normally the most appropri-
ate usage.
If you omit to supply any placeholders whatever in the specification of
- a command, latexmk will supply what its author thinks are appropriate
+ a command, latexmk will supply what its author thinks are appropriate
defaults. This gives compatibility with configuration files for previ-
ous versions of latexmk, which didn't use placeholders.
- "Detaching" a command: Normally when latexmk runs a command, it waits
+ "Detaching" a command: Normally when latexmk runs a command, it waits
for the command to run to completion. This is appropriate for commands
like latex, of course. But for previewers, the command should normally
- run detached, so that latexmk gets the previewer running and then
+ run detached, so that latexmk gets the previewer running and then
returns to its next task (or exits if there is nothing else to do). To
- achieve this effect of detaching a command, you need to precede the
+ achieve this effect of detaching a command, you need to precede the
command name with "start ", as in
$dvi_previewer = 'start xdvi %O %S';
- This will be translated to whatever is appropriate for your operating
+ This will be translated to whatever is appropriate for your operating
system.
- Notes: (1) In some circumstances, latex will always run a command
+ Notes: (1) In some circumstances, latex will always run a command
detached. This is the case for a previewer in preview continuous mode,
- since otherwise previewing continuously makes no sense. (2) This pre-
- cludes the possibility of running a command named start. (3) If the
- word start occurs more than once at the beginning of the command
- string, that is equivalent to having just one. (4) Under cygwin, some
- complications happen, since cygwin amounts to a complicated merging of
- UNIX and MS-Windows. See the source code for how I've handled the
+ since otherwise previewing continuously makes no sense. (2) This pre-
+ cludes the possibility of running a command named start. (3) If the
+ word start occurs more than once at the beginning of the command
+ string, that is equivalent to having just one. (4) Under cygwin, some
+ complications happen, since cygwin amounts to a complicated merging of
+ UNIX and MS-Windows. See the source code for how I've handled the
problem.
Command names containing spaces: Under MS-Windows it is common that the
name of a command includes spaces, since software is often installed in
- a subdirectory of "C:\Program Files". Such command names should be
+ a subdirectory of "C:\Program Files". Such command names should be
enclosed in double quotes, as in
$lpr_pdf = '"c:/Program Files/Ghostgum/gsview/gsview32.exe" /p
%S';
$pdf_previewer = 'start "c:/Program Files/SumatraPDF/Suma-
traPDF.exe" %O %S';
- $pdf_previewer = 'start "c:/Program Files/SumatraPDF (x86)/Suma-
+ $pdf_previewer = 'start "c:/Program Files/SumatraPDF (x86)/Suma-
traPDF.exe" %O %S';
- (Note about the above example: Forward slashes are equivalent to
+ (Note about the above example: Forward slashes are equivalent to back-
+ slashes in filenames under MS-Windows, provided that the filename is
+ inside double quotes. It is easier to use forward slashes in examples
+ like the one above, since then one does not have to worry about the
+ rules for dealing with forward slashes in strings in the Perl lan-
+ guage.)
- 2 December 2013 19
+ 1 January 2015 21
@@ -1335,32 +1390,26 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- backslashes in filenames under MS-Windows, provided that the filename
- is inside double quotes. It is easier to use forward slashes in exam-
- ples like the one above, since then one does not have to worry about
- the rules for dealing with forward slashes in strings in the Perl lan-
- guage.)
-
- Command names under Cygwin: If latexmk is executed by Cygwin's Perl,
+ Command names under Cygwin: If latexmk is executed by Cygwin's Perl,
be particularly certain that pathnames in commands have forward slashes
- not the usual backslashes for the separator of pathname components.
- See the above examples. Backslashes often get misinterpreted by the
+ not the usual backslashes for the separator of pathname components.
+ See the above examples. Backslashes often get misinterpreted by the
Unix shell used by Cygwin's Perl to execute external commands. Forward
slashes don't suffer from this problem, and (when quoted, as above) are
equally acceptable to MS-Windows.
- Using MS-Windows file associations: A useful trick under modern ver-
+ Using MS-Windows file associations: A useful trick under modern ver-
sions of MS-Windows (e.g., WinXP) is to use just the command 'start' by
itself:
$dvi_previewer = 'start %S';
Under recent versions of MS-Windows, this will cause to be run whatever
- program the system has associated with dvi files. (The same applies
+ program the system has associated with dvi files. (The same applies
for a postscript viewer and a pdf viewer.) But note that this trick is
- not always suitable for the pdf previwer, if your system has acroread
+ not always suitable for the pdf previwer, if your system has acroread
for the default pdf viewer. As explained elsewhere, acroread under MS-
- Windows does not work well with latex and latexmk, because acroread
+ Windows does not work well with latex and latexmk, because acroread
locks the pdf file.
Not using a certain command: If a command is not to be run, the command
@@ -1368,19 +1417,18 @@ LATEXMK(1L) LATEXMK(1L)
$lpr = 'NONE lpr';
- This typically is used when an appropriate command does not exist on
+ This typically is used when an appropriate command does not exist on
your system. The string after the "NONE" is effectively a comment.
Options to commands: Setting the name of a command can be used not only
for changing the name of the command called, but also to add options to
- command. Suppose you want latexmk to use latex with source specials
- enabled. Then you might use the following line in an initialization
+ command. Suppose you want latexmk to use latex with source specials
+ enabled. Then you might use the following line in an initialization
file:
$latex = 'latex --src-specials %O %S';
-
- Running a subroutine instead of an external command: Use a specifica-
+ Running a subroutine instead of an external command: Use a specifica-
tion starting with "internal", as in
$latex = 'internal mylatex %O %S';
@@ -1390,14 +1438,16 @@ 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
+ Advanced tricks: Normally one specifies a single command for the com-
+ mands invoked by latexmk. Naturally, if there is some complicated
additional processing you need to do in your special situation, you can
+ write a script (or batch file) to do the processing, and then configure
+ latexmk to use your script in place of the standard program.
+
- 2 December 2013 20
+ 1 January 2015 22
@@ -1406,19 +1456,16 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- write a script (or batch file) to do the processing, and then configure
- latexmk to use your script in place of the standard program.
-
It is also possible to configure latexmk to run multiple commands. For
- example, if when running pdflatex to generate a pdf file from a tex
- file you need to run another program after pdflatex to perform some
+ example, if when running pdflatex to generate a pdf file from a tex
+ file you need to run another program after pdflatex to perform some
extra processing, you could do something like:
- $pdflatex = 'pdflatex --shell-escape %O %S; pst2pdf_for_latexmk
+ $pdflatex = 'pdflatex --shell-escape %O %S; pst2pdf_for_latexmk
%B';
- This definition assumes you are using a UNIX-like system (which
- includes Linux and OS-X), so that the two commands to be run are sepa-
+ This definition assumes you are using a UNIX-like system (which
+ includes Linux and OS-X), so that the two commands to be run are sepa-
rated by the semicolon in the middle of the string.
If you are using MS-Windows, you would replace the above line by
@@ -1426,9 +1473,9 @@ LATEXMK(1L) LATEXMK(1L)
$pdflatex = 'cmd /c pdflatex --shell-escape %O %S'
. '&& pst2pdf_for_latexmk %B';
- Here, the UNIX command separator ; is replaced by &&. In addition,
+ Here, the UNIX command separator ; is replaced by &&. In addition,
there is a problem that some versions of Perl on MS-Windows do not obey
- the command separator; this problem is overcome by explicitly invoking
+ the command separator; this problem is overcome by explicitly invoking
the MS-Windows command-line processor cmd.exe.
@@ -1437,38 +1484,36 @@ LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES
$always_view_file_via_temporary [0]
Whether ps and pdf files are initially to be made in a temporary
- directory and then moved to the final location. (This applies
+ directory and then moved to the final location. (This applies
to dvips, dvipdf, and ps2pdf operations, and the filtering oper-
- ators on dvi and ps files. It does not apply to pdflatex,
+ ators on dvi and ps files. It does not apply to pdflatex,
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
+ 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.
See the $pvc_view_file_via_temporary variable for a setting that
- applies only if preview-continuous mode (-pvc option) is used.
+ applies only if preview-continuous mode (-pvc option) is used.
See $tmpdir for the setting of the directory where the temporary
file is created.
$auto_rc_use [1]
- Whether to automatically read the standard initialization (rc)
+ Whether to automatically read the standard initialization (rc)
files, which are the system RC file, the user's RC file, and the
RC file in the current directory. The command line option -norc
- can be used to turn this setting off. Each RC file could also
- turn this setting off, i.e., it could set $auto_rc_use to zero
+ can be used to turn this setting off. Each RC file could also
+ turn this setting off, i.e., it could set $auto_rc_use to zero
to prevent automatic reading of the later RC files.
- This variable does not affect the reading of RC files specified
- on the command line by the -r option.
-
+ This variable does not affect the reading of RC files specified
- 2 December 2013 21
+ 1 January 2015 23
@@ -1477,25 +1522,28 @@ LIST OF CONFIGURATION VARIABLES USABLE IN INITIALIZATION FILES
LATEXMK(1L) LATEXMK(1L)
+ on the command line by the -r option.
+
+
$aux_dir [""]
The directory in which auxiliary files (aux, log, etc) are to be
- written by a run of (pdf)latex. If this variable is not set,
- but $out_dir is set, then $aux_dir is set to $out_dir, which is
+ written by a run of (pdf)latex. If this variable is not set,
+ but $out_dir is set, then $aux_dir is set to $out_dir, which is
the directory to which general output files are to be written.
- Important note: The effect of $aux_dir, if different from
- $out_dir, is achieved by giving (pdf)latex the -aux-directory.
- Currently (Dec. 2011) this only works on the MiKTeX version of
- (pdf)latex.
+ Important note: The effect of $aux_dir, if different from
+ $out_dir, is achieved by giving (pdf)latex the -aux-directory.
+ Currently (Dec. 2011 and later) this only works on the MiKTeX
+ version of (pdf)latex.
See also the documentation of $out_dir for some complications on
what directory names are suitable.
$banner [0]
- If nonzero, the banner message is printed across each page when
- converting the dvi file to postscript. Without modifying the
- variable $banner_message, this is equivalent to specifying the
+ If nonzero, the banner message is printed across each page when
+ converting the dvi file to postscript. Without modifying the
+ variable $banner_message, this is equivalent to specifying the
-d option.
Note that if $banner is nonzero, the $postscript_mode is assumed
@@ -1504,7 +1552,7 @@ LATEXMK(1L) LATEXMK(1L)
$banner_intensity [0.95]
Equivalent to the -bi option, this is a decimal number between 0
- and 1 that specifies how dark to print the banner message. 0 is
+ and 1 that specifies how dark to print the banner message. 0 is
black, 1 is white. The default is just right if your toner car-
tridge isn't running too low.
@@ -1513,33 +1561,25 @@ LATEXMK(1L) LATEXMK(1L)
dvi file to postscript. This is equivalent to the -bm option.
$banner_scale [220.0]
- A decimal number that specifies how large the banner message
- will be printed. Experimentation is necessary to get the right
- scale for your message, as a rule of thumb the scale should be
- about equal to 1100 divided by the number of characters in the
- message. The Default is just right for 5 character messages.
+ A decimal number that specifies how large the banner message
+ will be printed. Experimentation is necessary to get the right
+ scale for your message, as a rule of thumb the scale should be
+ about equal to 1100 divided by the number of characters in the
+ message. The Default is just right for 5 character messages.
This is equivalent to the -bs option.
@BIBINPUTS
- This is an array variable, now mostly obsolete, that specifies
- directories where latexmk should look for .bib files. By
+ This is an array variable, now mostly obsolete, that specifies
+ directories where latexmk should look for .bib files. By
default it is set from the BIBINPUTS environment variable of the
- operating system. If that environment variable is not set, a
- single element list consisting of the current directory is set.
+ operating system. If that environment variable is not set, a
+ single element list consisting of the current directory is set.
The format of the directory names depends on your operating sys-
tem, of course. Examples for setting this variable are:
- @BIBINPUTS = ( ".", "C:\bibfiles" );
- @BIBINPUTS = ( ".", "\\server\bibfiles" );
- @BIBINPUTS = ( ".", "C:/bibfiles" );
- @BIBINPUTS = ( ".", "//server/bibfiles" );
- @BIBINPUTS = ( ".", "/usr/local/texmf/bibtex/bib" );
-
- Note that under MS Windows, either a forward slash "/" or a
-
- 2 December 2013 22
+ 1 January 2015 24
@@ -1548,22 +1588,29 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- backward slash "\" can be used to separate pathname components,
- so the first two and the second two examples are equivalent.
- Each backward slash should be doubled to avoid running afoul of
+ @BIBINPUTS = ( ".", "C:\bibfiles" );
+ @BIBINPUTS = ( ".", "\\server\bibfiles" );
+ @BIBINPUTS = ( ".", "C:/bibfiles" );
+ @BIBINPUTS = ( ".", "//server/bibfiles" );
+ @BIBINPUTS = ( ".", "/usr/local/texmf/bibtex/bib" );
+
+ Note that under MS Windows, either a forward slash "/" or a
+ backward slash "\" can be used to separate pathname components,
+ so the first two and the second two examples are equivalent.
+ Each backward slash should be doubled to avoid running afoul of
Perl's rules for writing strings.
Important note: This variable is now mostly obsolete in the cur-
rent version of latexmk, since it has a better method of search-
- ing for files using the kpsewhich command. However, if your
- system is an unusual one without the kpsewhich command, you may
+ ing for files using the kpsewhich command. However, if your
+ system is an unusual one without the kpsewhich command, you may
need to set the variable @BIBINPUTS.
$biber ["biber %O %S"]
The biber processing program.
$biber_silent_switch ["--onlylog"]
- Switch(es) for the biber processing program when silent mode is
+ Switch(es) for the biber processing program when silent mode is
on.
$bibtex ["bibtex %O %S"]
@@ -1575,42 +1622,30 @@ LATEXMK(1L) LATEXMK(1L)
$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
+ covers from the log file that one (or more) BibTeX/biber-gener-
+ ated bibliographies are used, it can run BibTeX or biber when-
+ ever it appears necessary to regenerate the bbl file(s) from
their source bib database file(s).
- But sometimes, the bib file(s) are not available (e.g., for a
- document obtained from an external archive), but the bbl files
- are provided. In that case use of BibTeX or biber will result
- in incorrect overwriting of the precious bbl files. The vari-
- able $bibtex_use controls whether this happens. Its possible
+ But sometimes, the bib file(s) are not available (e.g., for a
+ document obtained from an external archive), but the bbl files
+ are provided. In that case use of BibTeX or biber will result
+ in incorrect overwriting of the precious bbl files. The vari-
+ able $bibtex_use controls whether this happens. Its possible
values are: 0: never use BibTeX or biber. 1: only use BibTeX or
- biber if the bib files exist. 2: run BibTeX or biber whenever
- it appears necessary to update the bbl files, without testing
+ biber if the bib files exist. 2: run BibTeX or biber whenever
+ it appears necessary to update the bbl files, without testing
for the existence of the bib files.
$cleanup_includes_cusdep_generated [0]
- If nonzero, specifies that cleanup also deletes files that are
+ If nonzero, specifies that cleanup also deletes files that are
generated by custom dependencies. (When doing a clean up, e.g.,
by use of the -C option, custom dependencies are those listed in
the .fdb_latexmk file from a previous run.)
- $cleanup_includes_generated [0]
- If nonzero, specifies that cleanup also deletes files that are
- detected in log file as being generated (see the \openout lines
- in the log file). It will also include files made from these
- first generation generated files.
-
- $cleanup_mode [0]
- If nonzero, specifies cleanup mode: 1 for full cleanup, 2 for
- cleanup except for dvi, ps and pdf files, 3 for cleanup except
- for dep and aux files. (There is also extra cleaning as speci-
- fied by the $clean_ext, $clean_full_ext and @generated_exts
-
- 2 December 2013 23
+ 1 January 2015 25
@@ -1619,17 +1654,28 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
+ $cleanup_includes_generated [0]
+ If nonzero, specifies that cleanup also deletes files that are
+ detected in log file as being generated (see the \openout lines
+ in the log file). It will also include files made from these
+ first generation generated files.
+
+ $cleanup_mode [0]
+ If nonzero, specifies cleanup mode: 1 for full cleanup, 2 for
+ cleanup except for dvi, ps and pdf files, 3 for cleanup except
+ for dep and aux files. (There is also extra cleaning as speci-
+ fied by the $clean_ext, $clean_full_ext and @generated_exts
variables.)
- This variable is equivalent to specifying one of the -c or -C
- options. But there should be no need to set this variable from
+ This variable is equivalent to specifying one of the -c or -C
+ options. But there should be no need to set this variable from
an RC file.
$clean_ext [""]
- Extra extensions of files for latexmk to remove when any of the
- clean-up options (-c or -C) is selected. The value of this
- variable is a string containing the extensions separated by
- spaces.
+ Extra extensions of files for latexmk to remove when any of the
+ clean-up options (-c or -C) is selected. The value of this
+ variable is a string containing the extensions separated by spa-
+ ces.
It is also possible to specify a more general pattern of file to
be deleted, by using the place holder %R, as in commands, and it
@@ -1638,21 +1684,21 @@ LATEXMK(1L) LATEXMK(1L)
$clean_ext = "out %R-blx.bib %R-figures*.log";
in an initialization file will imply that when a clean-up opera-
- tion is specified, not only is the standard set of files
- deleted, but also files of the form FOO.out, FOO-blx.bib, and
- %R-figures*.log, where FOO stands for the basename of the file
+ tion is specified, not only is the standard set of files
+ deleted, but also files of the form FOO.out, FOO-blx.bib, and
+ %R-figures*.log, where FOO stands for the basename of the file
being processed (as in FOO.tex).
$clean_full_ext [""]
- Extra extensions of files for latexmk to remove when the -C
+ Extra extensions of files for latexmk to remove when the -C
option is selected, i.e., extensions of files to remove when the
.dvi, etc files are to be cleaned-up.
More general patterns are allowed, as for $clean_ext.
- $compiling_cmd [undefined], $failure_cmd [undefined], $success_cmd
+ $compiling_cmd [undefined], $failure_cmd [undefined], $success_cmd
[undefined]
These variables specify commands that are executed at certain
@@ -1661,53 +1707,53 @@ LATEXMK(1L) LATEXMK(1L)
indications of compilation status even when the window receiving
the screen output of the compilation is hidden.
- The commands are executed at the following points: $compil-
- ing_cmd at the start of compilation, $success_cmd at the end of
- a successful compilation, and $failure_cmd at the end of an
- unsuccessful compilation. If any of above variables is unde-
- fined (the default situation) or blank, then the corresponding
- command is not executed.
+ The commands are executed at the following points:
- An example of a typical setting of these variables is as follows
- $compiling_cmd = "xdotool search --name \"%D\" set_window
- --name \"%D compiling\"";
- $success_cmd = "xdotool search --name \"%D\" set_window
- --name \"%D OK\"";
- $failure_cmd = "xdotool search --name \"%D\" set_window
- --name \"%D FAILURE\"";
- These assume that the program xdotool is installed, that the
+ 1 January 2015 26
- 2 December 2013 24
+LATEXMK(1L) LATEXMK(1L)
+ $compiling_cmd at the start of compilation, $success_cmd at the
+ end of a successful compilation, and $failure_cmd at the end of
+ an unsuccessful compilation. If any of above variables is unde-
+ fined (the default situation) or blank, then the corresponding
+ command is not executed.
-LATEXMK(1L) LATEXMK(1L)
+ An example of a typical setting of these variables is as follows
+ $compiling_cmd = "xdotool search --name \"%D\" set_window
+ --name \"%D compiling\"";
+ $success_cmd = "xdotool search --name \"%D\" set_window
+ --name \"%D OK\"";
+ $failure_cmd = "xdotool search --name \"%D\" set_window
+ --name \"%D FAILURE\"";
- previewer is using an X-Window system for display, and that the
- title of the window contains the name of the displayed file, as
- it normally does. When the commands are executed, the place-
- holder string %D is replaced by the name of the destination
+ These assume that the program xdotool is installed, that the
+ previewer is using an X-Window system for display, and that the
+ title of the window contains the name of the displayed file, as
+ it normally does. When the commands are executed, the place-
+ holder string %D is replaced by the name of the destination
file, which is the previewed file. The above commands result in
an appropriate string being appended to the filename in the win-
dow title: " compiling", " OK", or " FAILURE".
- Other placeholders that can be used are %S, %T, and %R, with %S
- and %T normally being identical. These can be useful for a com-
- mand changing the title of the edit window. The visual indica-
- tion in a window title can useful, since the user does not have
- to keep shifting attention to the (possibly hidden) compilation
+ Other placeholders that can be used are %S, %T, and %R, with %S
+ and %T normally being identical. These can be useful for a com-
+ mand changing the title of the edit window. The visual indica-
+ tion in a window title can useful, since the user does not have
+ to keep shifting attention to the (possibly hidden) compilation
window to know the status of the compilation.
@cus_dep_list [()]
- Custom dependency list -- see section on "Custom Dependencies".
+ Custom dependency list -- see section on "Custom Dependencies".
@default_files [("*.tex")]
@@ -1728,6 +1774,18 @@ LATEXMK(1L) LATEXMK(1L)
@default_files = ("paper_current");
+
+
+
+ 1 January 2015 27
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
@default_files = ("paper1", "paper2.tex");
@default_files = ("*.tex", "*.dtx");
@@ -1748,139 +1806,144 @@ LATEXMK(1L) LATEXMK(1L)
Whether to display a list(s) of dependencies at the end of a
run.
+ $deps_file ["-"]
+ Name of file to receive list(s) of dependencies at the end of a
+ run, to be used if $dependesnt_list is set. If the filename is
+ "-", then the dependency list is set to stdout (i.e., normally
+ the screen).
+
$do_cd [0]
- Whether to change working directory to the directory specified
- for the main source file before processing it. The default
+ Whether to change working directory to the directory specified
+ for the main source file before processing it. The default
+ behavior is not to do this, which is the same as the behavior of
+ latex and pdflatex programs. This variable is set by the -cd
+ and -cd- options on latexmk's command line.
+ $dvi_filter [empty]
+ The dvi file filter to be run on the newly produced dvi file
+ before other processing. Equivalent to specifying the -dF
+ option.
+ $dvi_mode [See below for default]
+ If nonzero, generate a dvi version of the document. Equivalent
+ to the -dvi option.
- 2 December 2013 25
+ The variable $dvi_mode defaults to 0, but if no explicit
+ requests are made for other types of file (postscript, pdf),
+ then $dvi_mode will be set to 1. In addition, if a request for
+ a file for which a .dvi file is a prerequisite, then $dvi_mode
+ will be set to 1.
+ $dvi_previewer ["start xdvi %O %S" under UNIX]
+ The command to invoke a dvi-previewer. [Default is "start"
+ under MS-WINDOWS; under more recent versions of Windows, this
+ will cause to be run whatever command the system has associated
+ with .dvi files.]
-LATEXMK(1L) LATEXMK(1L)
+ 1 January 2015 28
- behavior is not to do this, which is the same as the behavior of
- latex and pdflatex programs. This variable is set by the -cd
- and -cd- options on latexmk's command line.
- $dvi_filter [empty]
- The dvi file filter to be run on the newly produced dvi file
- before other processing. Equivalent to specifying the -dF
- option.
- $dvi_mode [See below for default]
- If nonzero, generate a dvi version of the document. Equivalent
- to the -dvi option.
- The variable $dvi_mode defaults to 0, but if no explicit
- requests are made for other types of file (postscript, pdf),
- then $dvi_mode will be set to 1. In addition, if a request for
- a file for which a .dvi file is a prerequisite, then $dvi_mode
- will be set to 1.
+LATEXMK(1L) LATEXMK(1L)
- $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
- 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
-
-
-
- 2 December 2013 26
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
+ N.B. The standard dvipdf program runs silently, so adding the
+ silent switch has no effect, but is actually innocuous. But if
+ an alternative program is used, e.g., dvipdfmx, then the silent
+ switch has an effect. The default setting is correct for
dvipdfm and dvipdfmx.
$dvips ["dvips %O -o %D %S"]
- The program to used as a filter to convert a .dvi file to a .ps
- file. If pdf is going to be generated from pdf, then the value
+ The program to used as a filter to convert a .dvi file to a .ps
+ file. If pdf is going to be generated from pdf, then the value
of the $dvips_pdf_switch -- see below -- will be included in the
options substituted for "%O".
$dvips_landscape ["dvips -tlandscape %O -o %D %S"]
- The program to used as a filter to convert a .dvi file to a .ps
+ The program to used as a filter to convert a .dvi file to a .ps
file in landscape mode.
$dvips_pdf_switch ["-P pdf"]
- Switch(es) for dvips program when pdf file is to be generated
+ Switch(es) for dvips program when pdf file is to be generated
from ps file.
$dvips_silent_switch ["-q"]
Switch(es) for dvips program when silent mode is on.
+
+
+ 1 January 2015 29
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
$dvi_update_command [""]
- When the dvi previewer is set to be updated by running a com-
- mand, this is the command that is run. See the information for
+ 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
@@ -1898,67 +1961,67 @@ 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 )]
+ This contains a list of extensions for files that are generated
+ during a LaTeX run and that are read in by LaTeX in later runs,
+ either directly or indirectly.
+ This list has two uses: (a) to set the kinds of file to be
+ deleted in a cleanup operation (with the -c, -C, -CA, -g and -gg
+ options), and (b) in the determination of whether a rerun of
- 2 December 2013 27
+ 1 January 2015 30
-LATEXMK(1L) LATEXMK(1L)
- -f option.
+LATEXMK(1L) LATEXMK(1L)
- @generated_exts [( aux , bbl , idx , ind , lof , lot , out , toc ,
- $fdb_ext )]
- This contains a list of extensions for files that are generated
- during a LaTeX run and that are read in by LaTeX in later runs,
- either directly or indirectly.
- This list has two uses: (a) to set the kinds of file to be
- deleted in a cleanup operation (with the -c, -C, -CA, -g and -gg
- options), and (b) in the determination of whether a rerun of
(pdf)LaTeX is needed after a run that gives an error.
(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 because latexmk has a limit on the number of
+ The general rule latexmk uses for determining when an extra run
+ of some program is needed is that one of the source files has
+ changed. But consider for example a latex package that causes
+ an encapsulated postscript file (an "eps" file) to be made that
+ is to be read in on the next run. The file contains a comment
+ line giving its creation date and time. On the next run the
+ time changes, latex sees that the eps file has changed, and
+ therefore reruns latex. This causes an infinite loop, that is
+ only terminated because latexmk has a limit on the number of
runs to guard against pathological situations.
But the changing line has no real effect, since it is a comment.
@@ -1967,15 +2030,18 @@ LATEXMK(1L) LATEXMK(1L)
$hash_calc_ignore_pattern{'eps'} = '^%%CreationDate: ';
This creates a rule for files with extension .eps about lines to
- ignore. The left-hand side is a Perl idiom for setting an item
- in a hash. Note that the file extension is specified without a
+ ignore. The left-hand side is a Perl idiom for setting an item
+ in a hash. Note that the file extension is specified without a
period. The value, on the right-hand side, is a string contain-
- ing a regular expresssion. (See documentation on Perl for how
- they are to be specified in general.) This particular regular
+ 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.
- 2 December 2013 28
+ 1 January 2015 31
@@ -1984,25 +2050,21 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- 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.,
@@ -2010,46 +2072,42 @@ LATEXMK(1L) LATEXMK(1L)
$kpsewhich ["kpsewhich %S"]
- The program called to locate a source file when the name alone
- is not sufficient. Most filenames used by latexmk have suffi-
- cient path information to be found directly. But sometimes,
- notably when .bib files are found from the log file of a bibtex
- or biber run, the name of the file, but not its path is known.
+ The program called to locate a source file when the name alone
+ is not sufficient. Most filenames used by latexmk have suffi-
+ cient path information to be found directly. But sometimes,
+ notably when .bib files are found from the log file of a bibtex
+ or biber run, the name of the file, but not its path is known.
The program specified by $kpsewhich is used to find it.
- See also the @BIBINPUTS variable for another way that latexmk
+ See also the @BIBINPUTS variable for another way that latexmk
also uses to try to locate files; it applies only in the case of
.bib files.
$landscape_mode [0]
If nonzero, run in landscape mode, using the landscape mode pre-
- viewers and dvi to postscript converters. Equivalent to the -l
+ viewers and dvi to postscript converters. Equivalent to the -l
option. Normally not needed with current previewers.
$latex ["latex %O %S"]
The LaTeX processing program. Note that as with other programs,
- you can use this variable not just to change the name of the
+ you can use this variable not just to change the name of the
program used, but also specify options to the program. E.g.,
$latex = "latex --src-specials";
%latex_input_extensions
- This variable specifies the extensions tried by latexmk when it
- finds that a LaTeX run resulted in an error that a file has not
- been found, and the file is given without an extension. This
- typically happens when LaTeX commands of the form \input{file}
- or \includegraphics{figure}, when the relevant source file does
+ This variable specifies the extensions tried by latexmk when it
+ finds that a LaTeX run resulted in an error that a file has not
+ been found, and the file is given without an extension. This
+ typically happens when LaTeX commands of the form \input{file}
+ or \includegraphics{figure}, when the relevant source file does
not exist.
- In this situation, latexmk searches for custom dependencies to
- 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'.
-
+ In this situation, latexmk searches for custom dependencies to
- 2 December 2013 29
+ 1 January 2015 32
@@ -2058,11 +2116,15 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- (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
+ make the missing file(s), but restricts it to the extensions
+ specified by the variable %latex_input_extensions. The default
+ extensions are 'tex' and 'eps'.
+
+ (For Perl experts: %latex_input_extensions is a hash whose keys
+ are the extensions. The values are irrelevant.) Two subrou-
+ tines are provided for manipulating this and the related vari-
+ able %pdflatex_input_extensions, add_input_ext and
+ remove_input_ext. They are used as in the following examples
are possible lines in an initialization file:
remove_input_ext( 'latex', 'tex' );
@@ -2071,20 +2133,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-
@@ -2094,7 +2156,7 @@ 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":
@@ -2107,33 +2169,34 @@ LATEXMK(1L) LATEXMK(1L)
that this is a string to be assigned to the configuration vari-
able $lpr. The double quotes are part of the string passed to
the operating system to get the command obeyed; this is neces-
- sary because one part of the command name ("Program Files") con-
- tains a space which would otherwise be misinterpreted.
+ sary because one part of the command name ("Program Files")
- $lpr_dvi ["NONE lpr_dvi"]
- The printing program to print dvi files.
- $lpr_pdf ["NONE lpr_pdf"]
- The printing program to print pdf files.
- Under MS-Windows you could set this to use gsview, if it is
- installed, e.g.,
+ 1 January 2015 33
- $lpr = '"c:/Program Files/Ghostgum/gsview/gsview32.exe" /p';
- 2 December 2013 30
+LATEXMK(1L) LATEXMK(1L)
+ contains a space which would otherwise be misinterpreted.
+ $lpr_dvi ["NONE lpr_dvi"]
+ The printing program to print dvi files.
-LATEXMK(1L) LATEXMK(1L)
+ $lpr_pdf ["NONE lpr_pdf"]
+ The printing program to print pdf files.
+ Under MS-Windows you could set this to use gsview, if it is
+ installed, e.g.,
- If gsview is installed in a different directory, you will need
- to make the appropriate change. Note the double quotes around
+ $lpr = '"c:/Program Files/Ghostgum/gsview/gsview32.exe" /p';
+
+ If gsview is installed in a different directory, you will need
+ to make the appropriate change. Note the double quotes around
the name: this is necessary because one part of the command name
("Program Files") contains a space which would otherwise be mis-
interpreted.
@@ -2147,107 +2210,119 @@ LATEXMK(1L) LATEXMK(1L)
The index processing program.
$makeindex_silent_switch ["-q"]
- Switch(es) for the index processing program when silent mode is
+ Switch(es) for the index processing program when silent mode is
on.
$max_repeat [5]
- The maximum number of times latexmk will run latex/pdflatex
- before deciding that there may be an infinite loop and that it
+ The maximum number of times latexmk will run latex/pdflatex
+ before deciding that there may be an infinite loop and that it
needs to bail out, rather than rerunning latex/pdflatex again to
- resolve cross-references, etc. The default value covers all
+ resolve cross-references, etc. The default value covers all
normal cases.
- (Note that the "etc" covers a lot of cases where one run of
+ (Note that the "etc" covers a lot of cases where one run of
latex/pdflatex generates files to be read in on a later run.)
$MSWin_back_slash [1]
- This configuration variable only has an effect when latexmk is
+ This configuration variable only has an effect when latexmk is
running under MS-Windows. It determines whether, when a command
- is executed under MS-Windows, there should be substituted "\"
- for the separator character between components of a directory
- name. Internally, latexmk uses "/" for the directory separator
+ is executed under MS-Windows, there should be substituted "\"
+ for the separator character between components of a directory
+ name. Internally, latexmk uses "/" for the directory separator
character, which is the character used by Unix-like systems.
For many programs under MS-Windows, both "\" and "/" are accept-
- able as the directory separator character. But some programs
- only accept "\". So for safety latexmk makes a translation, by
- default. It is conceivable that under certain situations this
- is undesirable, so the configuration can be changed. (A possi-
- ble example might be when some of the software is implemented
- using Cygwin, which provides an Unix-like environment inside MS-
- Windows.)
+ 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
- $new_viewer_always [0]
- This variable applies to latexmk only in continuous-preview
- mode. If $new_viewer_always is 0, latexmk will check for a pre-
- viously running previewer on the same file, and if one is run-
- ning will not start a new one. If $new_viewer_always is non-
- zero, this check will be skipped, and latexmk will behave as if
- no viewer is running.
+ 1 January 2015 34
- $out_dir [""]
- 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.,
- 2 December 2013 31
+LATEXMK(1L) LATEXMK(1L)
+ possible example might be when some of the software is imple-
+ mented using Cygwin, which provides an Unix-like environment
+ inside MS-Windows.)
+ $new_viewer_always [0]
+ This variable applies to latexmk only in continuous-preview
+ mode. If $new_viewer_always is 0, latexmk will check for a pre-
+ viously running previewer on the same file, and if one is run-
+ ning will not start a new one. If $new_viewer_always is non-
+ zero, this check will be skipped, and latexmk will behave as if
+ no viewer is running.
-LATEXMK(1L) LATEXMK(1L)
+ $out_dir [""]
+ The directory in which output files are to be written by a run
+ of (pdf)latex. See also the variable $aux_dir.
- MiKTeX and TeXLive. But it may not be present in other versions.
+ The effect of this variable (when non-blank) is achieved by
+ using the -output-directory option of (pdf)latex. This exists
+ in the usual current (Dec. 2011 and later) implementations of
+ TeX, i.e., MiKTeX and TeXLive. But it may not be present in
+ other versions.
- Commonly, the directory specified for output files is a subdi-
+ Commonly, the directory specified for output files is a subdi-
rectory of the current working directory. However, if you spec-
- ify some other directory, e.g., "/tmp/foo" or "../output", be
- aware that this could cause problems, e.g., with makeindex or
- bibtex. This is because modern versions of these programs, by
- default, will refuse to work when they find that they are asked
- to write to a file in a directory that appears not to be the
+ ify some other directory, e.g., "/tmp/foo" or "../output", be
+ aware that this could cause problems, e.g., with makeindex or
+ bibtex. This is because modern versions of these programs, by
+ default, will refuse to work when they find that they are asked
+ to write to a file in a directory that appears not to be the
current working directory or one of its subdirectories. This is
- part of security measures by the whole TeX system that try to
+ part of security measures by the whole TeX system that try to
prevent malicious or errant TeX documents from incorrectly mess-
ing with a user's files. If for $out_dir or $aux_dir you really
- do need to specify an absolute pathname (e.g., "/tmp/foo") or a
+ do need to specify an absolute pathname (e.g., "/tmp/foo") or a
path (e.g., "../output") that includes a higher-level directory,
- then you need to disable the security measures (and assume any
- risks). This can be done by temporarily setting the operating
- system's environment variable openout_any to "a" (as in "all"),
+ then you need to disable the security measures (and assume any
+ risks). This can be done by temporarily setting the operating
+ system's environment variable openout_any to "a" (as in "all"),
to override the default "paranoid" setting.
$pdf_mode [0]
- If zero, do NOT generate a pdf version of the document. If
- equal to 1, generate a pdf version of the document using pdfla-
+ 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
+ able. If equal to 3, generate a pdf version of the document
from the dvi file, by using the command specified by the $dvipdf
variable.
Equivalent to the -pdf-, -pdf, -pdfdvi, -pdfps options.
+
+
+ 1 January 2015 35
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
$pdflatex ["pdflatex %O %S"]
- The LaTeX processing program in a version that makes a pdf file
+ The LaTeX processing program in a version that makes a pdf file
instead of a dvi file.
- An example of the use of this variable is to arrange for luala-
- tex, xelatex or some similar program to be used instead of
- pdflatex. Note that lualatex and xelatex only produce .pdf
- files (and not .dvi), so to use them you will also need to turn
- on production of .pdf files, and to turn off the production of
+ An example of the use of this variable is to arrange for luala-
+ tex, xelatex or some similar program to be used instead of
+ pdflatex. Note that lualatex and xelatex only produce .pdf
+ files (and not .dvi), so to use them you will also need to turn
+ on production of .pdf files, and to turn off the production of
.dvi (and .ps) files, either by command line options or by suit-
able settings in a configuration file. Thus to use lualatex, the
following settings are appropriate:
@@ -2260,7 +2335,7 @@ LATEXMK(1L) LATEXMK(1L)
$pdflatex = "xelatex %O %S";
$pdf_mode = 1; $postscript_mode = $dvi_mode = 0;
- Another use of the same variable is to add certain options to
+ Another use of the same variable is to add certain options to
the command line for the program, e.g.,
$pdflatex = "pdflatex --shell-escape %O %S";
@@ -2268,57 +2343,57 @@ LATEXMK(1L) LATEXMK(1L)
%pdflatex_input_extensions
- This variable specifies the extensions tried by latexmk when it
- finds that a pdflatex run resulted in an error that a file has
+ This variable specifies the extensions tried by latexmk when it
+ finds that a pdflatex run resulted in an error that a file has
+ not been found, and the file is given without an extension.
+ This typically happens when LaTeX commands of the form
+ \input{file} or \includegraphics{figure}, when the relevant
+ source file does not exist.
+ In this situation, latexmk searches for custom dependencies to
+ make the missing file(s), but restricts it to the extensions
+ specified by the variable %pdflatex_input_extensions. The
+ default extensions are 'tex', 'pdf', 'jpg, and 'png'.
+ (For Perl experts: %pdflatex_input_extensions is a hash whose
+ keys are the extensions. The values are irrelevant.) Two sub-
+ routines are provided for manipulating this and the related
+ variable %latex_input_extensions, add_input_ext and
+ remove_input_ext. They are used as in the following examples
+ are possible lines in an initialization file:
- 2 December 2013 32
+ remove_input_ext( 'pdflatex', 'tex' );
+ removes the extension 'tex' from pdflatex_input_extensions
+ add_input_ext( 'pdflatex', 'asdf' );
-LATEXMK(1L) LATEXMK(1L)
+ 1 January 2015 36
- not been found, and the file is given without an extension.
- This typically happens when LaTeX commands of the form
- \input{file} or \includegraphics{figure}, when the relevant
- source file does not exist.
- In this situation, latexmk searches for custom dependencies to
- make the missing file(s), but restricts it to the extensions
- specified by the variable %pdflatex_input_extensions. The
- default extensions are 'tex', 'pdf', 'jpg, and 'png'.
- (For Perl experts: %pdflatex_input_extensions is a hash whose
- keys are the extensions. The values are irrelevant.) Two sub-
- routines are provided for manipulating this and the related
- variable %latex_input_extensions, add_input_ext and
- remove_input_ext. They are used as in the following examples
- are possible lines in an initialization file:
- remove_input_ext( 'pdflatex', 'tex' );
- removes the extension 'tex' from pdflatex_input_extensions
+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-
+ add the extension 'asdf to pdflatex_input_extensions. (Natu-
+ rally with such an extension, you should have made an appropri-
ate custom dependency for latexmk, and should also have done the
- appropriate programming in the LaTeX source file to enable the
- file to be read. The standard extensions are handled by pdfla-
+ appropriate programming in the LaTeX source file to enable the
+ file to be read. The standard extensions are handled by pdfla-
tex and its graphics/graphicx packages.)
$pdflatex_silent_switch ["-interaction=batchmode"]
- Switch(es) for the pdflatex program (specified in the variable
+ Switch(es) for the pdflatex program (specified in the variable
$pdflatex when silent mode is on.
- If you use MikTeX, you may prefer the results if you configure
- the options to include -c-style-errors, e.g., by the following
+ If you use MikTeX, you may prefer the results if you configure
+ the options to include -c-style-errors, e.g., by the following
line in an initialization file
$latex_silent_switch = "-interaction=batchmode -c-style-
@@ -2328,59 +2403,59 @@ LATEXMK(1L) LATEXMK(1L)
$pdf_previewer ["start acroread %O %S"]
The command to invoke a pdf-previewer.
- On MS-WINDOWS, the default is changed to "cmd /c start """;
+ On MS-WINDOWS, the default is changed to "cmd /c start """;
under more recent versions of Windows, this will cause to be run
whatever command the system has associated with .pdf files. But
- this may be undesirable if this association is to acroread --
+ this may be undesirable if this association is to acroread --
see the notes in the explanation of the -pvc option.]
- On OS-X the default is changed to "open %S", which results in
- OS-X starting up (and detaching) the viewer associated with the
- file. By default, for pdf files this association is to OS-X's
+ On OS-X the default is changed to "open %S", which results in
+ OS-X starting up (and detaching) the viewer associated with the
+ file. By default, for pdf files this association is to OS-X's
preview, which is quite satisfactory.
- WARNING: Problem under MS-Windows: if acroread is used as the
- pdf previewer, and it is actually viewing a pdf file, the pdf
- file cannot be updated. Thus makes acroread a bad choice of
- previewer if you use latexmk's previous-continuous mode (option
- -pvc) under MS-windows. This problem does not occur if, for
+ WARNING: Problem under MS-Windows: if acroread is used as the
+ pdf previewer, and it is actually viewing a pdf file, the pdf
+ file cannot be updated. Thus makes acroread a bad choice of
+ previewer if you use latexmk's previous-continuous mode (option
+ -pvc) under MS-windows. This problem does not occur if, for
example, SumatraPDF or gsview is used to view pdf files.
+ Important note: Normally you will want to have a previewer run
+ detached, so that latexmk doesn't wait for the previewer to ter-
+ minate before continuing its work. So normally you should pre-
+ fix the command by "start ", which flags to latexmk that it
+ should do the detaching of the previewer itself (by whatever
+ method is appropriate to the operating system). But sometimes
+ letting latexmk do the detaching is not appropriate (for a vari-
+ ety of non-trivial reasons), so you should put the "start " bit
+ in yourself, whenever it is needed.
+ $pdf_update_command [""]
+ When the pdf previewer is set to be updated by running a
- 2 December 2013 33
+ 1 January 2015 37
-LATEXMK(1L) LATEXMK(1L)
- Important note: Normally you will want to have a previewer run
- detached, so that latexmk doesn't wait for the previewer to ter-
- minate before continuing its work. So normally you should pre-
- fix the command by "start ", which flags to latexmk that it
- should do the detaching of the previewer itself (by whatever
- method is appropriate to the operating system). But sometimes
- letting latexmk do the detaching is not appropriate (for a vari-
- ety of non-trivial reasons), so you should put the "start " bit
- in yourself, whenever it is needed.
+LATEXMK(1L) LATEXMK(1L)
- $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.
+ command, this is the command that is run. See the information
+ for the variable $pdf_update_method.
$pdf_update_method [1 under UNIX, 3 under MS-Windows]
- How the pdf viewer updates its display when the pdf file has
- changed. See the information on the variable $dvi_update_method
+ How the pdf viewer updates its display when the pdf file has
+ changed. See the information on the variable $dvi_update_method
for the codes. (Note that information needs be changed slightly
- so that for the value 4, to run a command to do the update, the
- command is specified by the variable $pdf_update_command, and
- for the value 2, to specify update by signal, the signal is
+ so that for the value 4, to run a command to do the update, the
+ command is specified by the variable $pdf_update_command, and
+ for the value 2, to specify update by signal, the signal is
specified by $pdf_update_signal.)
Note that acroread under MS-Windows (but not UNIX) locks the pdf
@@ -2393,14 +2468,14 @@ LATEXMK(1L) LATEXMK(1L)
$pdf_update_method = 4;
$pdf_update_command = "xpdf -remote %R -reload";
- The first setting arranges for the xpdf program to be used in
- its "remote server mode", with the server name specified as the
- rootname of the TeX file. The second setting arranges for
+ The first setting arranges for the xpdf program to be used in
+ its "remote server mode", with the server name specified as the
+ rootname of the TeX file. The second setting arranges for
updating to be done in response to a command, and the third set-
ting sets the update command.
- $pdf_update_signal [Under UNIX: SIGHUP, which is a system-dependent
+ $pdf_update_signal [Under UNIX: SIGHUP, which is a system-dependent
value]
The number of the signal that is sent to the pdf viewer when it
is updated by sending a signal -- see the information on the
@@ -2422,10 +2497,13 @@ LATEXMK(1L) LATEXMK(1L)
If some other request is made for which a postscript file is
needed, then $postscript_mode will be set to 1.
+ $preview_continuous_mode [0]
+ If nonzero, run a previewer to view the document, and continue
+ running latexmk to keep .dvi up-to-date. Equivalent to the -pvc
- 2 December 2013 34
+ 1 January 2015 38
@@ -2434,9 +2512,6 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- $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.
@@ -2463,8 +2538,8 @@ LATEXMK(1L) LATEXMK(1L)
the previewer about file changes).
Each line of the output of this command is assumed to correspond
- to one process. See the $pid_position variable for how the pro-
- cess number is determined.
+ to one process. See the $pid_position variable for how the
+ process number is determined.
The default for pscmd is "NONE" under MS-Windows and cygwin
(i.e., the command is not used), "ps --width 200 -f -u
@@ -2477,9 +2552,9 @@ LATEXMK(1L) LATEXMK(1L)
Command to convert ps to pdf file.
$ps_filter [empty]
- The postscript file filter to be run on the newly produced
- postscript file before other processing. Equivalent to specify-
- ing the -pF option.
+ The postscript file filter to be run on the newly produced post-
+ script file before other processing. Equivalent to specifying
+ the -pF option.
$ps_previewer ["start gv %O %S", but start %O %S under MS-WINDOWS]
The command to invoke a ps-previewer. (The default under MS-
@@ -2492,16 +2567,9 @@ LATEXMK(1L) LATEXMK(1L)
ferent ways of writing this option. You can configure this
variable appropriately.
- WARNING: Linux systems may have installed one (or more) versions
- of gv under different names, e.g., ggv, kghostview, etc, but
- perhaps not one called gv.
-
- Important note: Normally you will want to have a previewer run
- detached, so that latexmk doesn't wait for the previewer to
-
- 2 December 2013 35
+ 1 January 2015 39
@@ -2510,8 +2578,14 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- terminate before continuing its work. So normally you should
- prefix the command by "start ", which flags to latexmk that it
+ WARNING: Linux systems may have installed one (or more) versions
+ of gv under different names, e.g., ggv, kghostview, etc, but
+ perhaps not one called gv.
+
+ Important note: Normally you will want to have a previewer run
+ detached, so that latexmk doesn't wait for the previewer to ter-
+ minate before continuing its work. So normally you should pre-
+ fix the command by "start ", which flags to latexmk that it
should do the detaching of the previewer itself (by whatever
method is appropriate to the operating system). But sometimes
letting latexmk do the detaching is not appropriate (for a vari-
@@ -2524,21 +2598,21 @@ LATEXMK(1L) LATEXMK(1L)
The command to invoke a ps-previewer in landscape mode.
$ps_update_command [""]
- When the postscript previewer is set to be updated by running a
- command, this is the command that is run. See the information
+ When the postscript previewer is set to be updated by running a
+ command, this is the command that is run. See the information
for the variable $ps_update_method.
$ps_update_method [0 under UNIX, 1 under MS-Windows]
- How the postscript viewer updates its display when the ps file
- has changed. See the information on the variable
- $dvi_update_method for the codes. (Note that information needs
+ How the postscript viewer updates its display when the ps file
+ has changed. See the information on the variable
+ $dvi_update_method for the codes. (Note that information needs
be changed slightly so that for the value 4, to run a command to
do the update, the command is specified by the variable
- $ps_update_command, and for the value 2, to specify update by
+ $ps_update_command, and for the value 2, to specify update by
signal, the signal is specified by $ps_update_signal.)
- $ps_update_signal [Under UNIX: SIGHUP, which is a system-dependent
+ $ps_update_signal [Under UNIX: SIGHUP, which is a system-dependent
value]
The number of the signal that is sent to the pdf viewer when it
is updated by sending a signal -- see $ps_update_method. The
@@ -2558,6 +2632,18 @@ LATEXMK(1L) LATEXMK(1L)
The quoting method used by latexmk is tested to work correctly
under UNIX systems (including Linux and Mac OS-X) and under MS-
+
+
+
+ 1 January 2015 40
+
+
+
+
+
+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
@@ -2574,18 +2660,6 @@ LATEXMK(1L) LATEXMK(1L)
tex.
It is generally recommended to use this option (or to configure
-
-
-
- 2 December 2013 36
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
the $recorder variable to be on.) But it only works if
(pdf)latex supports the -recorder option, which is true for most
current implementations
@@ -2625,6 +2699,39 @@ LATEXMK(1L) LATEXMK(1L)
the MSWin, Linux, OS-X, Unix collection.)
+
+
+ 1 January 2015 41
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
+ $silence_logfile_warnings [0]
+ Whether after a run of (pdf)latex to summarize warnings in the
+ log file about undefined citations and references. Setting
+ $silence_logfile_warnings=0 gives the summary of warnings (pro-
+ vided silent mode isn't also set), and this is useful to locate
+ undefined citations and references without searching through the
+ much more verbose log file or the screen output of (pdf)latex.
+ But the summary can also be excessively annoying. The default
+ is not to give these warnings. The command line options
+ -silence_logfile_warning_list and -silence_logfile_warning_list-
+ also set this variable.
+
+ Note that multiple occurrences for the same undefined object on
+ the same page and same line will be compressed to a single warn-
+ ing.
+
+
+ $silent [0]
+ Whether to run silently. Setting $silent to 1 has the same
+ effect as the -quiet of -silent options on the command line.
+
+
$sleep_time [2]
The time to sleep (in seconds) between checking for source file
changes when running with the -pvc option. This is subject to a
@@ -2652,9 +2759,15 @@ LATEXMK(1L) LATEXMK(1L)
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
+
- 2 December 2013 37
+ 1 January 2015 42
@@ -2663,11 +2776,6 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- The default under MSWindows (including cygwin), is to set
- $tmpdir to the value of the first of whichever of the system
- environment variables TMPDIR or TEMP exists, otherwise to the
- current directory. Under other operating systems (expected to
- be UNIX/Linux, including OS-X), the default is the value of the
system environment variable TMPDIR if it exists, otherwise
"/tmp".
@@ -2722,16 +2830,10 @@ CUSTOM DEPENDENCIES
must: If non-zero, the file from which we are converting must exist,
if it doesn't exist latexmk will give an error message and exit
unless the -f option is specified. If must is zero and the file
- we are converting from doesn't exist, then no action is taken.
-
- function:
- The name of the subroutine that latexmk should call to perform
- the file conversion. The first argument to the subroutine is
- the base name of the file to be converted without any extension.
- 2 December 2013 38
+ 1 January 2015 43
@@ -2740,6 +2842,12 @@ CUSTOM DEPENDENCIES
LATEXMK(1L) LATEXMK(1L)
+ we are converting from doesn't exist, then no action is taken.
+
+ function:
+ The name of the subroutine that latexmk should call to perform
+ the file conversion. The first argument to the subroutine is
+ the base name of the file to be converted without any extension.
The subroutines are declared in the syntax of Perl. The func-
tion should return 0 if it was successful and a nonzero number
if it failed.
@@ -2788,6 +2896,18 @@ LATEXMK(1L) LATEXMK(1L)
of the form of a variable name, $_[0] in this case, is to be substi-
tuted by its value.
+
+
+
+ 1 January 2015 44
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
If the return value of the subroutine is non-zero, then latexmk will
assume an error occurred during the execution of the subroutine. In
the above example, no explicit return value is given, and instead the
@@ -2805,18 +2925,6 @@ LATEXMK(1L) LATEXMK(1L)
Note 1: In the command lines given in the system commands in the above
examples, double quotes have been inserted around the file names
-
-
-
- 2 December 2013 39
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
(implemented by '\"' in the Perl language). They immunize the running
of the program against special characters in filenames. Very often
these quotes are not necessary, i.e., they can be omitted. But it is
@@ -2854,6 +2962,18 @@ LATEXMK(1L) LATEXMK(1L)
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
+
+
+
+ 1 January 2015 45
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
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
@@ -2882,18 +3002,6 @@ LATEXMK(1L) LATEXMK(1L)
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
-
-
-
- 2 December 2013 40
-
-
-
-
-
-LATEXMK(1L) LATEXMK(1L)
-
-
with such problems.
Glossaries can be dealt with similarly.
@@ -2920,6 +3028,18 @@ OLD METHOD OF DEFINING CUSTOM DEPENDENCIES
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
+
+
+
+ 1 January 2015 46
+
+
+
+
+
+LATEXMK(1L) LATEXMK(1L)
+
+
preferable.
@@ -2958,55 +3078,56 @@ USING latexmk WITH make
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.
+ 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
+ a suitable Makefile is like
+ .PHONY : FORCE_MAKE
+ all : try.pdf
+ %.pdf : %.tex FORCE_MAKE
+ latexmk -pdf -dvi- -ps- $<
- 2 December 2013 41
+ (Note: the last line must be introduced by a tab for the Makefile to
+ function correctly!) Naturally, if making try.pdf from its associated
+ LaTeX file try.tex were the only task to be performed, a direct use of
+ latexmk without a Makefile would normally be better. The benefit of
+ using a Makefile for a LaTeX document would be in a larger project,
+ 1 January 2015 47
-LATEXMK(1L) LATEXMK(1L)
- The simplest method is simply to delegate all the relevant tasks to
- latexmk, as is suitable for a straightforward LaTeX document. For this
- a suitable Makefile is like
- .PHONY : FORCE_MAKE
- all : try.pdf
- %.pdf : %.tex FORCE_MAKE
- latexmk -pdf -dvi- -ps- $<
+LATEXMK(1L) LATEXMK(1L)
+
- (Note: the last line must be introduced by a tab for the Makefile to
- function correctly!) Naturally, if making try.pdf from its associated
- LaTeX file try.tex were the only task to be performed, a direct use of
- latexmk without a Makefile would normally be better. The benefit of
- using a Makefile for a LaTeX document would be in a larger project,
where lines such as the above would be only be a small part of a larger
Makefile.
The above example has a pattern rule for making a .pdf file from a .tex
- file, and it is defined to use latexmk in the obvious way. There is a
+ file, and it is defined to use latexmk in the obvious way. There is a
conventional default target named "all", with a prerequisite of
- try.pdf. So when make is invoked, by default it makes try.pdf. The
- only complication is that there may be many source files beyond
+ try.pdf. So when make is invoked, by default it makes try.pdf. The
+ only complication is that there may be many source files beyond
try.tex, but these aren't specified in the Makefile, so changes in them
- will not by themselves cause latexmk to be invoked. Instead, the pat-
- tern rule is equipped with a "phony" prerequisite FORCE_MAKE; this has
- the effect of causing the rule to be always out-of-date, so that
- latexmk is always run. It is latexmk that decides whether any action
- is needed, e.g., a rerun of pdflatex. Effectively the Makefile dele-
+ will not by themselves cause latexmk to be invoked. Instead, the pat-
+ tern rule is equipped with a "phony" prerequisite FORCE_MAKE; this has
+ the effect of causing the rule to be always out-of-date, so that
+ latexmk is always run. It is latexmk that decides whether any action
+ is needed, e.g., a rerun of pdflatex. Effectively the Makefile dele-
gates all decisions to latexmk, while make has no knowledge of the list
- of source files except for primary LaTeX file for the document. If
- there are, for example, graphics files to be made, these must be made
+ of source files except for primary LaTeX file for the document. If
+ there are, for example, graphics files to be made, these must be made
by custom dependencies configured in latexmk.
- But something better is needed in more complicated situations, for
- example, when the making of graphics files needs to be specified by
- rules in the Makefile. To do this, one can use a Makefile like the
+ But something better is needed in more complicated situations, for
+ example, when the making of graphics files needs to be specified by
+ rules in the Makefile. To do this, one can use a Makefile like the
following:
TARGETS = document1.pdf document2.pdf
@@ -3036,10 +3157,13 @@ LATEXMK(1L) LATEXMK(1L)
two files document1.pdf and document2.pdf are the targets. The depen-
dency files are .deps/document1.pdfP and .deps/document2.pdfP.
+ There is now no need for the phony prerequisite for the rule to make
+ .pdf files from .tex files. But I have added a rule to make .pdf files
+ from .fig files produced by the xfig program; these are commonly used
- 2 December 2013 42
+ 1 January 2015 48
@@ -3048,9 +3172,6 @@ LATEXMK(1L) LATEXMK(1L)
LATEXMK(1L) LATEXMK(1L)
- There is now no need for the phony prerequisite for the rule to make
- .pdf files from .tex files. But I have added a rule to make .pdf files
- from .fig files produced by the xfig program; these are commonly used
for graphics insertions in LaTeX documents. Latexmk is arranged to
output a dependency file after each run. It is given the -recorder
option, which improves its detection of files generated during a run of
@@ -3100,23 +3221,15 @@ THANKS TO
their standard form to avoid being harvested by worms and viruses.)
AUTHOR
- Current version, by John Collins (username collins at node
- phys.psu.edu). (Version 4.39).
+ Current version, by John Collins (username jcc8 at node psu.edu).
+ (Version 4.41).
Released version can be obtained from CTAN: <http://www.ctan.org/tex-
archive/support/latexmk/>, and from the author's website
- <http://www.phys.psu.edu/~collins/software/latexmk/>.
- Modifications and enhancements by Evan McLean (Version 2.0)
- Original script called "go" by David J. Musliner (RCS Version 3.2)
-
-
-
-
-
- 2 December 2013 43
+ 1 January 2015 49
@@ -3125,6 +3238,9 @@ AUTHOR
LATEXMK(1L) LATEXMK(1L)
+ <http://www.phys.psu.edu/~collins/software/latexmk/>.
+ Modifications and enhancements by Evan McLean (Version 2.0)
+ Original script called "go" by David J. Musliner (RCS Version 3.2)
@@ -3179,20 +3295,6 @@ LATEXMK(1L) LATEXMK(1L)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 2 December 2013 44
+ 1 January 2015 50