MKJOBTEXMF(1)

πŸ“¦ version 2026.0, in alpine 3.24

πŸ’– 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.

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>.tex serves 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 --ini or --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 program strace, 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 file ls-R is generated in the texmf tree, because this is the file name database that might be used in TeX Live. because MiKTeX uses a different mechanism, its texhash does not generate the ls-R files and --notexhash suppresses the call of texhash.
  • --cmd-tex=<cmd> β€” command for the TeX compiler. default is pdflatex.
  • --cmd-kpsewhich=<cmd> β€” command for kpsewhich.
  • --cmd-texhash=<cmd> β€” command for updating the file name database of the generated texmf tree. default is texmf.
  • --cmd-strace=<cmd> β€” command for strace.
  • --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 of strace is stored.

🫢 AUTHOR 🫢

Heiko Oberdiek, email: heiko.oberdiek at googlemail.com


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
  • 2007/09/04 v0.4
    • bug fix in map_files_texmf.
  • 2007/09/06 v0.5
    • support for configure added. (thanks to Norbert Preining for writing a first version of the configure stuff.)
  • 2008/04/05 v0.6
    • tiny fix in target uninstall in file Makefile.in. (thanks to Karl Berry)
  • 2008/06/28 v0.7
    • fix for unknown option "--cmd-strace". (thanks to Juho NiemelΓ€)
  • 2011/11/10 v0.8
    • remove colon from drive specification when making directories.
    • option --(no)texhash added.
    • some support for MiKTeX (thanks Ulrike Fischer).
    • various fixes in the generation of the documentation.
    • options --exclude-ext and --version added.

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