tlmgr search output

Norbert Preining norbert at preining.info
Wed Apr 24 10:22:40 CEST 2024


Hi Joseph,

> There was a question on TeX-sx yesterday about automatically determining
> 'CTAN' (TeX Live really) packages needed by a document. I started on a
> script with the idea of being to use --recorder, parse the .fls file
> then do a lookup for each line to list all of the TL packages needed.
> That would be handy for anyone using a deliberately minimised TeX system.

Yes, this is what I do regularly.

> However, I ran into the issue that
> 
>     tlmgr search --global --file <filename>
> 
> doesn't return anything I can use from a script - try e.g.
> 
>   print("FOUND " .. os.execute("tlmgr search --global --file article.cls")

Not sooooo bad:

First, I would do

	tlmgr search --file /article.cls

which gives on a texlive-full installed system:

$ tlmgr search --file /article.cls
latex:
        texmf-dist/tex/latex/base/article.cls
latex-base-dev:
        texmf-dist/tex/latex-dev/base/article.cls
$

which is not that bad to parse:

pkg:
\tfull-path

I can make a kind of machine readable
format if you want, any preferences?

> It seems that --machine-readable doesn't work here, as it's not

Yes, it is not implemented.

Best regards

Norbert

--
PREINING Norbert                              https://www.preining.info
arXiv / Cornell University   +   IFMGA Guide   +   TU Wien  +  TeX Live
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13


More information about the tex-live mailing list.