4
LATEXMK(1L) LATEXMK(1L)
8
latexmk - generate LaTeX document
11
latexmk [options] [file ...]
14
LatexMk completely automates the process of compiling a
15
LaTeX document. Essentially, it is a highly specialized
16
relative of the general make utility. Given the source
17
files for a document, latexmk issues the appropriate
18
sequence of commands to generate a .dvi, .ps, .pdf and/or
19
hardcopy version of the document. It can also be set to
20
run continuously with a previewer; in that case the latex
21
program, etc, are rerun whenever one of the source files
24
Latexmk will normally determine which are the source files
25
by examining the log file. It has an option to parse the
26
TeX file instead --- see later. When latexmk is run, it
27
will examine the timestamps on the source files. If any
28
of the source files have been changed since the last docu-
29
ment generation, latexmk will run the various LaTeX pro-
30
cessing programs as necessary. In particular, it will
31
repeat the run of LaTeX (or pdflatex) often enough to
32
resolve all cross references; depending on the macro pack-
33
ages used. With some macro packages and document styles
34
four, or even more, runs may be needed. If necessary,
35
latexmk will also run bibtex and/or makeindex.
37
[If the option -it to scan the LaTeX file is used, the
38
main LaTeX file and all input and included files (recur-
39
sively) are scanned for LaTeX commands for inputting and
40
including other TeX files and figure files. Then on sub-
41
sequent runs, latexmk with the -it switch reads the depen-
42
dency information from this file. If the dependencies of
43
the document are changed (e.g., by adding or removing an
44
\input command), an additional pass of latexmk -i or
45
latexmk -I will update the dependency file.]
47
Latexmk has two different previewing options. In the sim-
48
ple -pv option, a dvi, postscript or pdf previewer is
49
automatically run after generating the dvi, postscript or
50
pdf version of the document. The type of viewer is
51
selected automatically depending on the -ps, -pdf or
52
-pdfps options. The kind of file to be viewed can also
53
be explicitly selected by using the -view option
56
The second previewing option is the powerful -pvc option
57
(mnemonic: "preview continuously"). Particularly when a
58
document is reaching the final stages of editing, it is
59
often useful to have a previewer open continuously and
60
have it update its display whenever changes are made to
70
LATEXMK(1L) LATEXMK(1L)
73
the source file(s), and this is done by the -pvc option.
74
With this option, latexmk runs a previewer for the docu-
75
ment, and then latexmk repeatedly monitors the source
76
files of the document to see if any changes have been made
77
since the last dependent file was produced. When changes
78
are detected, latexmk runs the appropriate LaTeX commands
79
to regenerate the .dvi, .ps and/or .pdf files (depending
80
on the which of the -ps, -pdf and -pdfps options was
81
specified). A good previewer (like gv) will then automat-
82
ically update its display. Thus the user can simply edit
83
a file and, when the changes are written to disk, latexmk
84
completely automates the cycle of updating the .dvi (and
85
possibly the .ps and .pdf) file, and refreshing the pre-
86
viewer's display. It's not quite WYSIWYG, but usefully
89
For other previewers, the user will have to manually make
90
the previewer update its display, which can be (xdvi and
91
gsview) as forcing a redraw of its display.
93
Latexmk has the ability to print a banner in gray diago-
94
nally across each page when making the postscript file.
95
It can also, if needed, call an external program to do
96
other postprocessing on the generated files.
98
Latexmk is highly configurable, both from the command line
99
and in configuration files, so that it can accommodate a
100
wide variety of user needs and system configurations.
102
LATEXMK OPTIONS AND ARGUMENTS
103
(All options can be introduced by single or double "-"
104
characters, e.g., "latexmk -help" or "latexmk --help".)
106
file One or more files can be specified. If no files
107
are specified, latexmk will, by default, run on all
108
files in the current working directory with a
109
".tex" extension. This behavior can be changed:
110
see the sections concerning the @default_files
113
If a file is specified without an extension, then
114
the ".tex" extension is automatically added, just
115
as LaTeX does. (e.g. If you specify:
119
then latexmk will operate on the file "foo.tex".
122
A banner message to print diagonally across each
123
page when converting the dvi file to postscript.
124
The message must be a single argument on the com-
125
mand line so be careful with quoting spaces and
136
LATEXMK(1L) LATEXMK(1L)
139
Note that if the -bm option is specified, the -ps
140
option is assumed and the postscript file is always
141
generated, even if it is newer than the dvi file.
144
How dark to print the banner message. A decimal
145
number between 0 and 1. 0 is black and 1 is white,
146
default is 0.95 which is OK unless your toner car-
147
tridge is getting low.
150
A decimal number that specifies how large the ban-
151
ner message will be printed. Experimentation is
152
necessary to get the right scale for your message,
153
as a rule of thumb the scale should be about equal
154
to 1100 divided by the number of characters in the
155
message. Default is 220.0 which is just right for
156
5 character messages.
159
List the commands used by latexmk for processing
160
files, and then exit.
162
-c Clean up (remove) all regenerateable files gener-
163
ated by latex and bibtex except dvi, postscript and
166
-C Clean up (remove) all regenerateable files gener-
167
ated by latex and bibtex including aux, dep, dvi,
170
-c1 Clean up (remove) all regenerateable files gener-
171
ated by latex and bibtex except aux and dep.
173
-d Set draft mode. This prints the banner message
174
"DRAFT" across your page when converting the dvi
175
file to postscript. Size and intensity can be mod-
176
ified with the -bs and -bi options. The -bm option
177
will override this option as this is really just a
178
short way of specifying:
182
Note that if the -d option is specified, the -ps
183
option is assumed and the postscript file is always
184
generated, even if it is newer than the dvi file.
186
-dF Dvi file filtering. The argument to this option is
187
a filter which will generate a filtered dvi file
188
with the extension ".dviF". All extra processing
189
(e.g. conversion to postscript, preview, printing)
190
will then be performed on this filtered dvi file.
192
Example usage: To use dviselect to select only the
202
LATEXMK(1L) LATEXMK(1L)
205
even pages of the dvi file:
207
latexmk -dF 'dviselect even' foo.tex
209
-dvi Generate dvi version of document.
211
-dvi- Turn off generation of dvi version of document.
212
(This may get overridden, if some other file is
213
made (a .ps file) that is generated from the dvi
214
file, or if no generated file at all is requested.)
217
Whenever a log file is parsed to determine the
218
input and included files, print a list of these
221
-f Force latexmk to continue document processing
222
despite errors. Normally, when latexmk detects
223
that latex has found an error which will not be
224
resolved by further processing, the program termi-
227
-f- Turn off the forced processing-past-errors such as
228
is set by the -f option. This could be used to
229
override a setting in a configuration file.
231
-F Force latexmk to include files that don't exist
232
when generating dependency files. A warning is
233
produced instead of an error message and the pro-
234
gram terminating. If the file name is not an abso-
235
lute path, it is assumed to be relative to the cur-
236
rent working directory. (Note: This option is only
237
relevant if you are using the -it to obtain the
238
dependency information from the tex files. The
239
default is to obtain this information from the log
240
file and it that case the -F option has no effect.)
244
-g Force latexmk to process document, disregarding the
245
timestamps of the source files. This option is
246
useful, for example, if you change some options and
247
wish to reprocess the files.
252
Print help information.
254
-i Generate new dependency file if root file is newer
255
than dependency file or dependency file does not
256
exist. The dependency information is taken from
257
the log file or the source file, depending on the
258
setting made by the -il and -it switches.
268
LATEXMK(1L) LATEXMK(1L)
273
-il Extract dependency information from log file. This
274
is normally the best method, so it is the default.
275
However, some packages do not put information on
276
files read in the log file, and then it may be bet-
277
ter to tell latexmk to get the information from the
278
TeX file(s) --- see the switch -it. (Default)
280
-it Extract dependency information by scanning the
281
source TeX file(s), rather than the log file. This
282
is the method used by earlier versions of latexmk.
283
It relies on parsing TeX files, which can be con-
284
fused by definitions of new commands, etc. Nor-
285
mally it is better to tell latexmk to scan the log
286
file --- see the switch -il.
288
-I Always generate new dependency file, even if newer
289
dependency file exists. The dependency information
290
is taken from the log file or the source file,
291
depending on the setting made by the -il and -it
296
-l Run in landscape mode, using the landscape mode for
297
the previewers and the dvi to postscript convert-
302
-p Print out the file. By default, this is done using
303
lpr after generating the postscript version. But
304
you can use the -print=... option to print the dvi
305
or pdf files instead, and you can configure this in
306
a start up file (by setting the $print_type vari-
309
Under MS-Windows you must have configured the print
310
commands used by latexmk.
312
This option is incompatible with the -pv and -pvc
313
options, so it turns them off.
315
-pdf Generate pdf version of document using pdflatex.
318
Generate pdf version of document from the dvi file,
319
by default using dvipdf.
321
-pdfps Generate pdf version of document from the ps file,
322
by default using ps2pdf.
324
-pdf- Turn off generation of pdf version of document.
334
LATEXMK(1L) LATEXMK(1L)
337
(This can be used to override a setting in a con-
338
figuration file. It may get overridden if some
339
other option requires the generation of a pdf
342
-print=dvi, -print=ps, -print=pdf
343
Define which kind of file is printed. This option
344
also ensures that the requisite file is made, and
347
-ps Generate postscript version of document.
349
-ps- Turn off generation of postscript version of docu-
350
ment. This can be used to override a setting in a
351
configuration file. (It may get overridden by some
352
other option that requires a postscript file, for
353
example a request for printing.)
355
-pF Postscript file filtering. The argument to this
356
option is a filter which will generate a filtered
357
postscript file with the extension ".psF". All
358
extra processing (e.g. preview, printing) will then
359
be performed on this filtered postscript file.
361
Example usage: Use psnup to print two pages on the
364
latexmk -ps -pF 'psnup -2' foo.tex
368
latexmk -ps -pF "psnup -2" foo.tex
370
Whether to use single or double quotes round the
371
"psnup -2" will depend on your command interpreter,
372
in particular on the operating system.
374
-pv Run file previewer. If the -view option is used,
375
this will select the kind of file to be previewed
376
(dvi, ps or pdf). Otherwise the viewer views the
377
"highest" kind of file selected, by the -dvi, -ps,
378
-pdf, -pdfps options, in the order dvi, ps, pdf
379
(low to high). If no file type has been selected,
380
the dvi previewer will be used. This option is
381
incompatible with the -p and -pvc options, so it
386
-pvc Run a file previewer and continually update the
387
.dvi, .ps, and/or .pdf files whenever changes are
388
made to source files (see the Description above).
389
Which of these files is generated and which is
390
viewed is governed by the other options, and is the
400
LATEXMK(1L) LATEXMK(1L)
403
same as for the -pv option. This option also turns
404
on the -f option, since it is normally desirable in
405
preview-continuous-mode to continue working even if
406
errors are found. The preview-continuous option
407
-pvc can only work with one file. So in this case
408
you will normally only specify one filename on the
409
command line. It is also incompatible with the -p
410
and -pv options, so it turns these options off
412
With a good previewer the display will be automati-
413
cally updated. (Under UNIX "gv -watch" does this
414
for postscript files; it would also do it for pdf
415
files except for an apparent bug in gv that causes
416
an error when the newly updated pdf file is read.)
417
Other previewers will need a manual update.
419
Important note: the acroread program on MS-Windows
420
locks the pdf file, and prevents new versions being
421
written, so it is a bad idea to use acroread to
422
view pdf files in preview-continuous mode. It is
423
better to use a dvi or ps viewer, as set by one of
424
the -view=dvi and -view=ps options.
426
Note that if latexmk dies because it encounters an
427
error, the "forked" previewer will continue to run.
428
Successive invocations with the -pvc option will
429
not fork new previewers, but latexmk will use the
430
existing previewer. (At least this will happen
431
when latexmk is running under an operating system
432
where it knows how to determine whether an existing
433
previewer is running.)
437
-quiet Same as -silent
440
Read the specified initialization file ("RC file")
441
before processing. Be careful about the ordering:
442
Standard initialization files --- see the section
443
below on "Initialization (RC) files" --- are read
444
first, then the options on the command line in the
445
order they are given. Thus an initialization file
446
specified with the -r option can override both the
447
standard initialization files and previously speci-
448
fied options. But all of these can be overridden
449
by later options. See below for more details about
450
initialization (RC) files.
453
Run commands silently, i.e., with options that
454
reduce the amount of diagnostics generated. For
455
example, with the default settings for commands
456
under UNIX, the command "latex
466
LATEXMK(1L) LATEXMK(1L)
469
-interaction=batchmode" is used for latex.
471
Also reduce the number of informational messages
472
that latexmk generates.
475
Print version number of Latexmk.
478
Opposite of -silent. This is the default setting.
480
-view=default, -view=dvi, -view=ps, -view=pdf
481
Set the kind of file used when previewing is
482
requested (e.g., by the -pv or -pvc switches). The
483
default is to view the "highest" kind of requested
484
file (in the order dvi, ps, pdf).
486
The preview-continuous option -pvc can only work with one
487
file. So in this case you will normally only specify one
488
filename on the command line.
490
Options -p, -pv and -pvc are mutually exclusive. So each
491
of these options turns the others off.
494
% latexmk thesis # run latex enough times to resolve
497
% latexmk -pvc -ps thesis# run latex enough times to resolve
498
cross-references, make a postscript
499
file, start a previewer. Then
500
watch for changes in the source
501
file thesis.tex and any files it
502
uses. After any changes rerun latex
503
the appropriate number of times and
504
remake the postscript file. If latex
505
encounters an error, latexmk will
508
% latexmk -c # remove .aux, .log, .bbl, .blg, .dep,
509
.dvi, .pdf, .ps & .bbl files
511
INITIALIZATION (RC) FILES
512
There are four initialization files ("RC files") that
513
latexmk can read at startup:
515
1) The system RC file, if it exists.
516
On a UNIX system, latexmk searches for following places
518
system RC file, in the following order, and reads the
520
"/opt/local/share/latexmk/LatexMk",
521
"/usr/local/share/latexmk/LatexMk",
522
"/usr/local/lib/latexmk/LatexMk".
532
LATEXMK(1L) LATEXMK(1L)
535
On a MS-WINDOWS system it looks for
536
"C:\latexmk\LatexMk".
538
2) The user's RC file in "$HOME/.latexmkrc", where $HOME
539
is the value of the environment variable HOME. On UNIX
540
and clones (including LINUX), this variable is set by the
541
system; on MS-Windows, the user may choose to set it.
543
3) The RC file in the current working directory called
546
4) Any RC file(s) specified on the command line with the
549
Each RC file is a sequence of Perl commands. Usually it
550
will be just a sequence of assignment statements that
551
override the built-in settings of Latexmk. Comment lines
552
are introduced by the "#" character.
554
Note that command line options are obeyed in the order in
555
which they are written; thus any RC file specified on the
556
command line with the -r option can override previous
557
options but can be itself overridden by later options on
561
RC VARIABLES IN INITIALIZATION FILES
562
Many of the available variables that can be set are shown
563
in the next section. Syntax for the statements in an ini-
564
tialization file is of the form:
568
for the setting of a string variable,
572
for the setting of a numeric variable, and
574
@default_files = ('paper', 'paper1');
576
for the setting of an array of strings.
578
Some of the variables set the names of the commands that
579
latexmk uses. Here are some tricks to note for these:
581
"Detaching" a command: If a command is to be run detached
582
this is indicated by preceding it with "start", as in
584
$dvi_previewer = 'start xdvi';
586
This will be translated to whatever is appropriate for
587
your operating system. (Note: in some circumstances, latex
588
will always run a command detached. This is the case for
598
LATEXMK(1L) LATEXMK(1L)
601
a previewer in preview continuous mode, since otherwise
602
previewing continuously makes no sense.)
604
Command names containing spaces: Under MS-Windows it is
605
common that the name of a command includes spaces, since
606
software is often installed in a subdirectory of "C:Pro-
607
gram Files". Such command names should be enclosed in
610
$lpr_pdf = '"c:/Program Files/Ghost-
611
gum/gsview/gsview32.exe" /p';
613
Using MS-Windows file associations: A useful trick under
614
modern versions of MS-Windows (e.g., WinXP) is to use just
617
$dvi_previewer = 'start';
619
Under recent versions of MS-Windows, this will cause to be
620
run whatever program the system has associated with dvi
621
files. (The same applies for a postscript viewer and a
624
Not using a certain command: If a command is not to be
625
run, the command name NONE is used, as in
630
Options to commands: Setting the name of a command can be
631
used not only for changing the name of the command called,
632
but also to add options to command. Suppose you want
633
latexmk to use latex with source specials enabled. Then
634
you might use the following line in an initialization
637
$latex = 'latex --src-specials';
640
Advanced tricks: Normally latexmk assumes certain behavior
641
for commands and in particular it assumes certain kinds
642
and ordering of command line arguments. Sometimes this
643
assumption is wrong. For example you might want to use
644
Distiller to convert postscript files to pdf files. You
645
cannot simply change the name of the ps2pdf conversion
648
$ps2pdf = 'distiller'; #########
651
because the command line arguments will be wrong. In such
652
a situation, your best bet is to write a batch file (under
653
MS-Windows) or a script (under UNIX) that will do the con-
654
version. Then you set
664
LATEXMK(1L) LATEXMK(1L)
667
$ps2pdf = 'special_script';
669
Your script will be invoked by latexmk in its usual way as
670
"Special_script file.ps file.pdf". Your script calls Dis-
671
tiller with Distiller's correct arguments.
674
LIST OF RC VARIABLES IN INITIALIZATION FILES
675
Default values are indicated in brackets.
678
If nonzero, the banner message is printed across
679
each page when converting the dvi file to
680
postscript. Without modifying $banner_message,
681
this is equivalent to specifying the -d option.
683
Note that if $banner is nonzero, the
684
$postscript_mode is assumed and the postscript file
685
is always generated, even if it is newer than the
688
$banner_intensity [0.95]
689
Equivalent to the -bi option, this is a decimal
690
number between 0 and 1 that specifies how dark to
691
print the banner message. 0 is black, 1 is white.
692
The default is just right if your toner cartridge
693
isn't running too low.
695
$banner_message ["DRAFT"]
696
The banner message to print across each page when
697
converting the dvi file to postscript. This is
698
equivalent to the -bm option.
700
$banner_scale [220.0]
701
A decimal number that specifies how large the ban-
702
ner message will be printed. Experimentation is
703
necessary to get the right scale for your message,
704
as a rule of thumb the scale should be about equal
705
to 1100 divided by the number of characters in the
706
message. The Default is just right for 5 character
707
messages. This is equivalent to the -bs option.
710
The BibTeX processing program.
712
$bibtex_silent_switch ["-terse"]
713
Switch(es) for the BibTeX processing program when
717
If nonzero, specifies cleanup mode: 1 for full
718
cleanup, 2 for cleanup except for dvi, ps and pdf
719
files, 3 for cleanup except for dep and aux files.
720
This variable is equivalent to specifying one of
730
LATEXMK(1L) LATEXMK(1L)
733
the -c, -c1, or -C options. There should be no
734
need to set this variable from an RC file.
737
Extra extensions of files for latexmk to remove
738
when the -c option is selected.
741
Extra extensions of files for latexmk to remove
742
when the -C option is selected.
745
Custom dependency list -- see section on "Custom
748
@default_files [('*.tex')]
749
Default list of files to be processed.
751
Normally, if no filenames are specified on the com-
752
mand line, latexmk processes all tex files speci-
753
fied in the @default_files variable, which by
754
default is set to all tex files ('*.tex') in the
755
current directory. This is a convenience: just run
756
latexmk and it will process an appropriate set of
757
files. But sometimes you want only some of these
758
files to be processed. In this case you set the
759
(PERL array variable) @default_files in an initial-
760
ization file (e.g., the file "latexmkrc" in the
761
current directory). Then if no files are specified
762
on the command line then the files you specify by
763
setting @default_files are processed.
767
@default_files = ('paper_cur-
770
@default_files = ('paper1',
773
@default_files = ('*.tex',
776
Note that more than file may be given, and that the
777
default extension is '.tex'. Wild cards are
781
The dvi file filter to be run on the newly produced
782
dvi file before other processing. Equivalent to
783
specifying the -dF option.
785
$dvi_previewer ["start xdvi" under UNIX]
786
The command to invoke a dvi-previewer. [Default is
796
LATEXMK(1L) LATEXMK(1L)
799
"start" under MS-WINDOWS; under more recent ver-
800
sions of Windows, this will cause to be run what-
801
ever command the system has associated with .dvi
804
$dvi_previewer_landscape ["start xdvi"]
805
The command to invoke a dvi-previewer in landscape
806
mode. [Default is "start" under MS-WINDOWS; under
807
more recent versions of Windows, this will cause to
808
be run whatever command the system has associated
812
Command to convert dvi to pdf file. (WARNING: The
813
default dvipdf script generates pdf files with
814
bitmapped fonts, which don't look good when viewed
815
by acroread. The script should be modified to give
816
dvips the options "-P pdf" to ensure that type 1
817
fonts are used in the pdf file.)
820
The program to used as a filter to convert a .dvi
821
file to a .ps file. If pdf is going to be gener-
822
ated from pdf, then the value of the
823
$dvips_pdf_switch --- see below --- will be
826
$dvips_landscape ["dvips -tlandscape"]
827
The program to used as a filter to convert a .dvi
828
file to a .ps file in landscape mode.
830
$dvips_pdf_switch ["-P pdf"]
831
Switch(es) for dvips program when pdf file is to be
832
generated from ps file.
834
$dvips_silent_switch ["-q"]
835
Switch(es) for dvips program when silent mode is
838
$dvi_update_method [2 under UNIX, 1 under MS-Windows]
839
How the dvi viewer updates its display when the dvi
840
file has changed. 0 => update is automatic, 1=>
841
manual update by user, which may only mean a mouse
843
viewer's window or may mean a more serious
844
action. 2 => Send the signal SIGUSR1 (as for xdvi
845
under UNIX), 3 => Viewer cannot do an update,
846
because it locks the file. (As with acroread under
849
$force_generate_and_save_includes [0]
850
If nonzero, specifies that the dependency file
851
should always be generated. Equivalent to specify-
862
LATEXMK(1L) LATEXMK(1L)
866
If nonzero, continue processing past minor latex
867
errors including unrecognized cross references.
868
Equivalent to specifying the -f option. Note that
869
specifying the -pvc sets $forec_mode to 1.
871
$force_include_mode [0]
872
If nonzero, force latexmk to include files that
873
don't exist when generating dependency files. A
874
warning is produced instead of an error message and
875
the program terminating. If the file name is not
876
an absolute path, it is assumed to be relative to
877
the current working directory. Equivalent to spec-
878
ifying the -F option.
880
$generate_and_save_includes [0]
881
If nonzero, generates dependency file if it does
882
not exist or is older than the root file (the base
883
.tex file). Equivalent to specifying the -i
886
@generated_exts [( 'ind', 'lof', 'lot', 'toc')]
887
This contains a list of extensions for files that
888
are generated (directly or indirectly) during a
889
LaTeX run and that are read in by LaTeX in later
890
runs. When latexmk generates a dependency list
891
from the .log file, it will ignore files with the
892
extensions in @generated_exts, since NORMALLY they
893
are not true source files, and the time stamps of
894
these may mislead latexmk as to whether the real
895
output files are up-to-date.
897
The extensions "aux" and "bbl" are always excluded
898
from the dependents, because they get special
899
treatment, so they do not need to be in this list.
902
If nonzero, process files regardless of timestamps.
903
Equivalent to the -g option.
905
$includes_from_log [1]
906
If nonzero, extract dependency information from the
907
log file, rather than the source TeX file(s); this
908
is equivalent to the -il option. If zero, extract
909
dependency information by scanning the source TeX
910
file(s); this is equivalent to the -it option.
912
$index_mode [0 and then as determined from the results of
914
If nonzero, run makeindex to produce index of docu-
915
ment. Normally you should not need to set this
916
variable in an RC file, since latexmk determines
917
automatically if makeindex needs to be run.
928
LATEXMK(1L) LATEXMK(1L)
932
If nonzero, run in landscape mode, using the land-
933
scape mode previewers and dvi to postscript con-
934
verters. Equivalent to the -l option.
937
The LaTeX processing program. Note that as with
938
other programs, you can use this variable not just
939
to change the name of the program used, but also
940
specify options to the program. E.g.,
942
$latex = 'latex --src-spe-
945
$latex_silent_switch ["-interaction=batchmode"]
946
Switch(es) for the LaTeX processing program when
947
silent mode is on. Under MS-Windows, the default
948
value is changed to "-interaction=batchmode -c-
949
style-errors", as used by MikTeX and fpTeX.
952
[Default is "NONE lpr" under MS-WINDOWS.] The
953
printing program to print postscript files.
955
Under MS-Windows (unlike UNIX/LINUX), there is no
956
standard program for printing files. But there are
957
ways you can do it. For example, if you have
958
gsview installed, you can use it with the option
961
$lpr = '"c:/Program Files/Ghost-
962
gum/gsview/gsview32.exe" /p';
964
If gsview is installed in a different directory,
965
you will need to make the appropriate change. Note
966
the double quotes around the name: this is neces-
967
sary because one part of the command name ('Program
968
Files') contains a space which would otherwise be
972
$lpr_dvi ["NONE lpr_dvi"]
973
The printing program to print dvi files.
975
$lpr_pdf ["NONE lpr_pdf"]
976
The printing program to print pdf files.
978
Under MS-Windows you could set this to use gsview,
979
if it is installed, e.g.,
981
$lpr = '"c:/Program Files/Ghost-
982
gum/gsview/gsview32.exe" /p';
984
If gsview is installed in a different directory,
994
LATEXMK(1L) LATEXMK(1L)
997
you will need to make the appropriate change. Note
998
the double quotes around the name: this is neces-
999
sary because one part of the command name ('Program
1000
Files') contains a space which would otherwise be
1004
$makeindex ["makeindex"]
1005
The index processing program.
1008
If zero, do NOT generate a pdf version of the docu-
1009
ment. If equal to 1, generate a pdf version of the
1010
document using pdflatex. If equal to 2, generate a
1011
pdf version of the document from the ps file, by
1012
using the command specified by the $ps2pdf vari-
1013
able. If equal to 3, generate a pdf version of the
1014
document from the dvi file, by using the command
1015
specified by the $dvipdf variable. Equivalent to
1016
the -pdf-, -pdf, -pdfdvi, -pdfps options, and is
1017
stored in the dependency file if generated.
1019
$pdflatex ["pdflatex"]
1020
The LaTeX processing program in the version that
1021
makes a pdf file instead of a dvi file.
1023
$pdflatex_silent_switch ["-interaction=batchmode"]
1024
Switch(es) for the LaTeX processing program when
1025
silent mode is on. Under MS-Windows, the default
1026
value is changed to "-interaction=batchmode -c-
1027
style-errors", as used by MikTeX and fpTeX.
1029
$pdf_previewer ["start acroread"]
1030
The command to invoke a pdf-previewer. [Default is
1031
changed to "start" on MS-WINDOWS; under more recent
1032
versions of Windows, this will cause to be run
1033
whatever command the system has associated with
1036
Potential problem under MS-Windows: if acroread is
1037
used as the pdf previewer, and it is actually view-
1038
ing a pdf file, the pdf file cannot be updated.
1039
Thus makes acroread a bad choice of previewer if
1040
you use latexmk's previous-continuous mode (option
1041
-pvc) under MS-windows. This problem does not
1042
occur if ghostview, gv or gsview is used to view
1045
$pdf_update_method [1 under UNIX, 3 under MS-Windows]
1046
How the pdf viewer updates its display when the pdf
1047
file has changed. See $dvi_update_method for the
1048
codes. Note that acroread under MS-Windows (but
1049
not UNIX) locks the pdf file, so the default value
1060
LATEXMK(1L) LATEXMK(1L)
1063
$pid_position = [1 under UNIX, -1 under MS-Windows]
1064
Command used to get all the processes currently run
1065
by the user. The -pvc option uses the command
1066
specified by the variable $pscmd to determine if
1067
there is an already running previewer, and to find
1068
the process ID (needed if latexmk needs to signal
1069
the previewer about file changes). The variable
1070
$pid_position is used to specify which word in
1071
lines of the output from $pscmd corresponds to the
1072
process ID. The first word in the line is numbered
1073
0. The default value of 1 (2nd word in line) is
1074
correct for Solaris 2.6 and Linux. Setting the
1075
variable to -1 is used to indicate that $pscmd is
1078
$postscript_mode [0]
1079
If nonzero, generate a postscript version of the
1080
document. Equivalent to the -ps option.
1082
$preview_continuous_mode [0]
1083
If nonzero, run a previewer to view the document,
1084
and continue running latexmk to keep .dvi up-to-
1085
date. Equivalent to the -pvc option. Which pre-
1086
viewer is run depends on the other settings, see
1087
the command line options $-view=.
1090
If nonzero, run a previewer to preview the docu-
1091
ment. Equivalent to the -pv option. Which pre-
1092
viewer is run depends on the other settings, see
1093
the command line options $-view=.
1096
If nonzero, print the document using lpr. Equiva-
1097
lent to the -p option. Recommend that this is not
1098
set from an RC file or you could waste lots of
1101
$print_type = ["ps"]
1102
Type of file to printout: possibilities are "dvi",
1103
"none", "pdf", or "ps".
1105
$pscmd [On UNIX, the default is "ps -f -u $ENV{USER}". On
1106
MS-WINDOWS the default in "NONE pscmd".] Command
1107
used to get all the processes currently run by the
1108
user. This is used by the -pvc option to determine
1109
if there is an already running previewer. The com-
1110
mand line options for this command under the dif-
1111
ferent flavors of UNIX are quite variable. The
1112
command given is suitable for Solaris 2.6 and for
1113
Linux. The variable $pid_position must also be
1114
set: see its description.
1126
LATEXMK(1L) LATEXMK(1L)
1130
Command to convert ps to pdf file.
1133
The postscript file filter to be run on the newly
1134
produced postscript file before other processing.
1135
Equivalent to specifying the -pF option.
1137
$ps_previewer ["start gv -watch"]
1138
The command to invoke a ps-previewer. [Default is
1139
"start" on MS-WINDOWS; under more recent versions
1140
of Windows, this will cause to be run whatever com-
1141
mand the system has associated with .ps files.]
1143
Note that gv with the -watch option updates its
1144
display whenever the postscript file changes,
1145
whereas ghostview does not.
1147
$ps_previewer_landscape ["start gv -swap -watch"]
1148
The command to invoke a ps-previewer in landscape
1149
mode. [Default is "start" on MS-WINDOWS; under
1150
more recent versions of Windows, this will cause to
1151
be run whatever command the system has associated
1154
$ps_update_method [0 under UNIX, 1 under MS-Windows]
1155
How the postscript viewer updates its display when
1156
the ps file has changed. See $dvi_update_method for
1160
The time to sleep (in seconds) between checking for
1161
source file changes when running the -pvc option.
1163
$texfile_search [""]
1164
This is an obsolete variable, replaced by the
1165
@default_files variable -- see the description of
1166
@default_files for how it works.
1168
For backward compatibility, if you choose to set
1169
it, $texfile_search is a string of space-separated
1170
filenames, and then latexmk replaces @default_files
1171
with the filenames in $texfile_search to which is
1174
$tmpdir ["/tmp" under UNIX, value of environment variable
1175
TEMP under MS-Windows]
1176
Directory to store temporary files that latexmk
1177
generates while running. Currently it only has a
1178
minor use, when making a banner to insert in a
1179
postscript file. There should be no trailing sepa-
1180
rator. It should not be necessary to change this
1181
value except when running under Cygwin.
1192
LATEXMK(1L) LATEXMK(1L)
1196
In any RC file a set of custom dependencies can be set up
1197
to convert a file with one extension to a file with
1198
another. An example use of this would be to allow latexmk
1199
to convert a .fig file to dependencies are set up by using
1200
the @cus_dep_list array. Each string in the array has
1201
four arguments, separated by a space:
1204
The extension of the file we are converting from
1208
The extension of the file we are converting to
1211
must: If non-zero, the file we are converting from must
1212
exist, if it doesn't exist latexmk will give an
1213
error message and exit unless the -f option is
1214
specified. If must is zero and the file we are
1215
converting from doesn't exist, then no action is
1219
The name of the subroutine that latexmk should call
1220
to perform the file conversion. The first argument
1221
to the subroutine is the base name of the file to
1222
be converted without any extension. The subrou-
1223
tines are declared in the syntax of perl. The
1224
function should return 0 if it was successful and a
1225
nonzero number if it failed.
1227
Example in an RC file to convert a .fig file to a .eps
1230
@cus_dep_list = (@cus_dep_list, "fig eps 0 fig2eps");
1233
system("fig2dev -Lps $_[0].fig $_[0].eps"); }
1235
The subroutine fig2eps will only be called if the .fig
1236
file was modified more recently then the .eps file, or the
1237
.eps file does not exist.
1239
If the return value of the subroutine is non-zero, then
1240
latexmk will assume an error occurred during the execution
1245
latex(1), bibtex(1).
1248
Search for .bib files is not correct if they are not in
1258
LATEXMK(1L) LATEXMK(1L)
1261
the current directory; the problem is that the log file
1262
generated by bibtex does not give the full path to the
1263
.bib files. The easiest fix at the moment is to set the
1264
BIBINPUTS environment variable to include explicitly the
1265
path containing your .bib files. Or you can set the $BIB-
1266
INPUTS variable explicitly in one of latexmk's startup
1269
If .bbl file exists and is used, but the .bib file does
1270
not exist, then latexmk should not try to run bibtex, but
1273
Sometimes a viewer (gv) tries to read an updated .ps or
1274
.pdf file after its creation is started but before the
1275
file is complete. Work around: manually refresh (or
1278
(The following isn't really a bug, but concerns features
1279
of previewers.) Preview continuous mode only works per-
1280
fectly with certain previewers: Xdvi on UNIX/LINUX works
1281
for dvi files. Gv on UNIX/LINUX works for both postscript
1282
and pdf. Ghostview on UNIX/LINUX needs a manual update
1283
(reopen); it views postscript and pdf. Gsview under MS-
1284
Windows works for both postscript and pdf, but only reads
1285
the updated file when its screen is refreshed. Acroread
1286
under UNIX/LINUX views pdf, but the file needs to be
1287
closed and reopened to view an updated version. Under MS-
1288
Windows, acroread locks its input file and so the pdf file
1289
cannot be updated. (Remedy: configure latexmk use gsview
1293
David Coppit (username david at node coppit.org) made many
1294
useful suggestions that contributed to version 3. (Please
1295
note that the e-mail addresses are not written in their
1296
standard form to avoid being harvested by worms and
1300
Current version, with substantial modifications, enhance-
1301
ments and bug fixes by John Collins (username collins at
1302
node phys.psu.edu). (Version 3.07).
1303
Modifications and enhancements by Evan McLean (Version
1305
Original script called "go" by David J. Musliner (RCS Ver-