summaryrefslogtreecommitdiff
path: root/support/latexmk/example_rcfiles/README-latexmk-rcfiles
blob: 19690cf168bd14710fa34ffbe4dfb91d3962dfb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
The files in this directory provide suggestions for customizing an
initialization file ("rc file") for latexmk.  See the latexmk
documentation for general information on its initialization files.

Not only do these files provide solutions to particular problems, but
they can be also used as inspiration for solutions to other cases.

NOTES: 

1. The examples are not complete rc files, but contain fragments that
   you can copy to one of your .latexmkrc/latexmkrc files.

2. These examples are developed by particular users to solve
   particular problems.  You may have to customize them for your own
   needs.  So read the comments carefully, and understand how the
   examples are working.

3. I have generally arranged for filenames to be quoted on command
   lines, e.g., 

       system( "makeindex -o \"$_[0].lnd\" \"$_[0].ldx\"" );

   In many cases the quotes may be omitted, as in 

       system( "makeindex -o $_[0].lnd $_[0].ldx" );

   But it is preferable to leave the quotes in, since they provide
   safety against special characters in filenames.  The double quotes
   appear not to cause problems in all situations that I have tried.

5. Note that the files for exceltex and pythontex illustrate an answer
   to an issue that arises in the following generic situation:
   a.  A LaTeX package wants to use an external program to do some
       processing. It does this by writing a control file that is used
       by the external program.
   b.  The user is to run the external program after a first run of
       latex/pdflatex (etc).  It generates some files that are to be
       read by a subsequent compilation of the TeX document.
   c.  It is desired to do the run of the external program and
       to do the extra run of latex/pdflatex only when necessary. 
   d.  Possibly there are further dependencies on files used by the
       external program.
   The third problem is handled nicely by latexmk's normal mechanisms,
   but it is necessary to persuade it to create a suitable rule to run
   the external program.  A nice trick with custom dependencies,
   illustrated by exceltex and pythontex examples, gets the rule set
   up.  The exceltex shows how dependencies on other files can be
   determined. 

6. Further assistance for latexmk can be provided when style files
   provide suitable messages about missing files.  See the
   exceltex1.sty file for an example of what is needed.  This file is
   a modification of exceltex.sty and pythontex.sty that provide the
   necessary assistance.  (The version on which the modification is
   based is the one current on 30 April 2013.)  The necessary support
   is in pythontex, in v. 0.16.

7. Another technique, exemplified in pythontex-latexmkrc, is to append
   lines to the .log file to simulate messages about missing files.
   This provokes latexmk into deducing that the files are intended
   source files.  If one of the other rules then can make that file,
   correct dependency information is obtained.