MKJOBTEXMF(1)
π MKJOBTEXMF(1) π
okay bestie, gather round π«Ά this is mkjobtexmf, and it lives in the User Contributed Perl Documentation part of your man pages. it's a little Perl icon that builds you a whole texmf tree for one specific job. yes. for real. let's get into it π
β¨ NAME β¨
mkjobtexmf β Generate a texmf tree for a particular job πΈ
π VERSION π
2011-11-10 v0.8
π¦ SYNOPSIS π¦
so the program mkjobtexmf runs a program and tries to find the used file names. there are two methods available, bestie: option -recorder of TeX (Web2C) or the program strace. pick your fighter π
then it generates a directory with a texmf tree. it checks the found files and tries to sort them in this texmf tree.
it can be used for archiving purposes or to speed up following TeX runs. lowkey iconic.
mkjobtexmf [options]
this runs TeX that can be configured by options. both methods for getting the used file names are available.
mkjobtexmf [options] -- <cmd> [args]
the latter form runs program cmd with arguments args instead of TeX. as method, only program strace is available. periodt.
options:
--jobname <name> Name of the job (mandatory).
Usually this is the TeX file
without extension
--texname <file> Input file for TeX. Default is the
job name with extension '.tex'
--texopt <option> Option for TeX run
--destdir <directory> Destination directory,
default is `<jobname>.mjt'
--output Add also output files
--strace Use strace instead of TeX's
option -recorder
--copy Copy files instead of creating
symbol links
--flat Junk paths, do not make directories
inside the destination directory
--(no)texhash Run texhash, use --notexhash for MiKTeX
--exclude-ext <ext> Exclude files with extension <ext>.
--cmd-tex <cmd> Command for the TeX compiler
--cmd-kpsewhich <cmd> Command for kpsewhich
--cmd-texhash <cmd> Command for texhash
--cmd-strace <cmd> Command for strace
--verbose Verbose output
--help Brief help message
--man Full documentation
--version Print version identification
π DESCRIPTION π
π Running the program
first up, mkjobtexmf runs a program, usually TeX. the TeX compiler is configured by option --cmd-tex. option --texname can be used if the file name extension differs from .tex:
mkjobtexmf --jobname foo --texname foo.ltx
even more complicate cases are possible:
mkjobtexmf --jobname foo --texname '\def\abc{...}\input{foo}'
if another program than TeX should be used (dvips, ...), then this program can be given after --:
mkjobtexmf --jobname foo -- dvips foo
π₯ File recording
two methods are available to get the used file names:
πΌ Recorder of TeX
some TeX distributions (e.g. Web2C) support the option -recorder for its TeX compilers. then the TeX compiler generates a file with extension .fls that records the used input and output files. cute of it honestly.
π΅οΈ Program strace
this program traces system calls and signals. it is used here to log the used files. main character energy fr fr.
π Analyze and link/copy found files
the result directory jobname.mjt is generated. inside the result TEXMF tree is created. each found file is compared against a list of paths of TEXMF trees. if a match is found, the file is linked/copied into the TEXMF tree. the list of paths is generated by program kpsewhich.
if the file cannot be mapped to a TEXMF tree and the file is a relative file name, then it is directly linked/copied into the result directory jobname.mjt. absolute file names are not supported and neither paths with links to parent directories. π
symbolic links are created by default. the files are copied if option --copy is given or symbolic linking is not available.
π OPTIONS π
--jobname=<jobname>β it is the name of the job.<jobname>.texserves as default for the TeX file and<jobname>is used for naming various directories and files. see section FILES.--texname=<name>β the name of the TeX input file, if it differs from<jobname>.tex.--texopt=<opt>β additional option for the TeX compiler, examples are--inior--shell-escape. this option can be given more than once. stack 'em bestie π₯--destdir=<directory>β specifies the name of the destination directory where the result is collected. as default a directory is generated in the current directory with the job name and extension.mjt.--outputβ also add output files.--straceβ use method with programstrace, see DESCRIPTION.--copyβ files are copied instead of creating symbolic links.--flatβ files are linked or copied without path elements. the destination directory will contain a flat list of files or links without directory.
the files ls-R and aliases are ignored.
--exclude-ext=<ext>β files with extension ext are excluded. the option can be given several times or a comma separated list of extensions can be used. examples:
--exclude-ext aux --exclude-ext log --exclude-ext toc
is the same as
--exclude-ext aux,log,toc
--(no)texhashβ as default the filels-Ris generated in thetexmftree, because this is the file name database that might be used in TeX Live. because MiKTeX uses a different mechanism, itstexhashdoes not generate thels-Rfiles and--notexhashsuppresses the call oftexhash.--cmd-tex=<cmd>β command for the TeX compiler. default ispdflatex.--cmd-kpsewhich=<cmd>β command forkpsewhich.--cmd-texhash=<cmd>β command for updating the file name database of the generated texmf tree. default istexmf.--cmd-strace=<cmd>β command forstrace.--verboseβ verbose messages.--helpβ display help screen.-B(-man>β print manual page. (yes bestie that is literally how it's spelled in here, i am not touching it π)--versionβ print version identification and exit.
πΈ EXAMPLES πΈ
TeX file test.tex using TeX's recorder method:
mkjobtexmf --jobname test
TeX file test.tex using LaTeX:
mkjobtexmf --jobname test --cmd-tex latex
format generation:
mkjobtexmf --jobname test --texopt -ini --texname pdflatex.ini
example, how the new texmf tree (Linux/bash) can be used:
TEXMF=!!test.mjt/texmf pdflatex test
example for generating a zip archive (Linux/bash):
(cd test.mjt && zip -9r ../test .)
example for generating a tar archive:
tar cjhvf test.tar.bz2 -C test.mjt .
π UNSOLVED ISSUES, CAVEATS, TODOS π
π§ͺ Experimental software
options, defaults, how the program works might change in future versions. (it's giving beta, ngl.)
π texmf.cnf
currently the method with strace records this files. TeX's recorder does not. useful are texmf.cnf files for variable settings. because we have just one TEXMF tree, the path sections should probably rewritten.
π Settings in environment variables
they are not stored at all. π
π₯ Collisions
the program uses one destination directory and at most one TEXMF tree for the result. however, the source files can come from different directories and TEXMF trees. therefore name collisions are possible.
the program follows the strategy not to delete files in the destination directory. that allows to collect files from differnt runs. thus collisions are resolved in the manner that the first entry that is made in the destination directory wins. first come, first served bestie π
βοΈ Configuration file
it would save the user from retyping the same options again and again.
π©Ή Uncomplete recording
bugs in TeX's file recording might result in incomplete file recording (e.g. pdfTeX 1.40.3 does not record .pfb and .pk files).
...
ποΈ FILES ποΈ
<jobname>.mjt/β directory where the resulting texmf tree and symbol links are stored. it can be changed by option--destdir.<jobname>.flsβ name of TeX's recorder file.<jobname>.straceβ log file where the result ofstraceis stored.
π«Ά AUTHOR π«Ά
Heiko Oberdiek, email: heiko.oberdiek at googlemail.com
βοΈ COPYRIGHT AND LICENSE βοΈ
Copyright 2007, 2008, 2011 by Heiko Oberdiek.
this library is free software; you may redistribute it and/or modify it under the same terms as Perl itself (Perl Artistic License/GNU General Public License, version 2).
π HISTORY π
2007/04/16 v0.1- first experimental version.
2007/05/09 v0.2- typo in option name fixed.
2007/09/03 v0.3- new options:
--copy,--flat,--destdir
- new options:
2007/09/04 v0.4- bug fix in
map_files_texmf.
- bug fix in
2007/09/06 v0.5- support for
configureadded. (thanks to Norbert Preining for writing a first version of the configure stuff.)
- support for
2008/04/05 v0.6- tiny fix in target
uninstallin fileMakefile.in. (thanks to Karl Berry)
- tiny fix in target
2008/06/28 v0.7- fix for unknown option
"--cmd-strace". (thanks to Juho NiemelΓ€)
- fix for unknown option
2011/11/10 v0.8- remove colon from drive specification when making directories.
- option
--(no)texhashadded. - some support for MiKTeX (thanks Ulrike Fischer).
- various fixes in the generation of the documentation.
- options
--exclude-extand--versionadded.
and that's the whole thing bestie, no cap π this page is perl v5.8.1, dated 2011-11-10 v0.8, and honestly it ate. go build a texmf tree, you've got this πβ¨π¦
π¦ where this page comes from
- arch rolling: texlive-doc 2026.1-1 Β· GPL
- fedora 43: texlive-mkjobtexmf 11:svn29725-93.fc43 Β· GPL-2.0-only
- fedora 43: texlive-mkjobtexmf 11:svn29725-95.fc43.1 Β· GPL-2.0-only
- fedora 44: texlive-mkjobtexmf 12:svn29725-105.fc44 Β· GPL-2.0-only
- fedora 44: texlive-mkjobtexmf 12:svn29725-111.fc44 Β· GPL-2.0-only
- opensuse-leap 16.0: texlive-mkjobtexmf-doc 2025.221.0.0.8svn29725-160000.3.1 Β· Artistic-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms