1MKJOBTEXMF(1) User Contributed Perl Documentation MKJOBTEXMF(1)
2
3
4
6 mkjobtexmf -- Generate a texmf tree for a particular job
7
9 2011-11-10 v0.8
10
12 The progam mkjobtexmf runs a program and tries to find the used file
13 names. Two methods are available, option "-recorder" of TeX (Web2C) or
14 the program strace.
15
16 Then it generates a directory with a texmf tree. It checks the found
17 files and tries sort them in this texmf tree.
18
19 It can be used for archiving purposes or to speed up following TeX
20 runs.
21
22 mkjobtexmf [options]
23
24 This runs TeX that can be configured by options. Both methods for get‐
25 ting the used file names are available.
26
27 mkjobtexmf [options] -- <cmd> [args]
28
29 The latter form runs program cmd with arguments args instead of TeX. As
30 method only program strace is available.
31
32 Options:
33
34 --jobname <name> Name of the job (mandatory).
35 Usually this is the TeX file
36 without extension
37 --texname <file> Input file for TeX. Default is the
38 job name with extension '.tex'
39 --texopt <option> Option for TeX run
40 --destdir <directory> Destination directory,
41 default is `<jobname>.mjt'
42 --output Add also output files
43 --strace Use strace instead of TeX's
44 option -recorder
45 --copy Copy files instead of creating
46 symbol links
47 --flat Junk paths, do not make directories
48 inside the destination directory
49 --(no)texhash Run texhash, use --notexhash for MiKTeX
50 --exclude-ext <ext> Exclude files with extension <ext>.
51 --cmd-tex <cmd> Command for the TeX compiler
52 --cmd-kpsewhich <cmd> Command for kpsewhich
53 --cmd-texhash <cmd> Command for texhash
54 --cmd-strace <cmd> Command for strace
55 --verbose Verbose output
56 --help Brief help message
57 --man Full documentation
58 --version Print version identification
59
61 Running the program
62
63 First mkjobtexmf runs a program, usually TeX. The TeX compiler is con‐
64 figured by option "--cmd-tex". Option "--texname" can be used, if the
65 file name extension differs from .tex:
66
67 mkjobtexmf --jobname foo --texname foo.ltx
68
69 Even more complicate cases are possible:
70
71 mkjobtexmf --jobname foo --texname '\def\abc{...}\input{foo}'
72
73 If another program than TeX should be used (dvips, ...), then this pro‐
74 gram can be given after "--":
75
76 mkjobtexmf --jobname foo -- dvips foo
77
78 File recording
79
80 Two methods are available to get the used file names:
81
82 Recorder of TeX
83 Some TeX distributions (e.g. Web2C) support the option -recorder
84 for its TeX compilers. Then the TeX compiler generates a file with
85 extension .fls that records the used input and output files.
86
87 Program strace
88 This program traces system calls and signals. It is used here to
89 log the used files.
90
91 Analyze and link/copy found files
92
93 The result directory jobname.mjt is generated. Inside the result TEXMF
94 tree is created. Each found file is compared against a list of paths of
95 TEXMF trees. If a match is found, the file is linked/copied into the
96 TEXMF tree. The list of paths is generated by program kpsewhich.
97
98 If the file cannot be mapped to a TEXMF tree and the file is a relative
99 file name, then it is directly linked/copied into the result directory
100 jobname.mjt. Absolute file names are not supported and neither paths
101 with links to parent directories.
102
103 Symbolic links are created by default. The files are copied if option
104 "--copy" is given or symbolic linking is not available.
105
107 --jobname=<jobname>
108 It is the name of the job. `<jobname>.tex' serves as default for
109 the TeX file and <jobname> is used for naming various directories
110 and files. See section "FILES".
111
112 --texname=<name>
113 The name of the TeX input file, if it differs from <jobname>.tex.
114
115 --texopt=<opt>
116 Additional option for the TeX compiler, examples are "--ini" or
117 "--shell-escape". This option can be given more than once.
118
119 --destdir=<directory>
120 Specifies the name of the destination directory where the result is
121 collected. As default a directory is generated in the current
122 directory with the job name and extension `.mjt'.
123
124 --output
125 Also add output files.
126
127 --strace
128 Use method with program strace, see "DESCRIPTION".
129
130 --copy
131 Files are copied instead of creating symbolic links.
132
133 --flat
134 Files are linked or copied without path elements. The destination
135 directory will contain a flat list of files or links without direc‐
136 tory.
137
138 The files `ls-R' and `aliases' are ignored.
139
140 --exclude-ext=<ext>
141 Files with extension <ext> are excluded. The option can be given
142 several times or a comma separated list of extensions can be used.
143 Examples:
144
145 --exclude-ext aux --exclude-ext log --exclude-ext toc
146
147 is the same as
148
149 --exclude-ext aux,log,toc
150
151 --(no)texhash
152 As default the file `ls-R' is generated in the `texmf' tree,
153 because this is the file name database that might be used in TeX
154 Live. Because MiKTeX uses a different mechanism, its `texhash' does
155 not generate the `ls-R' files and "--notexhash" suppresses the call
156 of `texhash'.
157
158 --cmd-tex=<cmd>
159 Command for the TeX compiler. Default is pdflatex.
160
161 --cmd-kpsewhich=<cmd>
162 Command for kpsewhich.
163
164 --cmd-texhash=<cmd>
165 Command for updating the file name database of the generated texmf
166 tree. Default is texmf.
167
168 --cmd-strace=<cmd>
169 Command for strace.
170
171 --verbose
172 Verbose messages.
173
174 --help
175 Display help screen.
176
177 -B(-man>
178 Print manual page.
179
180 --version
181 Print version identification and exit.
182
184 TeX file test.tex using TeX's recorder method:
185
186 mkjobtexmf --jobname test
187
188 TeX file test.tex using LaTeX:
189
190 mkjobtexmf --jobname test --cmd-tex latex
191
192 Format generation:
193
194 mkjobtexmf --jobname test --texopt -ini --texname pdflatex.ini
195
196 Example, how the new texmf tree (Linux/bash) can be used:
197
198 TEXMF=!!test.mjt/texmf pdflatex test
199
200 Example for generating a zip archive (Linux/bash):
201
202 (cd test.mjt && zip -9r ../test .)
203
204 Example for generating a tar archive:
205
206 tar cjhvf test.tar.bz2 -C test.mjt .
207
209 Experimental software
210 Options, defaults, how the program works might change in future
211 versions.
212
213 texmf.cnf
214 Currently the method with strace records this files. TeX's
215 recorder does not. Useful are texmf.cnf files for variable set‐
216 tings. Because we have just one TEXMF tree, the path sections
217 should probably rewritten.
218
219 Settings in environment variables
220 They are not stored at all.
221
222 Collisions
223 The program uses one destination directory and at most one TEXMF
224 tree for the result. However, the source files can come from dif‐
225 ferent directories and TEXMF trees. Therefore name collisions are
226 possible.
227
228 The program follows the strategy not to delete files in the desti‐
229 nation directory. That allows to collect files from differnt runs.
230 Thus collisions are resolved in the manner that the first entry
231 that is made in the destination directory wins.
232
233 Configuration file
234 It would save the user from retyping the same options again and
235 again.
236
237 Uncomplete recording
238 Bugs in TeX's file recording might result in incomplete file
239 recording (e.g. pdfTeX 1.40.3 does not record .pfb and .pk files).
240
241 ...
242
244 <jobname>.mjt/
245 Directory where the resulting texmf tree and symbol links are
246 stored. It can be changed by option "--destdir".
247
248 <jobname>.fls
249 Name of TeX's recorder file.
250
251 <jobname>.strace
252 Log file where the result of strace is stored.
253
255 Heiko Oberdiek, email: heiko.oberdiek at googlemail.com
256
258 Copyright 2007, 2008, 2011 by Heiko Oberdiek.
259
260 This library is free software; you may redistribute it and/or modify it
261 under the same terms as Perl itself (Perl Artistic License/GNU General
262 Public License, version 2).
263
265 2007/04/16 v0.1
266 * First experimental version.
267 2007/05/09 v0.2
268 * Typo in option name fixed.
269 2007/09/03 v0.3
270 * New options: "--copy", "--flat", "--destdir"
271 2007/09/04 v0.4
272 * Bug fix in map_files_texmf.
273 2007/09/06 v0.5
274 * Support for `configure' added. (Thanks to Norbert Preining for
275 writing a first version of the configure stuff.)
276 2008/04/05 v0.6
277 * Tiny fix in target `uninstall' in file `Makefile.in'. (Thanks to
278 Karl Berry)
279 2008/06/28 v0.7
280 * Fix for unknown option `"--cmd-strace"'. (Thanks to Juho Niemelä)
281 2011/11/10 v0.8
282 * Remove colon from drive specification when making directories.
283 * Option "--(no)texhash" added.
284 * Some support for MiKTeX (thanks Ulrike Fischer).
285 * Various fixes in the generation of the documentation.
286 * Options "--exclude-ext" and "--version" added.
287
288
289
290perl v5.8.1 2011-11-10 v0.8 MKJOBTEXMF(1)